From patchwork Tue Jun 11 14:50:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1113930 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="IM/IqXBv"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45NYPJ6xnqz9s4Y for ; Wed, 12 Jun 2019 01:11:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9B9D0C22117; Tue, 11 Jun 2019 14:54:15 +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 F2F94C21E34; Tue, 11 Jun 2019 14:53:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7EA51C21DF9; Tue, 11 Jun 2019 14:52:36 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id A28BFC21DF9 for ; Tue, 11 Jun 2019 14:52:32 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id f21so1096288pgi.3 for ; Tue, 11 Jun 2019 07:52:32 -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=G8BU7jn9Nzu+haHvyO3dpJamq/Bm20SU6tSZMgZffqo=; b=IM/IqXBvbJJWuShya/nB9SCnsZXY7GmXdPd8K8SuFI57OnFUqAk313N0crtFzPR3Nc RHZwFoUK29NZbkR1VkjBN4lj4wpxCcQ1jQ5hrMbkmE0oDOrMJF7mXrHvrbG9ZkOjoePL qR7JHsSWxNoHMaOQKfB8nqnN8Z9dJSVIlDxKs= 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=G8BU7jn9Nzu+haHvyO3dpJamq/Bm20SU6tSZMgZffqo=; b=uQtbl7nfgHEBHHCRpmbvOvatf42m823qheQZWtxBYA+qvLirDK1c2tWES+DgPNjSgL QIXWkj8YJqXZQoaxKuYjdYfn1eBl9OIGyFGxIq2Bz6QNvCXjTUIqer25OBIAcX/meCWp ehwNcp8+4oT7RS+K1NWqx2Ivm5z+7UNZRxiptsXfSmSNlPX8s0kGRCKI5yINNTPZ4Di8 J37y5pIpsx7rNmHEGS303rkVLNldkM3EVRO0SXgecF45KeOQXMCttOo83awDhzDkRuyZ ETZJGWRfUso7fJIaoXXq9FTFxZB2lOHQJ4/Bhi/+KFOetREITcR0tqdk5QJfCYY3Res2 uVcQ== X-Gm-Message-State: APjAAAUaKdqluBfhUHmphA2/R6pnDeDc40RfpolHHXYqLB+/6jSmWcdA UrZ34u2eHYhpCZHMsB6BbUx8qA== X-Google-Smtp-Source: APXvYqzvcmYrEU22Sjx1HpNgnv9AUNp2qlpO7T36ztiPVgmwrglxz2fPDFzGJaa1J2DfVx5luJgUfg== X-Received: by 2002:a63:e304:: with SMTP id f4mr20513657pgh.187.1560264751146; Tue, 11 Jun 2019 07:52:31 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.52.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:52:30 -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:13 +0530 Message-Id: <20190611145135.21399-11-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 10/92] ram: rk3399: Add ddrtype enc 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 ddrtype macro. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 1 + drivers/ram/rockchip/sdram_rk3399.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 671c318d50..83936d3679 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -34,6 +34,7 @@ #define SYS_REG_ROW_3_4_SHIFT(ch) (30 + (ch)) #define SYS_REG_ROW_3_4_MASK 1 #define SYS_REG_CHINFO_SHIFT(ch) (28 + (ch)) +#define SYS_REG_ENC_DDRTYPE(n) ((n) << 13) #define SYS_REG_RANK_SHIFT(ch) (11 + (ch) * 16) #define SYS_REG_RANK_MASK 1 #define SYS_REG_COL_SHIFT(ch) (9 + (ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 1541b34a7d..69c8d53314 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1008,7 +1008,7 @@ static void dram_all_config(struct dram_info *dram, u32 sys_reg = 0; unsigned int channel, idx; - sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT; + sys_reg |= SYS_REG_ENC_DDRTYPE(sdram_params->base.dramtype); sys_reg |= (sdram_params->base.num_channels - 1) << SYS_REG_NUM_CH_SHIFT; for (channel = 0, idx = 0;