From patchwork Mon Jul 15 18:28:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 741 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 F05273F08F for ; Mon, 15 Jul 2019 20:29:48 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id a21sf10954305pgh.11 for ; Mon, 15 Jul 2019 11:29:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563215387; cv=pass; d=google.com; s=arc-20160816; b=j+5z7qhwjqZslCUji/CDFZrpooiFqMsECkx8ERS4vxMfKY2Ump+MRj3GgHNWb04kWf cYEeM9ZfwXIdxc3fYDVmLNTOrYJcwDN/gFinsEIDCR6RzgzvIH5dY6cvrN1t9KpiCgL7 0JeVaO+OFw+M76PUxHvPqOQDkfzzKQWidfyBUvcTeGsBUxCvQAqSa59Z2D1KAxvnpLpm AiUPISptx/zAzF2RxTuEmEMjNPlVVQ4y84shLLoVUti1J9eYOGUiF+w3Qsc0bspYrE1x Ik+je7XHgXjS8p3M7n1NF3rB34mrjRrxnR1KXyFmgXWFOEBOFep7NBP8Vh/Zcfazmuw+ AEMA== 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=yLli9Bni/5vYCMlDm7qT36LZZzsJIqTEG9giynToQJ8=; b=nxJev0UMnpETeIcCMbo4LUZM+6Ac3mqf60W3MqxrDGV1IrhZdkJnAWoN07qDi9boyC CwZs0c8FcGdaQYVWoZNdU92i5j3xetk9my+ea5IT46AMG6+hxto6RsMLITIEsJA2hdaH gE8+6DLZN56bqCaoJHs/W+m4bjjtXIqqpOTIOH56xMR85hcfiXBVVpG/SrmASrZZ7MIp 4vX66jBNaEjtAAv7vS+5HalwJ8QL+gGYN59igNkDUDnCTtTWnCK7tktU9IKP8P6Pm4hL QPGruIX1FpZQsIBm8Tm++PD5VHTZsE6Cyt3Vdh0aeOf7XWUMf9gM+uEnfTsAn5CHfyGz Er8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z3vRidoK; 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=yLli9Bni/5vYCMlDm7qT36LZZzsJIqTEG9giynToQJ8=; b=SXZbc0FoiLdMIG5exGnRUBCm+Mze47Il0PFafnICP+3PKKP+w5/M2MsLgvs0/mlY3B FdQhR8WWgWU0LtX+ud/oDS5MB6kPePTVXyngoJnRZbRBDr2kqbqq2SSkf1PqArsNLrVE GG5bzAGR1PH7S5LWuWgKEBqitTIxDGU95epLc= 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=yLli9Bni/5vYCMlDm7qT36LZZzsJIqTEG9giynToQJ8=; b=Paq7gEVYt6dhr+WSLy5qAqvQDSw/yN6lHls4hvj8EUJGz/5BV6ps5iZ5SBbKyNVEoI 1Di/7HCb6T8ZPuRDWyb2YHu2tqSlKKqgHw8RDDyhCIHDnIEiEWjwfG8YCvYSSCW2MTzX b8MgZER/cFdZOu0u2kf/KjfDpxLJLP4LxpjtW9iv7WBkoC6SP5KM17OznmNWrUpPP9M5 rk2mGw9BMhbvJ7Ug4vowUrTQBGLzmT8Ti+Iy6X5an/clKzVvXbzY7WPuQlDTkHycyj81 Gs/Cg3R9dErOtRewPQtpdmgzJHi5Dy6JMLa0nJ+DcLmicl0wVxkcW12uRuMxWBFrUkaz Oy/w== X-Gm-Message-State: APjAAAW0m0r/Ngm1AReo/kZ4VtLm12SeADf0YihxVotVpXvO0E1XfhFr xFgE45NFtTrOq+lNe2ZMyoiBv2Bo X-Google-Smtp-Source: APXvYqz6Bqo/z2zhq68LfUOdsKibDYU3WseV5dR/L3Gjq0ppsMpbjrlBH9AYc8XW+G5PGLntjxe05A== X-Received: by 2002:a17:902:8c83:: with SMTP id t3mr29628851plo.93.1563215387798; Mon, 15 Jul 2019 11:29:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:7a43:: with SMTP id j3ls1304596pgn.0.gmail; Mon, 15 Jul 2019 11:29:47 -0700 (PDT) X-Received: by 2002:a63:5a4b:: with SMTP id k11mr28532842pgm.143.1563215387352; Mon, 15 Jul 2019 11:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563215387; cv=none; d=google.com; s=arc-20160816; b=h1PBTcdP1MmQV8SdsruNEPvDjbz2IOW3ONYWiGXQSi5ZEkr2s0G3fAvhjVQQGTop6p irolCO+khwRTzXZqLD01sSX5gNd5ti2kBNmvYwy2qSJDGfWP/oP1n46q8kCJ4OMOJ2LV aq1YHgpoB5+3NmTx36apTaX3Ol42xqFEKZnFiNKKIrF8LcSZebjBAA5h56IkHFSFDHmU 2ZhC/+ECjBLcRWlCP1JhAYS3rkNk7s65cGzbYJsYQGHlXrQl1pwXlaqLBTGWyu74j8C6 bSAoY4IQu0Mdcjs03jTj+kY2PC8Iw8qp5fLttmiRcjCKvTfBopHu9pje/FUU/hgRvlZc L7VA== 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=wljUduZ1j0xBQtRG6+5UBc7WpND1xlvxojNK7TDmbCM=; b=PlKaF0ek5NhElBOyXsJUD4AbCuiWBJ29uWjhjufXr+D3yo/9417aJDvYP1geJtbVYz Nqo2jfGYZY/0txEw7sLLca3EOhrxfbWBYXrXOyFiQzXJr4slcr1g5wOSpKgC09oWlfPh J1TIDgJcG5qUTTGmalC9HkQtOGGsytSp4/M41TPH6GbNq8twgKUOWxgLLiAZ7dgcR8zs 4UK4vdMrICJZDJE3Qi1iAmS9150w5NPV6h6Bq7vJQ++TO3yDkltmbNChEWOyFP5qVGY5 qHUQtx8TjvZ8bbyZeUDC+apFRUZfvyD0JFAxD/sFcEA0m4hL0I088xKzcmiQ4q3QgGU7 b97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Z3vRidoK; 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 j39sor22035421plb.22.2019.07.15.11.29.47 for (Google Transport Security); Mon, 15 Jul 2019 11:29:47 -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:be15:: with SMTP id r21mr29254803pls.293.1563215387057; Mon, 15 Jul 2019 11:29:47 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id y133sm20250075pfb.28.2019.07.15.11.29.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:29:46 -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 v3 11/18] ram: rockchip: debug: Add sdram_print_ddr_info Date: Mon, 15 Jul 2019 23:58:49 +0530 Message-Id: <20190715182856.21688-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182856.21688-1-jagan@amarulasolutions.com> References: <20190715182856.21688-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=Z3vRidoK; 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 Reviewed-by: Kever Yang --- .../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 171b233f95..cfbb511843 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -97,8 +97,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); +}