From patchwork Tue Jul 16 11:56:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11045903 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 EF0EF14DB for ; Tue, 16 Jul 2019 12:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDF631FF2D for ; Tue, 16 Jul 2019 12:00:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1FE126246; Tue, 16 Jul 2019 12:00:41 +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 7FB121FF2D for ; Tue, 16 Jul 2019 12:00:41 +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=g6wmHcPm3QyVV3VLk9tjko3W9R283TNnknQMAXTuvH0=; b=A0knvvG4lgxptm YK1czOMItWnD4xyReAveImjSRMYhn7eFXMp6RQIyfvzm0QCKCNHeTucl1/o1ch9m7CDwt2idH6Lek x1pqeFaKhLhfKtfZ/TJklpeueGpLwYCn4Ba136sdJVTePrputpDlUbGMPlTOKoCePwo3KYCcY+CUP 2d3ZdgVyQjFni/aMf49kbEG+/9FG66unh6K3I04bbOqSn0aaW9z9tVoAThJam/RekvbboQHFTAjCZ rmm8SaJoKSI6JqixsRPOJkV5lC6/mg8FSzgh55beLhTpLwUeaix0bJLo6fLYeGoImvXsRwoFqGI6y okNZHzgexrnDb/fregQQ==; 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 1hnM8L-0006mD-1j; Tue, 16 Jul 2019 12:00:37 +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 1hnM66-0003lr-Nz for linux-rockchip@lists.infradead.org; Tue, 16 Jul 2019 11:58:20 +0000 Received: by mail-pg1-x544.google.com with SMTP id i18so9328814pgl.11 for ; Tue, 16 Jul 2019 04:58:18 -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=TFvI0S4CfWwHtbl2JqDL7FjN6lCMyy3zZu+VBPL6t3Y=; b=ePYDBvjiUwdhw54nJgRhT7e6DnxLVilS+45XIES7Prg3nAES7E0QoR1RKR9N6V2WgQ NTU71Ak+6TSAal06NPFZ7Fq9Ds+gl7RVd+fTpc3G/lzRzDv125+2m7M50qKclg4SXK8r LcplY8UsUnzwUVhgUxCbmjCnfKA+5z8W1n4yw= 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=TFvI0S4CfWwHtbl2JqDL7FjN6lCMyy3zZu+VBPL6t3Y=; b=XJZS5NNjJ/HCt7qTKffsdffGNZca5nd8ojjH5cGqxnlc0EP+zS7wtN4hRyCAN1XiNr l1HUAut/VL69wfu/81TnFfIzbmSd/tNY6az6Q/fsRmAuvCkw4iq1PGJ6yP52CgMXL66m jFTRi9qWBW0Ip7gDtYVszJvXeC7+IKD/NIzaeZ/uzpkv56fPYTzZmGNDpNqf9HCFCSnF KHP1DgSmdWGWvtZ5jGS+hou4j0k0j6A8NCzysqWimoGKd08NFKqXtp8ScY1qNx6eOUcb nLpJENbsjKLoHHVBwJl4vkp+BKdi3mXp/QKwaGYpYCRLUi5wqbDVQIRLgPVawKLxs1P7 36hQ== X-Gm-Message-State: APjAAAWIkojePvLiLaq9JSNaV6mmH298j1W/MvGMwkLWJWYLicI8w07D +W6HJV2Q/KvXEtoBSmi8qVoIRA== X-Google-Smtp-Source: APXvYqw2e2O59vfqh9aTdlPpV95ZypY60/hGVwr3jTjmEDdTqvMwOVCgo+d5rskd+YkFTRUz3LPsrA== X-Received: by 2002:a63:7a06:: with SMTP id v6mr33364967pgc.115.1563278298200; Tue, 16 Jul 2019 04:58:18 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:17 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Subject: [PATCH v3 06/57] ram: rk3399: Add column enc macro Date: Tue, 16 Jul 2019 17:26:54 +0530 Message-Id: <20190716115745.12585-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190716115745.12585-1-jagan@amarulasolutions.com> References: <20190716115745.12585-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190716_045819_059637_75C41C32 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. 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, gajjar04akash@gmail.com, linux-amarula@amarulasolutions.com, Jagan Teki , Manivannan Sadhasivam 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 column. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 1 + drivers/ram/rockchip/sdram_rk3399.c | 3 +-- 2 files changed, 2 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 db9e30126f..e7f15a7cf9 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -83,6 +83,7 @@ struct sdram_base_params { SYS_REG_RANK_SHIFT(ch)) #define SYS_REG_COL_SHIFT(ch) (9 + (ch) * 16) #define SYS_REG_COL_MASK 3 +#define SYS_REG_ENC_COL(n, ch) (((n) - 9) << SYS_REG_COL_SHIFT(ch)) #define SYS_REG_BK_SHIFT(ch) (8 + (ch) * 16) #define SYS_REG_BK_MASK 1 #define SYS_REG_CS0_ROW_SHIFT(ch) (6 + (ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index c2390a771c..f6a83f2acf 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1092,8 +1092,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= SYS_REG_ENC_ROW_3_4(info->cap_info.row_3_4, channel); sys_reg |= SYS_REG_ENC_CHINFO(channel); sys_reg |= SYS_REG_ENC_RANK(info->cap_info.rank, channel); - sys_reg |= (info->cap_info.col - 9) << - SYS_REG_COL_SHIFT(channel); + sys_reg |= SYS_REG_ENC_COL(info->cap_info.col, channel); sys_reg |= info->cap_info.bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(channel); sys_reg |= (info->cap_info.cs0_row - 13) <<