From patchwork Tue Jul 16 11:57:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 764 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A1F8B3F08F for ; Tue, 16 Jul 2019 13:58:51 +0200 (CEST) Received: by mail-pl1-f197.google.com with SMTP id e95sf10060658plb.9 for ; Tue, 16 Jul 2019 04:58:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278330; cv=pass; d=google.com; s=arc-20160816; b=hKYt+iCYLYq4E5txcsuazhy/2C6aX/NpZSjk7x819EiFoSHXPT6WmDqLZXLq3DlvR7 0L3ai6swybt97eUXY567A3LPV1m1NmDrKOjD1PkNt6yvc38SYTbBuAgPwotpVokl1b+b ma0NFEdF/MCR5NgZoc1wD+vG8h24KaHO26OAgQxf6VWH0+jl71EdO73REACE4NnlxjPw dfekz7XTWYre4YnFDeFoE9sFaPcztARLosI41RG8pGmb9wwsMjoVbLNC8Ms6+BPnBUFB ymYuTi2+deg2VsVhc3S3RPwOg/Had3pi9J/HoZoPWB6HfOXKiXwxP/fExLN9J4xb8ou3 te0g== 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=W+vRQdUFVKGlgC9yqkMeiwVC/tTAw+69c8lPlrR//kU=; b=LjjE8DwWyNVwegKI4MPor7SyzQObntAPRYfLPVoLYCC+rBl13ej9nUKUkTAFxHzMPd 3RsiNfTtM/Ncb4FwhRlx1bxpUh6feXDWpC3KoncV3AStxJT2XJSAV1WgHdYbQf01OCCS LNx4H4wPntDKlGf0I5zKYJ8qC6UkYYovPNBfFz2RMTguIiyP80RvwQIDBstZ/nTsv80H zIivl8A48feOl/3/EXKIHfY7iVn2GTEjMP/TdV1XwxSaD9G7D1AN9ut00Bb5Neeudit7 eV2LJixM+wWHPGnrS/qZCIWMvxUjB85WhKShrAf48ykp+QRNoKJ45rnl0BTOr6KKrlJt jLsQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Hr02iutH; 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=W+vRQdUFVKGlgC9yqkMeiwVC/tTAw+69c8lPlrR//kU=; b=gAPllDl/weG8/E96fXQifxxJ1C7hr1LhMKd8mHzHQILDEUI0mj954EB2XVp3JuxbyK a4UjByTkPXXsE41wBo21B7exHr1yHfWtM2BSNe35nNNHTa7WTCWCOqPNp7pHo5jMEPB0 lh/WUCqJfNslKzeqcETwMWKNx2JsNllPAtCaw= 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=W+vRQdUFVKGlgC9yqkMeiwVC/tTAw+69c8lPlrR//kU=; b=Jmt309f0zEvYsPgC9U8kcwxAV+m1j8LcROHM/rxmOLXpzrOBqrUdxo96xJTDbu5xxO hy+grhoNOcC8mvQcDNEF2Y3FK4lv0UPxI+yI5XN8+bRSqznSbROieORIbG2xaNoDhb3M +LofihkAgkCgLohKkmCl/w17gY7rYcHXJp14eUXMMo4n/64/LFt0HV6WgBdXFPe/cSPe 7jkVmnR0TKjhTSAYuCxiUXwF98wBVidpbz2d444syECM+5Np8t6igPKC8NeRuWDDQW6o YQ7naynFGmfuKGLJKjDoB+BtKEK0oMav4DEOdwOTOaLAR/eOMbGH6G6mlvMnw+W+6ulk y4QQ== X-Gm-Message-State: APjAAAXq8PpzsTkIsK/F2rkG2AZUGq1xfmmmEwylimUWMRepjgGYH37+ zeB+hDEvOsALJ0dFxeTXkoEq4LBw X-Google-Smtp-Source: APXvYqylOa8Du4pZwKS7RjIrr6rMwcO3nHgzPu6cMvvVOltqh/7Dz1kcGIBenz8jiTr0AMDKSuq74w== X-Received: by 2002:a65:6709:: with SMTP id u9mr5028644pgf.58.1563278330442; Tue, 16 Jul 2019 04:58:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:680d:: with SMTP id h13ls3343842plk.13.gmail; Tue, 16 Jul 2019 04:58:50 -0700 (PDT) X-Received: by 2002:a17:902:8203:: with SMTP id x3mr35092692pln.304.1563278330102; Tue, 16 Jul 2019 04:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278330; cv=none; d=google.com; s=arc-20160816; b=rxMVkYe+75MD2mWefSdp2OC+jYxMkECHNuZlxwgLMlMk6WbszxXXiWN8gh8sgupz2w YajjPtcuxE7lGambuIdAcaNj+bk9HlLjxnN8FzakzhiouvMil9MfAl6f8jQXnMXaCrdX tkRCIOwpw5ziCJYx1D2xR8vSIo/YvZCD+lX9Hic9jGBcgjpCtQ4B0sb42LV/syoikg1C rR0u8RBZZgzJ99YaMl0g9WC4KeVOuonFnYs0xzNokqITSlkVkx4ipn30GhnVDLBXTaD2 /hRpY5e/It9ncOZvUDsP+GrSr5tum5CxUTFSUrzN1k33cuJWyahttbFJ5H7I61fCYnW9 Sc/Q== 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=JD+bh41d7NawJXyb/7y4jJU2UarR0jnLwzqs/x1xT2o=; b=FLYlovv3Kiwl0Y+l1/qeenb1ShzKWUF0LBCRm4f9W4x3spxrC5ScdtF1ku5Ioyn/9i zhuYfqklSGdAAT9sXC+OI0Zy4lehKF0Li01y4UW1bnP5WZdMX1jvsC5pcG96RwsrwMoM ej696zpwRyeEQaWIdTRanvN0xMEmGsZDc95fXNARfES1omvsTlIxXRRNKJ6+d7OgC/NZ vdutL0Nh/6zO1oMAMCRWxfuhniy3j9YSnWCNqdw5r79/blXSMTzDyhPJbWyflT6m+BDa IrWMqf9FsFFRDXxWCwbPYs6tqsyM6URTvxykYo95VwYPsWLaO3OXc1s+Jua+Yf6DtkMR +6pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Hr02iutH; 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 c4sor24648093plo.34.2019.07.16.04.58.50 for (Google Transport Security); Tue, 16 Jul 2019 04:58:50 -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:29c3:: with SMTP id h61mr34394554plb.37.1563278329823; Tue, 16 Jul 2019 04:58:49 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:49 -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 15/57] ram: rk3399: Add cs1_col enc macro Date: Tue, 16 Jul 2019 17:27:03 +0530 Message-Id: <20190716115745.12585-16-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=Hr02iutH; 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 dram config macro for handling cs1 column. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 3 +++ drivers/ram/rockchip/sdram_rk3399.c | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 9cd9f3b969..f5c99fea8b 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -113,6 +113,9 @@ struct sdram_base_params { (4 + 2 * (ch)); \ } while (0) +#define SYS_REG_CS1_COL_SHIFT(ch) (0 + 2 * (ch)) +#define SYS_REG_ENC_CS1_COL(n, ch) (((n) - 9) << SYS_REG_CS1_COL_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 1222da39c2..0f28163d6e 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1101,6 +1101,7 @@ static void dram_all_config(struct dram_info *dram, if (info->cap_info.cs1_row) SYS_REG_ENC_CS1_ROW(info->cap_info.cs1_row, sys_reg2, sys_reg3, channel); + sys_reg3 |= SYS_REG_ENC_CS1_COL(info->cap_info.col, channel); ddr_msch_regs = dram->chan[channel].msch; noc_timing = ¶ms->ch[channel].noc_timings;