From patchwork Tue Jun 11 14:50:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 498 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 91CA83F08F for ; Tue, 11 Jun 2019 16:55:00 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id b127sf9767238pfb.8 for ; Tue, 11 Jun 2019 07:55:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264899; cv=pass; d=google.com; s=arc-20160816; b=KgPaYhc60e8ZDTRMZaj5+R9kO7mjbEinnmUutblLCRcHgLQB7pNzVky7lMwWukryUW j0mBfZ5kubLgJjSPJKdgA0Rsl5aDQJRoNxQAnq0yUfQNkEJPnbAb3bz3cpatfyd1GUEo qGKK8IyJ+nD9ROLcP5mPimv249lt988LP/5f05y0L3A1Ge/Lyyy+dPm1Qew8oGeHCTGa 9KUYd9mmG1pNwBJLeXry8gAQK11URbb4NAvISp7VMB8wLNfXVVeH1SyMQPyh2YF4mN31 +WjYNFykklu0cXK5Q1wJu+7l542qDji2+m/D5ea7+4gjIKY8vmPBJz1K4BkjyfHlYnH1 V31w== 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=ycYk2nqlaqxjeU1putVGipzyeE9xjAQGj240udr3nys=; b=BW+Ry7muBmhpKFc8HTq4ASvR6Sap7DMgEAJIdaE2qWVLv6M1YG7TJJyeb00GE/FDu0 IkgJqrk8By7J3Vx6bazxNRfdrgoPmZb3GXdiSlWw9km0bAh9j0LgvOwCcXGLLIlZBVET f8vXrm0D8NPZtnkQg+VzFsfS0hRMUPAkwk0gwI35QOtWjLzpB4aQaYeQObzEZGj+gapM uzjFxFoX8jFonTfN6ZHLws8zieDOirN4B1xKZTV3jQPnw0NUSnK9anOohFe2dJE5lcNO Kg8V4/NFgwpTev8Fj30/6vVRQjNOPbfJLp3FZwb5U3f2V49h/svaQw14zpt2b1Ta+RBj G7Nw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="UPQW2/Rr"; 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=ycYk2nqlaqxjeU1putVGipzyeE9xjAQGj240udr3nys=; b=FKHOOiaeTjp6VD/QQQuMSEe8PoyAGwZdxlx5zRVAQ16lIAtFrrgjHAtzCPjhiF0gey 7+Rbp1zhQKRJpcP8lRqw5XDzfJhq6dZw2m+3S89BYmaaOYDCQgPi5vBFKJ8GYdOIWVEj n7RdzuiJikRYNDu+Myd/W1rhaWtmAg3kxasxs= 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=ycYk2nqlaqxjeU1putVGipzyeE9xjAQGj240udr3nys=; b=obKl3SNlbqyGVymxm5x7Cb70FtxGVPxUXtI/RXbtP6t7Nj3yRLrxUU8J0TrMVcVJzk fAtZlgFFKAZwzVz5rdWo+aVy9F8vETArcJc90niVII9kaZFgw02gYDJD7dt6Ime5POng xjTX0WEgBZYhdFCd6xHDqOdnK2jYaKz8r9hXDS27dOEdcp21Qfng3InS5jIK+Vmvo0e/ JIzvRqU0NwkMPNoOMvnjWfLILwJFEjBJmIMzAt7oYuHwz4BRW1Ls56Bs5Pzl5AcvLR+w nWC6774ZkU1UGOTe6DaOt8Kd4Cjci85Wx4x0i39UZkpSDA2YXTX1aKJONZjCvingtHSg kBfQ== X-Gm-Message-State: APjAAAWMHTDdPLxMv04W9wJgpBKWhQnUc3FgV6oSof4Z9D9w0mjpUYYv pYGVq6IsjM9brXyHXbOTBIEIC3xg X-Google-Smtp-Source: APXvYqz0AAOiOO/kuzZXsaXlls6dpnFGriwo+Br/X6uZtsOIHvO4smpORt1MLNE3fQe7EuoJHyj8NQ== X-Received: by 2002:a17:902:e306:: with SMTP id cg6mr46238224plb.341.1560264899413; Tue, 11 Jun 2019 07:54:59 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:85:: with SMTP id 127ls4501776pfa.1.gmail; Tue, 11 Jun 2019 07:54:59 -0700 (PDT) X-Received: by 2002:a63:6948:: with SMTP id e69mr9886038pgc.441.1560264898951; Tue, 11 Jun 2019 07:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264898; cv=none; d=google.com; s=arc-20160816; b=JNfz6gdkb76Czn/OuhmQBeYxbVAzQD5pTeJul6jv7l/0TciuDbze4IkEZ53x/V0ZJ7 DckzzGdYi1C9/BWXY/4ftOPD32980lRPEZlwakdCkChJu4e/7wOtc4TRXPaAawI8+6zj iK/WxygxAcnK4QGdSbAaYM00MXZ1ZxNhM9/2X3oYq2DKw4guntUclqhOg2sOhyDkJ1gC lIgLwFY/69LmPV9AWLNQ3wqJcNOlv0lxHKw4tt2zCEFzk8fMX4H/osmNJ6Amgk9R6sFt Fm3RJ9OWi6LiVKne/pfIDg9I6/yLFN8AvUMcbqKEYthKdxSfzpZSW4DEi0uXrGJX8UhU AYaA== 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=91d3Q/abSo/d7WjJEcuCr0VuZ8ECJ4wV6RZKeJL/eXg=; b=LQ1dG+T4BXeVUq60IIEZA8KTPtpqjxMqEAV2iqIVB2ha8Of2KhhULPYqUp7aurBgMn j4HFAyUW4zg62L8OyyCOb4YiHl4gzoGAP+goU2W/FHp0AXlyAUywUjM/qkJePAwKBMRg 0v1wDGJKuDboMLbj+keY2smf78qQ6YSLoP+1pLBZ+8hVkkHdo20H0+Jb1rC7gx3rhLZ1 32RuCOxz02tDFcxPjVKq3XtA5FrvFsEc5rE1NHQNtruOhesUnB81+e4z7nplwJasVNNH GuBKfJVyR1BD8Z8x7z0inlfyRUSGxxEXhC2/NC8RSNsFdamYTLB2zLOMDlPOX/aJ79uQ mjUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="UPQW2/Rr"; 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 f32sor2030962pje.11.2019.06.11.07.54.58 for (Google Transport Security); Tue, 11 Jun 2019 07:54:58 -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:90a:1706:: with SMTP id z6mr26420430pjd.108.1560264898607; Tue, 11 Jun 2019 07:54:58 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.54.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:54:58 -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 47/92] ram: rk3399: debug: Add sdram_print_stride Date: Tue, 11 Jun 2019 20:20:50 +0530 Message-Id: <20190611145135.21399-48-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="UPQW2/Rr"; 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 code to print the channel stride, this would help to print the stride of associated channel. Here is sample print on LPDDR4, 50MHz. 256B stride Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- .../include/asm/arch-rockchip/sdram_common.h | 5 ++++ drivers/ram/rockchip/sdram_debug.c | 29 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 3935733871..69cafda904 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -132,10 +132,15 @@ inline void sdram_print_ddr_info(struct sdram_cap_info *cap_info, struct sdram_base_params *base) { } + +inline void sdram_print_stride(unsigned int stride) +{ +} #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); +void sdram_print_stride(unsigned int stride); #endif /* CONFIG_RAM_ROCKCHIP_DEBUG */ #endif diff --git a/drivers/ram/rockchip/sdram_debug.c b/drivers/ram/rockchip/sdram_debug.c index 19e9225c12..9cf662675b 100644 --- a/drivers/ram/rockchip/sdram_debug.c +++ b/drivers/ram/rockchip/sdram_debug.c @@ -116,3 +116,32 @@ void sdram_print_ddr_info(struct sdram_cap_info *cap_info, printdec(cap >> 20); printascii("MB\n"); } + +void sdram_print_stride(unsigned int stride) +{ + switch (stride) { + case 0xc: + printf("128B stride\n"); + break; + case 5: + case 9: + case 0xd: + case 0x11: + case 0x19: + printf("256B stride\n"); + break; + case 0xa: + case 0xe: + case 0x12: + printf("512B stride\n"); + break; + case 0xf: + printf("4K stride\n"); + break; + case 0x1f: + printf("32MB + 256B stride\n"); + break; + default: + printf("no stride\n"); + } +}