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: 10987243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EBC9924 for ; Tue, 11 Jun 2019 14:52:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B566288AA for ; Tue, 11 Jun 2019 14:52:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38F83288AD; Tue, 11 Jun 2019 14:52:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DC29F288AC for ; Tue, 11 Jun 2019 14:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ALSIkhr8LiCK1tsiahv/7tSHjhm0V0Ovw/Yh8+cAzHg=; b=h42PWOjy373gk6 vY3MDB54EhBAAU2jcClR/DYwMkT/6xNrez/u3fNj5fDuHQ+w6iHlZX9coGMfIi1q68pgj2JAUJmlR gwgxVNjanu7hcNqZuwwFeBoL4DBFcfDVfsvcbYhNTEpK7DKIVgsVUdC5ePP2bEDjk+FTlcaYp0zup nghVJgZGTWVtm+8XlCIizvy7+wceml9wB9ZjP3kBa9B53x9YyxtH13POhbqWetRtyT5IuOJte7B8v B4kLodURhQDnBVPaBd/XkJlF9BFNIHlcL3WOZsSXjvZrDA9yvYdatPpq7ViyfBi2Jj3A3Nks8AKPJ tRRDQvjDI/txB5b2V9hw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hai8Y-00047g-LC; Tue, 11 Jun 2019 14:52:34 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hai8V-000464-PG for linux-rockchip@lists.infradead.org; Tue, 11 Jun 2019 14:52:33 +0000 Received: by mail-pg1-x544.google.com with SMTP id 83so7104767pgg.8 for ; Tue, 11 Jun 2019 07:52:31 -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=LCJlYP1KCT701kE6yN2IkEQUHhQR+SFhRvM82cxyBhDh/cb7+2B/xAHdyxuArZQlym x789oaJL8RGpZzQdYHMhXi6gVeZMo+WtV6qfiF6+lOZyvsSPC0n5/YsUaokjNDQul8Km BGOd7lLSCSzjFZCBHNNfh7Ia2Sggbk0hKu2nwvmMK/r9uIguF13ul0W/wayzl8RDbeHQ 7OOrhSDtEHDziFsBqM5PnCLd1JktTrs6Bb4GeLASsLfBaypEIa8V0qSf2MK0QBFE6r7E Rddd7nCzHS3H6ByQb44HSAYQE5LhCTDgUmemJxpcsFmAT7m73o1H0djxZhC4sF1Ko+e+ S6Rg== X-Gm-Message-State: APjAAAWksp9smMzjXSrmoBffKLvWKGWJpbsnGJEThz5Bt71bZGqpCpfd BJqs8WEE0PEKY7H1PnkZ2uIT/Q== 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 Subject: [PATCH 10/92] ram: rk3399: Add ddrtype enc macro 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_075231_844372_E50EB5CE X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , gajjar04akash@gmail.com Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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;