From patchwork Tue Jul 16 11:56:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 759 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5B7A83F08F for ; Tue, 16 Jul 2019 13:58:34 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id m17sf3562754pgh.21 for ; Tue, 16 Jul 2019 04:58:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278313; cv=pass; d=google.com; s=arc-20160816; b=R8klu45v8NoF4gt3P04usmASTwPsmplNRCBKMGG8m0/faLZ1xCmEgJeAEVTW/6fQbz 8/IifuIKSNv7g4LKOS8aS4G1hJvQCMhNO6JVAweZ3uAJ676M682zf5lKw2j/Qee/9sdo OTno+QxFJPaLbGa3k8/vwk42BSy09cKOwP/Kdsufowy9gKuReF8lFdxEwCK25GS3NMEs yBcpDIDDBgQRPvYxBrsBMY3FqUa0mEw8Qjj4kkPy/6rA3DBtbz/DZsM6ZAoqVneqIL5j vRBB6z87yC3fVeMzdoRB+CGuCv8oqr6G0OAVlkCFXIjqUH2QwJbyOA4onaAhIhK5r+T6 Nd8g== 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=MHTvnEVNyIcJQJwTg2KneMepAv/pcjfCI4L7ZJPlsZk=; b=oakx+GacqEY/3m4H1emqwtJL4UJ45kXHTidvLq4YDUhyDgK5f8UfWUPdywBL2/ao3M ETzOONF02sWZDUPbt5zdwR6KqT5yNbBUHyE11bDFHrvacLn9huf7k6rCNqLDsG82Gw2m FB/Q4FPpn3ERB0AHju5CF9X67LF8gjevQgFJ3UBQOcIXduQVdTQKDkPlEJdTxzPVAP/p hcbRZk7Nro5vuiMB4ZZ+F6DWdTlWXP8Ppm+VlO3GCxpO5Z0eEThHke6nlxq9npA8H0YP O2XSxASO9FOepeUplYDFsWUd0Vu7amPL4s86he3sXl7tkCkUd3mbeaJ+IJffUEYL1Lal nZyQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iVDPnhBP; 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=MHTvnEVNyIcJQJwTg2KneMepAv/pcjfCI4L7ZJPlsZk=; b=GdxNviTEiAgxzvwEeBMDE6STzohnY4mJOitj0hM0FguGczZxTriGdXOKQwXn359x+g aSjHScXDyPrUM70LcAvdXPcy5ZAzuAR2gV8F2ul41IPDPREutlXZ9Qa1IuAEZzMmg8w3 /h3CIdA+koKwk7ZEHhFa7k5TkzC96WfSD6ZBg= 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=MHTvnEVNyIcJQJwTg2KneMepAv/pcjfCI4L7ZJPlsZk=; b=hkDbPabL7urXhCt/oaDyv8JtSdQrCcGV5swyVrO3oCrHU2IWiYPR01vvx2XEYqMsu9 dhUvO3f84Bq6S8qKb9RuvobeunFmE3wsPP5BizmjRTOdCEI+BtRFInzrk5UCTWltsGh7 LK5Nk3dQfPfB6V2+Px8/kIUSyMggFsDN4BBTzRrvW5tH4qV9grW1D5Kc2H31JvY6Csxa Te2wfUtTQ3nveZuvY35miFG0/G6LoRkHYYB6hMBsuFg1jM/DUo2Rull9GArwANB1MK+E 0t8T7oD10xiArNp8PJOAdnbYWVrT2cYSgktjOvmdVczmyzecRchBkcXzmOuA3AwX7lcV Qd5g== X-Gm-Message-State: APjAAAVmqvqjqvu+iPWiLcJZZTsnopPftsbEkBUPQJkEWbwO37Ef0/qR MdK1Zo69TdwmyGVEzO//bM2G5UVx X-Google-Smtp-Source: APXvYqxjqJ70yhhdpkGaBcHWtX4tswVs/vcsL7872HlBAn5YFnjX2WUiCaDzO7/nyKPjU32EtsXmxw== X-Received: by 2002:a17:90a:360b:: with SMTP id s11mr35298322pjb.51.1563278313120; Tue, 16 Jul 2019 04:58:33 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:d705:: with SMTP id w5ls5469120ply.12.gmail; Tue, 16 Jul 2019 04:58:32 -0700 (PDT) X-Received: by 2002:a17:902:20b:: with SMTP id 11mr35240893plc.78.1563278312747; Tue, 16 Jul 2019 04:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278312; cv=none; d=google.com; s=arc-20160816; b=vQ8rfoJ89hGc0BoyrtMhdKtVwg4gATKCtA+lc+vogt6VvM/YtPpCMthPmK0Z7+AiDZ kUshMHsbPPZ/PIAQTTe1Wrqmlo95zeEDeQfBXMhLevgtabqRO4i0jXi10SfR6tLM3/T5 AXqXjO7E1vOcAaQ7x6ZbaR3OQ9+o0mNRX57OVl2ESWB7GBhz7pRj2XQ+GzQKT3TP578t vtqJStBTHBRb7fZq+t62SZfNZdM73PCaYMA5I7mS+Igoq8Mp3MzbSHVxVSFE9ckh9vvE zo/tg71e8Iq2xHp2LszSnss31so4DR7g5aidXeRtApX3fcCgfTc6dsJtgDL3O/Qeca6T XqEg== 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=yORN6ilDAH50AgvnfaFSdINdGaiaAQ4jirdj9cxDI8I=; b=yb4HREO78RT8tQ3IZChmk8ZI+84gqajOCmpi35V09cEzoSl9IBb0h38bCV+eDy9zHK ANyHf0+PkNqC4nINkPF8vAkQT7JWVUu0AVz1wBA9qpzh0EXLGg5iBpRzRv6arluYd9PP nsD6V/X8p3MPK2xkkwwkfmWP2aJ+EPkAY8o4U3CAjnrxvwXQ/ehtrvaKJ76Ht87jRyWs v4C3EEKTzYPBbts/MZZWull+wIaNycB6vTaJqit3sMeMOU+opNrdRVdUiNUfDTtk6Wc/ SvDj04nmveTFxGvkIQ0E1A8ST3RSsfdGXXN0Wg8n+4Hs6xOSYRtyTdt138AZkb9Y4EiS Vvtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iVDPnhBP; 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 z23sor10674730pfn.3.2019.07.16.04.58.32 for (Google Transport Security); Tue, 16 Jul 2019 04:58:32 -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:3ec7:: with SMTP id l190mr34218273pga.334.1563278312405; Tue, 16 Jul 2019 04:58:32 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:32 -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 10/57] ram: rk3399: Add cs1_rw macro Date: Tue, 16 Jul 2019 17:26:58 +0530 Message-Id: <20190716115745.12585-11-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=iVDPnhBP; 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 cs1_rw. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 2 ++ drivers/ram/rockchip/sdram_rk3399.c | 3 +-- 2 files changed, 3 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 ad9726a57c..578db90241 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -94,6 +94,8 @@ struct sdram_base_params { SYS_REG_CS0_ROW_SHIFT(ch)) #define SYS_REG_CS1_ROW_SHIFT(ch) (4 + (ch) * 16) #define SYS_REG_CS1_ROW_MASK 3 +#define SYS_REG_ENC_CS1_ROW(n, ch) (((n) - 13) << \ + SYS_REG_CS1_ROW_SHIFT(ch)) #define SYS_REG_BW_SHIFT(ch) (2 + (ch) * 16) #define SYS_REG_BW_MASK 3 #define SYS_REG_DBW_SHIFT(ch) ((ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 43cf597828..a83709f271 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1095,8 +1095,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= SYS_REG_ENC_COL(info->cap_info.col, channel); 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 |= (info->cap_info.cs1_row - 13) << - SYS_REG_CS1_ROW_SHIFT(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_DBW(info->cap_info.dbw, channel);