From patchwork Tue Jun 11 14:50:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 496 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 77D963F08F for ; Tue, 11 Jun 2019 16:54:55 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id d3sf6358922pgc.9 for ; Tue, 11 Jun 2019 07:54:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264894; cv=pass; d=google.com; s=arc-20160816; b=DhoEscPdgoGhFsXYqWcVy3f7OeAWUYklQzTSMBbkq7klXbD6AZEd75XZkDePLBOY83 OGUNMjrmmDOSG1isolcTYU6aINX4Evomu5LZLecMNPbwAptn3AE0OkPBdTv1NlNrU37n Claf/KSFvHhZFTtvRR6nQBf1JMdH/FNgJgCMF/bWG22QNfVmmpKsT4OgO0RGypANihVc 4RiN/3PEwDG0VADIntsXXuR/RcjIN39sTwKtKVFDZEuBBgbW4RKssPwc8ChnScjBJ8bj irgnxLaayNGhErjsciB4uoLEILWEa+ok1c57O/Rb57D/XzuI6sZoxVfoPOWN9zMjhXos jIYQ== 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=0ajNIuC+Bqqxosb9VHgvMQ9iga5FOe1zL8J6w0xK5wI=; b=B5prvdEqiauUKoeLYALBD908WQ5XCOLWyMf0PGq7nhusO4EQ8V1mxBgXsJ1Q6AA7pf Tc6a8DCHJdSCN8VcfaHAU6C7UEXUnwTbkib7nRzhPQNdYPKzE+duT45z52mPiC0Zlpsr WhpZCFq1OxuiH47HLDEUu/Dy2+ZEnrHExblm3LiMRrgkiBSrE+NDCPbLoLKKYhsp6CRr b1Y5PKVRdYta+apNizpB9vtxCoshTewOL7fuW86BUek524uhnUIUy10PBF4T4KrHI4dx QhbaoBPESwY9rF4POHWopsVbXlKqkMt5XF8SMhrpKKAMgoHxbxnFjXFHmXKoqJIte4e/ is2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ByS6AL9F; 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=0ajNIuC+Bqqxosb9VHgvMQ9iga5FOe1zL8J6w0xK5wI=; b=Rpehn5T64CzrsLHpMRuhOLnoCsPmAjn8h7ZEz7k0KOnTBgBo0Q9u8jtbpj7C3KQNPj Bd7e9CuVtcpqjr9TbSktMQFInyxFfo1AWKB5xVkyhz1sqEj7AvQq1pYS61qAc2sJJYAs e/e/KB5HFkctU14Jj/ZpMA/ZWL1pNTfLbjS5w= 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=0ajNIuC+Bqqxosb9VHgvMQ9iga5FOe1zL8J6w0xK5wI=; b=PD1lFY+Ss8eOZOed0B8Qyl57VsRDEhQQ3Z0YUACoZE8YIaBvP23pLv8dRvcNpPijna WzGvEZ7zMihBKPQ+eTxYbMMTckh7C7zHKRCOMfqjXwdXDrzX3F5w3tZdHigJL0m3dZ3n D6TjMNDqX8FGExhR/8peIefHjO+4Y/5oPOJGzj+CMeKuIyl5dsRoALTm7pdHlamzIdpr PZ+O0J0VNVnZWSrCK2UByp45b+LDdwwcocK7lN6NOsFrz4Sa2q0XSOd0xpt30myG3sWB 52NM/box4TPDhf3PgG/jJlNmnxt552ZQKNyJsOTRBCfrZ7E5tyBoHG2fILe97oUIPa3C 8orQ== X-Gm-Message-State: APjAAAXlTTotlRdkShgvew866Y4uF2XeEH/zG1u3Z2zImdojiDM21ycS tDneBF3Wrgfi6OMMbiw3s/uUvyBI X-Google-Smtp-Source: APXvYqx2BfxZ4aXyR7Z6NRQXv33JhVFyJrSjzQfu52gwLpQL5TN/K+DjBTK0vMfg3DSp8Sa4hmzEHQ== X-Received: by 2002:a62:2ccc:: with SMTP id s195mr17782626pfs.256.1560264894328; Tue, 11 Jun 2019 07:54:54 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:6849:: with SMTP id d70ls4513642pgc.7.gmail; Tue, 11 Jun 2019 07:54:54 -0700 (PDT) X-Received: by 2002:a65:5302:: with SMTP id m2mr20351809pgq.266.1560264891472; Tue, 11 Jun 2019 07:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264891; cv=none; d=google.com; s=arc-20160816; b=zIiaCpK8McFZ21FitxmB2fji+7oO/9JEWzctp+jCfA0/16hVBAo34yOOr+HsuMp6T0 wjRjJ7Ev+SJQPzku2wGUqM26AycE6zzSTeHSDdg6AZCUS9ax4mC1uYRYNERl761FLoIU 38jQmqizeyq/nNw0AY1xpf/JsUUw8SpOWYIt2ObEswdwn9nTNVzhfcrpRN11BO+/ddSk QyPtqJ/O8L3R/D/fqIeAiwey/DCWS6g9u7jx4TXMkXuTPeNr0ogomts4TwYbuulyviWp KAypvJrqoXPcpkG/vCRRzTmvPqiYDqkjUecaLKfq6tVdQ7HU/NU5lJSGHjFCE1nwsk8s VLkA== 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=YkuVVRMXiZIA/m7cVW93c891hOorYukwdD8YcfXRjME=; b=g4+guJY7xqgbn6QnA4nZwIOhHlgvUrfdagCiyDu5r/n/FRPAwlaNN5T9UpOfqhsUKM AFA/QXRR2hNUYkNyQa4b3iXBR7/eKkC1ORjb28XLpbKghW/XMwTXRPfZMMeJfIn1lZw/ FEEfUWxZhAEZBKMCGUu2ogFnjnik8ynz2WyumGNmHDritFyL219n2XyiPmDeGXl7xiI6 b7y31ajJ1EoquU80Dt+TV4KnmO8AoDHVbd/VnwfPXCurGTAT9S7Og33UcaWEm9YQe53c sn9P7+N/1z/0zH3xQCG1iNzo0U5ksCkmtnoXHOuoshV6dhDVZSYIsH1JIHMQsLh+Ewbw ghwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ByS6AL9F; 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 c25sor13147489pfn.55.2019.06.11.07.54.51 for (Google Transport Security); Tue, 11 Jun 2019 07:54:51 -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:aa7:921a:: with SMTP id 26mr37534014pfo.99.1560264891166; Tue, 11 Jun 2019 07:54:51 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.54.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:54:50 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 45/92] ram: rockchip: debug: Add sdram_print_ddr_info Date: Tue, 11 Jun 2019 20:20:48 +0530 Message-Id: <20190611145135.21399-46-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190611145135.21399-1-jagan@amarulasolutions.com> References: <20190611145135.21399-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=ByS6AL9F; 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 ebf4148b4d..3935733871 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -127,8 +127,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); +}