From patchwork Tue Jul 16 11:56:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 757 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3BDED3F08F for ; Tue, 16 Jul 2019 13:58:27 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id o19sf12465398pgl.14 for ; Tue, 16 Jul 2019 04:58:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278306; cv=pass; d=google.com; s=arc-20160816; b=jW1vWLjuVqOz5kwx8rZqQx9flSPIRfeafldEq2vj0D5EmJ+aPKkZ/gQFIPnBmQk6MX uBQCtdciHKmT6mN759MHZhFJ+QoTthcrni3pYGk8bgB38QSRftcNIPiJUKCcyG1+8wUG eu36e9kjLhb9baKd8qrq3kzoSuLOAVRAR2bmZ+pHZnC8VeOcnrKxzp2+x+izIpunpL0A 3QqMIzV1iYJXamvN8q6/p9ZUJpD89vm4rzdzvSmMRxst9RybS8rYev8jdx3HoFHtZYh4 6D3M1M0wgkfz6M1rWXFwk29EmT5FZsqf1g2xGtlIE84W2/W8COEJ5p7lg1qfICfM15sp MBhw== 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=ohQEaA1qLYx/BDAwx14sGS59VkUtK55xaZopfDHDT0k=; b=IhLfwl0i/jpA+ywC6U/j1q89czbOXvnyoeR3JDZL+0S0LKiwSuQabF+lUcPUyPKz7H GjnTDiB1qvRebeIQj0P9Dyx7UVwiAD0W/E9Hkjy1w88SFfPy7XXqn1IE6f9kVJuUwwbD tjI71WqlmoXpwWEGviJTLhzAoj8SP6sKB9o51iLVTUYuxmtI/JRZ25Np6xaTgYjHdMaD ns1SIalzIPKPdFhD0Y5OhslZhKWy5AtpoPS3Ly7k00u9fSJgD8TW3ikjavOGXQqhaeSd 5AvOlQLSqQbDiFTM8/Siwq4F360GmXRke5x1OvhqTMK3KD/08/uF2DEqFcfFAQnC79JM yP6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Cd3cJPq3; 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=ohQEaA1qLYx/BDAwx14sGS59VkUtK55xaZopfDHDT0k=; b=P5IPpagh934oNliooTgr5vvD+Us2WRgat/P2N3PKGHJ6xCC5EaKgtKZaFKv17AwfoM GRfYma0bJmxgDl+kEPij8LLEWprNtBV7Xr/CWZUtfAYEnRvNsuLcdNhEDAg+osR4bNS+ VOpHUsu42U2FyepNb9O/BtFIgBF6R6ObF6XiE= 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=ohQEaA1qLYx/BDAwx14sGS59VkUtK55xaZopfDHDT0k=; b=TaWqxEGn7xyY+OCpjZJqttrPx8SFAjl4NG29DC46rN7aieMX6PbqKQ/mmPmU/gpq9u OJ5dVFveB8EjXgF9Fm/ODZp1x9Z2mKJ8/vjUNtCn6FCDBoyzNd2YOOfvi5A6PL9Aupbv /MOL2XEohrrutjfOgMzkECnAWhpAgWe0z25YCQPt5xBf7reOHPCxedaGFvj1k8/UAuSl d5i/A6aPnNpXqUMlzByo4Roi4rCIBJWs2tojalQDQBkVPPB8yjjDlNAqi3F6gDXbYeWG DiV4UYKxFXmsK6f8KX324koI001nlhItVfSJe9FA8h8Mz852lvif1pUbdvds/gE2ZUk8 A71w== X-Gm-Message-State: APjAAAWUW3JTOx12EGEmJCW7U4+ABzWpwqJLqICTKERcdZWL0V/X0ksU k/ZP5U9Yv3iswrdn3WFowrlIi0rI X-Google-Smtp-Source: APXvYqynT8P/QcIOFdbj1ISKxuQOdIIdwpIzxshyNFZItsMwzyaUwPd0g9qxxqdrbkwPZ0PZiY1CrA== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr35782774pjd.72.1563278306078; Tue, 16 Jul 2019 04:58:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:a70f:: with SMTP id w15ls5461692plq.7.gmail; Tue, 16 Jul 2019 04:58:25 -0700 (PDT) X-Received: by 2002:a17:902:b206:: with SMTP id t6mr35316782plr.195.1563278305725; Tue, 16 Jul 2019 04:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278305; cv=none; d=google.com; s=arc-20160816; b=yx0Ghh0ic6VzCQpFhVYJ977kBwujedFavgHp583ZgZzH60JCZSBRh2Sa2YveLwZiTY 4XMxhPVv8StV4LJfPLb3ET6NI3wF13bpUOJgOGmOtb57f7HZnXenGd0MkYI/NyPMpFi/ pnt8Tic7ce/UkDntw5yl9QUNgHvctAZAc0Ni3XD1UHcLJVqbn38gPcK9syNlOExZ5IZM lbaFJTWCM15rEBoxNzzTW0dCHRP+4/+eks3qvOlTkcAmT/YoYefmIRqdKpkf6Oydv8q0 e4pS8tAiSPXYcSZGPKZ2KOnlZ+3m1zHaQxFFl2860MpMTUgwSe+BZPQ5q8fd4HGwgLRP vkNQ== 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=Pz3uWBLaKvlci/tn17NEquWR/zeQoVQMRytHfnj7YZ8=; b=iAf6eKmXIMDWSChkgfBWsJ3s6am2wsuhZTfFTFDF+DaPgYF2r+tPvvx6Y1Yr2vFBsS 1DuSzTeFbX5DXyeug7TdkGHP0cIU/m73AAO0ayZWeLMsubDvKol/qDOO6stCo/Vc/QDx 06478iiumOfwxvqxGwJ/SX7FS1wOGMapzteZFOsNCjUoIRaSZEBL2qCEWiVcsqLBhqll Ouw4X7ZaMZrMBfKr1LGJ2L1Q4zqZVyCb2dYVWhwCjJY3AYmlB5MFVT2xVb1EUCsrRcoD SQZBELcJ8moSQTCCafb3d4YCLhyn3AQUZ9D31ZQcCs0Zy0QsOpMo/fGf1HEjMS+CtkXT QHdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Cd3cJPq3; 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 196sor10343516pgg.26.2019.07.16.04.58.25 for (Google Transport Security); Tue, 16 Jul 2019 04:58:25 -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:a63:7d49:: with SMTP id m9mr21862723pgn.161.1563278305321; Tue, 16 Jul 2019 04:58:25 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:24 -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 08/57] ram: rk3399: Add dbw enc macro Date: Tue, 16 Jul 2019 17:26:56 +0530 Message-Id: <20190716115745.12585-9-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=Cd3cJPq3; 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 dbw. 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 71062e3e71..338f4043e1 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -96,6 +96,7 @@ struct sdram_base_params { #define SYS_REG_BW_MASK 3 #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)) /* Get sdram size decode from reg */ size_t rockchip_sdram_size(phys_addr_t reg); diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index b93a6c6c44..b994134fdb 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1100,8 +1100,7 @@ static void dram_all_config(struct dram_info *dram, SYS_REG_CS1_ROW_SHIFT(channel); sys_reg |= (2 >> info->cap_info.bw) << SYS_REG_BW_SHIFT(channel); - sys_reg |= (2 >> info->cap_info.dbw) << - SYS_REG_DBW_SHIFT(channel); + sys_reg |= SYS_REG_ENC_DBW(info->cap_info.dbw, channel); ddr_msch_regs = dram->chan[channel].msch; noc_timing = ¶ms->ch[channel].noc_timings;