From patchwork Tue Jul 16 11:56:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 760 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id BB4723F08F for ; Tue, 16 Jul 2019 13:58:37 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id s22sf10073145plp.5 for ; Tue, 16 Jul 2019 04:58:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278316; cv=pass; d=google.com; s=arc-20160816; b=AqrkHznS9IU/0j6mnMFvkcrIe1VHyv3VSPjL/VWAzskYdKN4EqEY4+XQAgbb8ZrsfY iMPQVFT2owCqNwmqle4Sga5N9/RpNnknIQwHbbQGoacGy0GVR7KtlQr8/FaGus3EJBZa XmAhrV1O0lLtcNFwXAURGXVrhbnBnoHn4Dkx16kUZrPXk1zXmWdg3xB0YTe90nB2SK0C mYwdy6VBek+4NaXrtT2s4xyCjup5cSvKaFhDVnev66Wl4HsltdgOlD8wUytC0FHVUJoJ 6tCshjqis/zDVsg87ufpSH9CBK0dUcJvM41PIPsf6GuuDDlIbnFRj+s+FtZExy3x5bRV KM2w== 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=nOgI2VyzvYGZh3L+P9WZW4FcHrvYSqKGB2qbLzXG3oc=; b=IzqiAnSEWZnmM83ICIoWpCzji8AUqYDnGsH6v7lwvdNhejZSmmPr3n17ABXx9tXAP2 5fz3WT9EmgQdxC9InnuhajwqubSzUB5Defp5bDrOCnlmc5A52+1Zqmakx23uOUmyhyWI X7XFa28GNH4uIDrI2tk8bNAnUonkESE/JjKO2LgZJa9OqtGfJIChf6E//w7X1bsvSxUY ZzFzQPx5Eb2ecHISDglKz6TTFR0kn6VuVmhdP0hoMiNtMLLYEW5FHLT+/iV5yWHOBNVC K9t3GO+lmiztTV8QS4FLZoNWtEQfBEH32KTvfwoX6+MZEHdpOFlz4dud6AAw7KbQwRB/ QENQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q225OtBk; 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=nOgI2VyzvYGZh3L+P9WZW4FcHrvYSqKGB2qbLzXG3oc=; b=FdP62CdD4LhHEFi2Kpfi/u/9SvTLGwWJFHZIwnXeOZc4x0BVH+SOYuqFNFd45Z8axq DmgvdGe3H9+04Dt7uNO4tZwc/UWGMS+Ehv3y08J4yz7KHy1SCkrWcgwrZVv/4CHPg6MT IEh/+jWXxNgZEvOcjbKYdXlAa28Wc2D+PDDTw= 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=nOgI2VyzvYGZh3L+P9WZW4FcHrvYSqKGB2qbLzXG3oc=; b=EN9Sndm9l2i89LR8CSxcMUNc55m1yDA3LRcfXGkMeGHGCGmavdwCteBrJ2Tymf1U4y plCu021yO+YAw7C9s93CBQ8ADmSpHr4Co9YnUFtAs1YdLwFwZrmdExkAtkYacWL78p6M 8AdMkAg5flS2Kgei8eoS2UkTCqxQfNjzglSnHTDClBGfivJDWKN8naiwN5Xz9GJy2H85 2c6ygcF7l6/Cuin0VmSisKZGY7Omh+BalMnPl2CcwQsEoMnJKD2JDabKEAg/rtxyYbAR fCbjU683A0ZFW/Vnwtsqq/Z5t9cfWFdswIrZcy5/UHvan7zn7Nn5TEZsGgU5Tak+RDGC XeFA== X-Gm-Message-State: APjAAAV5YIbLsRKTn2B6IxkOMVaYs1BswfFl1hK6v/YzRNAeRnGKA9Dh CdhRfkH1CAOKPZeLRVKaX1KlK/LB X-Google-Smtp-Source: APXvYqwHcNNTp3AgYAwd+WlHsWzcwcTG2HvMqdDWhKXb7u1QUdn6EjNhOlmQ4kW35ZzOgSRA4G8b+A== X-Received: by 2002:a17:90a:8591:: with SMTP id m17mr36317465pjn.100.1563278316584; Tue, 16 Jul 2019 04:58:36 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:1c24:: with SMTP id c36ls3432007pgc.14.gmail; Tue, 16 Jul 2019 04:58:36 -0700 (PDT) X-Received: by 2002:a63:6d6:: with SMTP id 205mr33897143pgg.262.1563278316178; Tue, 16 Jul 2019 04:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278316; cv=none; d=google.com; s=arc-20160816; b=1ItIg2k85NRaelZdpAnU9mVL3gZve9tiJuF8MJEa9uiVam9y7IEqiuEtVg7h1xUuYR 9v9xgIRLzB8iW2J3xF9n9lUFydgfpjCgpQ65qy5zKEMhyKV+eGyMeX/x20PvDoJxLFsE aBfrsdmVCl3nQP9LUs2nqFadEa2XQ2lpP3mhdiQwr0farj/tXqRacTOy+Z3X9IUO3C3w OA5hPc9+wIEk1hfk9cVStjQGETN5uYuMKlEd87PvWXE1V7ryk0WZ9q4+dHOWm4i/jamH twsY9fAKkLZUpxj6rdYplfOb4+O92pcVup3gvb7kVDcXBXr6fSBjZG/v+HCy6vp8nCjj 9mKQ== 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=zH+syothlLNOq/YNX9qJOZLAz+UszqSo5fMmy7xQGuI=; b=S1I1FUJu6Pkn3Ahg7YSOnOqvw6DxS3fEw58QJ3Z+so3C4eRXe9Q6UpQFK71BbhNjFQ uFo6rtAAnCCRLM0o5p+n5QmMCWgbRAk9mPocmu/4liIhgGL1vWphXsBnrM0/GqZqPZVn /GTVWD3l150gbMQ/IQ9+lKvuLieuYg9EyJixtr3A96PK0kFX0PCerhSmvnnljS0WV2s7 5Ny8iTDpo8sko8XB1pl4m/qRfXu/hz4kQJdHON3ZYqtGDTt9D8BjFLKA8A1yyvYsYUfW +4KPXuD9utIyt4ZItQ8gFbvbsyGO8aefzRruP5R6ej1qkja046KxvprVNT7TGeW4/Jbo a0ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q225OtBk; 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 73sor24452294plf.60.2019.07.16.04.58.36 for (Google Transport Security); Tue, 16 Jul 2019 04:58:36 -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:846:: with SMTP id 64mr34836019plk.265.1563278315917; Tue, 16 Jul 2019 04:58:35 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:35 -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/57] ram: rk3399: Add bw enc macro Date: Tue, 16 Jul 2019 17:26:59 +0530 Message-Id: <20190716115745.12585-12-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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Q225OtBk; 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 simplified and meaningful macro for bw. 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 578db90241..4749233226 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -98,6 +98,7 @@ struct sdram_base_params { SYS_REG_CS1_ROW_SHIFT(ch)) #define SYS_REG_BW_SHIFT(ch) (2 + (ch) * 16) #define SYS_REG_BW_MASK 3 +#define SYS_REG_ENC_BW(n, ch) ((2 >> (n)) << SYS_REG_BW_SHIFT(ch)) #define SYS_REG_DBW_SHIFT(ch) ((ch) * 16) #define SYS_REG_DBW_MASK 3 #define SYS_REG_ENC_DBW(n, ch) ((2 >> (n)) << SYS_REG_DBW_SHIFT(ch)) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index a83709f271..2d3f0f6902 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1096,8 +1096,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= SYS_REG_ENC_BK(info->cap_info.bk, channel); sys_reg |= SYS_REG_ENC_CS0_ROW(info->cap_info.cs0_row, channel); sys_reg |= SYS_REG_ENC_CS1_ROW(info->cap_info.cs1_row, channel); - sys_reg |= (2 >> info->cap_info.bw) << - SYS_REG_BW_SHIFT(channel); + sys_reg |= SYS_REG_ENC_BW(info->cap_info.bw, channel); sys_reg |= SYS_REG_ENC_DBW(info->cap_info.dbw, channel); ddr_msch_regs = dram->chan[channel].msch;