From patchwork Tue Jun 11 14:50:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1113922 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="T0WdShfc"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45NYJf0G8Hz9s6w for ; Wed, 12 Jun 2019 01:07:29 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A2CC7C2216A; Tue, 11 Jun 2019 14:55:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7BAD3C21E75; Tue, 11 Jun 2019 14:54:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 82ACBC21CB6; Tue, 11 Jun 2019 14:53:08 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id D6857C220BA for ; Tue, 11 Jun 2019 14:53:04 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id x15so7619198pfq.0 for ; Tue, 11 Jun 2019 07:53:04 -0700 (PDT) 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:content-transfer-encoding; bh=o+DRTYHelsXkRTvkcjv8LykYwXl9zXvDsP/xd3l/rlQ=; b=T0WdShfcdeCfdrMy+h0drhSvOLxVJMCRSRfp6OzLEC829S9k/GsFCeT3r8fO77CJH9 ekSTDEn+T6zHSU9qJa0jeKfOmkmG0lgiC/IL0JyuvOIXHJdwXLhYPSlvNBAJykVUr/rf EK1hnngZ3jFT/zz8Px11kPlJdsp55TF/1C5XA= 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:content-transfer-encoding; bh=o+DRTYHelsXkRTvkcjv8LykYwXl9zXvDsP/xd3l/rlQ=; b=qzxg9OwtMg8zZIEBBwP1ZbfnxdpyYZPLEZ2E0HxvjsAzH/S9MzxneUtZbHadi2luH2 ht9w4sUUnmkniM5nIPiFxxeW146SsXQRLP/6Rw3/qfCeHJdpg2w61R1LHRY+rcp86sXT PNMnmNeqeCzJX26wAMlm9UnHbdn2SnrdAW1s17EfcDyV9C4wfUOZUMt8BhASTggoyduV 8tesg0vKSNHZwV8nDg97gW4kBzPbn3Iz2gfQktg6/Z+CS1Y8pkjHo+AByl4DdepiJVlx BaTgVWiRjznLUdVrCVB3u4aLkcAl4SaK46Kidum7//J8OX6fZGX0psBl9to7+OdHxnSp MP8Q== X-Gm-Message-State: APjAAAUbtbV+474JzM0epCVfrYZs2AwNERCdVv1hPuy9vVwaG5/LwXLD m91ZJB85+P44QEQstgV1b6gLsA== X-Google-Smtp-Source: APXvYqxPvCxUaWZg4iGIbjQyUcV0IO/3hV6AzwcpHGxW5g0zFXcWGhuRWY5ufSu/SlbkiDDPdXGlMg== X-Received: by 2002:a17:90a:338b:: with SMTP id n11mr14237563pjb.21.1560264783437; Tue, 11 Jun 2019 07:53:03 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.52.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:53:03 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Date: Tue, 11 Jun 2019 20:20:21 +0530 Message-Id: <20190611145135.21399-19-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 Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, gajjar04akash@gmail.com Subject: [U-Boot] [PATCH 18/92] ram: rk3399: Add cs0_rw macro X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add simplified and meaningful macro for cs0_rw. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 2 ++ drivers/ram/rockchip/sdram_rk3399.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 3b0557cb6d..5c94dba39e 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -51,6 +51,8 @@ SYS_REG_BK_SHIFT(ch)) #define SYS_REG_CS0_ROW_SHIFT(ch) (6 + (ch) * 16) #define SYS_REG_CS0_ROW_MASK 3 +#define SYS_REG_ENC_CS0_ROW(n, ch) (((n) - 13) << \ + SYS_REG_CS0_ROW_SHIFT(ch)) #define SYS_REG_CS1_ROW_SHIFT(ch) (4 + (ch) * 16) #define SYS_REG_CS1_ROW_MASK 3 #define SYS_REG_BW_SHIFT(ch) (2 + (ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 4047b4b7e3..e3555504b0 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1026,8 +1026,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= SYS_REG_ENC_RANK(info->rank, channel); sys_reg |= SYS_REG_ENC_COL(info->col, channel); sys_reg |= SYS_REG_ENC_BK(info->bk, channel); - sys_reg |= (info->cs0_row - 13) << - SYS_REG_CS0_ROW_SHIFT(channel); + sys_reg |= SYS_REG_ENC_CS0_ROW(info->cs0_row, channel); sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(channel); sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(channel);