From patchwork Tue Jun 11 14:50:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 475 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 238053F08F for ; Tue, 11 Jun 2019 16:53:29 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id i26sf9741403pfo.22 for ; Tue, 11 Jun 2019 07:53:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264808; cv=pass; d=google.com; s=arc-20160816; b=QPc7RlyU1KsjKZdzmRFV1eOkWvxSCI+gWoe9I5GDqxeCoYqiKZadH9UAMdps2FnPSN xepmOJgqTGkLk4fRv+KXm++rj4N30mY91AlqSOFI1h/nu7pd4M9C3r2ZLGfsPYta4dAP /rJRRwrTtufWe3ev5F+Z70KVG3nDifqXJS31ccXZfM85XcB5TXoDA10ZeQfiCMxOHg/H yYSRCyocl48FtDu5VXRAjzwCo7LNNj7bvSvs86UhFKRlWTwtYAiBVhqmQFD5gZjN9MEN 875AQomHX+lWmj6Rx8MizIoqpDGSXgr0LXaxR0EctNvvS391c8h8x5dyF4gBE+DrctvK Ss0Q== 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=VK/QjI9pLNbIzUkrfCXC5ZSwultqttkl4TeJRPiBvaQ=; b=Qtam/s2yNE0ca53dqlsJbLiudJ8WXMJUBtE+NGs6rRWpe2ueuHdq0xu3w18+J55lWB OWheA8H9TdTMArdQt/XE+9LHIV94xra1qV493vltw48EYyhqNsdmB7EFxYBkxqzq9Cyc Wn6Aa8fEAgm9HxpMXZfF15/BVnwQDQ52bvOcMVhtoadNSxVdxTP/7SPtJ6VMiOHHHBsi 6OirylrNrdXIEr02ofiiBQLATTj5LxnZaff1VJwByKfdXE31bWNYvj/kxfmclfjD2sc5 u0kpFSs6l6YfAiLDMyycTYzXbJBXUq44d3HJ1xkvKhC6Q8UNewOakjFA/KGB989yFLaf y/YA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X2zvOdfc; 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=VK/QjI9pLNbIzUkrfCXC5ZSwultqttkl4TeJRPiBvaQ=; b=qURNmMv1J3Cyd62aZ0O7B5laOoV+2kyY8FmPU7M6NEGwXKPgEA2qkivkc2LPSU5I9T f7Gj8levHn3/YMqCgliazlQvZy/A6+hStrCkLYjA4WZ9cQszq3/HMJ2POr8bDIolIwUn 7TR8uzSnFpYOr1gdF2R1Pk0B8v4Vc9XQIIGy8= 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=VK/QjI9pLNbIzUkrfCXC5ZSwultqttkl4TeJRPiBvaQ=; b=Fgyn6LwMPG0a+Vk2P+MN5i7aeQkiTRbLGUmPcONZcW9hDgEK4XZnpGeVXu1BzNrlj4 1qpLnTcgO9JfrLGihxD8IyXtb6BMy0ci3g0Cey2oPkOquHqs75oFDhlwlAw2Mn0APmk6 sHN+11b2MoF7MAyapY5/1m5Lh1YNXz//YGV4r5WgOjGpkTT2a/ByGQwOekSv8sGwTrvC DN02WDGISVj/qjkrkrJqTSBZBOyrua5S2uyrKe6UDTO9TVj25p1eTulEanZt7iiy1ZGr 2g3Woj7DT6+4NdNthq8oFPBKkG5KhZuEhEYMXdNAdISJqD/k7EOnf9JxNWbCsSWdLSUk HXUQ== X-Gm-Message-State: APjAAAVwTFXwPEtI4p7+WWeFELyqvXsERC2uwbxRL6bFU0ZO18HEwM1G krU5IHYtgmtTqAUUz41i0TLplTbt X-Google-Smtp-Source: APXvYqx7+Q8BH1QRPi+8JEX0TTmtL0Rm4Rv2bwSYgXxRhZTW29cxDrF4dqXoDIGNZkC3Dkko3YCDeQ== X-Received: by 2002:a17:90a:d814:: with SMTP id a20mr17363565pjv.48.1560264807898; Tue, 11 Jun 2019 07:53:27 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8a8f:: with SMTP id p15ls4699396plo.2.gmail; Tue, 11 Jun 2019 07:53:27 -0700 (PDT) X-Received: by 2002:a17:90a:3787:: with SMTP id v7mr17805454pjb.33.1560264807514; Tue, 11 Jun 2019 07:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264807; cv=none; d=google.com; s=arc-20160816; b=zVgCEqMcEv8pE41ZdN7tyGw4MIkVvKU4m/AwgR9+0aTxmXKBF5WGSUSbq+r4Kyr7fJ x3kcJ6dBnIjM8Xml3OS6AXWn7ykCZiMB9zOmk58/Kk6ZZBMBNXeIGBwGo2YBfxdK0nk3 utEULmgm+X50bdoPDHCeG4hZD6hgAQopOLl75aZd7AGSUvnOjme0TV/OUYZHDHhVMaQu GclhIRBpltcdhCgheTmGuVXIAjjaXXpKsFOuD2/HXTPpzroKyWvwIGpqvPICjD7emZPz FWIBs5cgFnzCd/G0nYIuQI6tUL43u/2DOZRH8RWELyBVqlVeAGm9QszI+Mp/NyCvz71f gvZg== 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=Ft8W9Se2n2QkLd+lJNW66KUzN7VPeSOR5seoant/xQg=; b=d0Yo+kJbqsKVJm84vUJxjT5ctDyaHIC8iCuTcAKe1ZD+QMOx7MqNYAx8tywdLRtIVJ vzA/tEYRn3yw3v6WN0UAAaOvOvOxaNbVdOu4ZSmKlL6FuVLcXQXd1zCmrXcqlb2ZHHUk PvvMsVbd//pre13khEMInvCUvWUs+BtawoAU0j04ky9z3dhmrlz0R2GuAmH9b/LJQKLJ wslK1YT3yVJa1NVm8z9OmC+6eiu/OLwHIxKsnRVeb3a5vuF1Y64+4zw3/vnKGkKVb944 p9St79/hCKSBDXY1SIou8OJ042o+gOquAvbWai1Ux5f7Kpmc1jYusDyIsvQkaSFyxIZk OBew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=X2zvOdfc; 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 31sor15367218plc.62.2019.06.11.07.53.27 for (Google Transport Security); Tue, 11 Jun 2019 07:53:27 -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:760a:: with SMTP id k10mr56058835pll.83.1560264807139; Tue, 11 Jun 2019 07:53:27 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.53.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:53:26 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 24/92] ram: rk3399: Add cs1_col enc macro Date: Tue, 11 Jun 2019 20:20:27 +0530 Message-Id: <20190611145135.21399-25-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190611145135.21399-1-jagan@amarulasolutions.com> References: <20190611145135.21399-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=X2zvOdfc; 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 --- 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 dc7275656e..637a0de902 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -74,6 +74,9 @@ (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 772fde9732..d77a8310cd 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1033,6 +1033,7 @@ static void dram_all_config(struct dram_info *dram, if (info->cs1_row) SYS_REG_ENC_CS1_ROW(info->cs1_row, sys_reg2, sys_reg3, channel); + sys_reg3 |= SYS_REG_ENC_CS1_COL(info->col, channel); ddr_msch_regs = dram->chan[channel].msch; noc_timing = &sdram_params->ch[channel].noc_timings;