From patchwork Mon Jun 17 07:31:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 595 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 1B8623F353 for ; Mon, 17 Jun 2019 09:37:43 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id w31sf7178854pgk.23 for ; Mon, 17 Jun 2019 00:37:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757062; cv=pass; d=google.com; s=arc-20160816; b=oKus2DVehegcJoQ+u9w3BmqMmAmrepsDloDSSoJOSRtEwBcpdE7667EWxN6zS4fPx0 Rg5S7H/OwiolToqizVr8ONv23rDZhgukuA+/MGLGlcdiTIdmMcc0RqfukRcb9yVzduMW IwmJAEnXhjLvetyYOCAA0ZdEmuEJBUGyWE2KG0znEg+eVyHAXkACQ/6fWrnHztCeoxgb j37ZIgwfNk/T/uB5DI9sdQl63YKnikgK9vBBb1xKvU9IpVkeMZyLwUFNuUZSiyaDyFQS //ac/L1nQfF2Sy93boNys84BIf0fmXkhrbZJaBgtk7Wkp+UWLM85j3nPb2FPacvwTBS/ hsXQ== 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=jjIIiXOfxJnp9Bh5fN81dyuGBpKpMAL2hU99pvV5Ylo=; b=CMXxwJooJhVTsnAiIheKtGDF/gjYu14vOBI8GGwAOecCZxSN2P7TOtNbcfKsRXiDWO 1z2QKRHnbwKL7vqeY3kyjYFJlOshHXBdcXqdil227kE0ucyqchnWL9grg9rcfZXwyFbR jesk1oFAasIM00F7Y95yYbupjMeQJvIyJXwH68qQCSIBEYu540QGTclLyPJAasN3L8Ve e+2FZQcS5m8j/yn2ms2TIzXT5EzsOCQbg+ro4iI77NlBAY2zm3j61zzEGd2TwrOqZMKa cRqgU+UXviD8wnOLWShtwVp/USFxzh9o62drJG1Q9RLNdIZIimOLsa9tOw1cnlJK5AQb CplQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=f4esqCLQ; 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=jjIIiXOfxJnp9Bh5fN81dyuGBpKpMAL2hU99pvV5Ylo=; b=J6WOd1h1eUQNdhNND6sNVR7Hw7HMpxpOkhfKFVYC1ZIKznyVtGLPiipZZDa+xs5DBu zb+5u7PK05t+4l0usC2WW0uX0VJqLqUE9lqyYAobEY+qoE5tbrSESvYNQ7e2tXqPcMtv u5y1D0yTUJALL/sNTekS+sBVzl3bdtnzpUVGc= 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=jjIIiXOfxJnp9Bh5fN81dyuGBpKpMAL2hU99pvV5Ylo=; b=KQkzTjgXHryR4Ui4Te8nAzESo7SzsG+o3bkRWprdtcILh5Zur+hzSgfnfu6jHeqPjF FoVANRkXGXYTsV/vEnpzCAW622vLgITcijvOq80f6fW046ECHUZBdtcsT8WPz7JgR6Da 5jjXjyjeaHy0qGP0hJLioV7qIogWQDVBBuiToOPKIweEVu5IqMKdGMchmRWnflIeka08 En04OUZminmlib3Xh+MSGmprstRdVaxGoPQ10sYEP5xNoBdfME1tBQ4Q05Htuk0ae+vH 331YZfI+BAwBKQYER3S0AfFOdzCbuc4jI5XXhj0o4EDONj2KTZax2C+/++GfSvwWgdSy TfMg== X-Gm-Message-State: APjAAAWXzoJEHjhipWoqtnCnkQPQkQqm2UZrmY+xI6POTXYDMr/SI22h tozMYGk4h2F99e7ubKi2OMlFFXVg X-Google-Smtp-Source: APXvYqwAUpEz7ehG5DEUhWbErESvT5xSC9MHinijb7qUR7YLoLEfMDNenaqPCNrhLgnA64hNzu52/g== X-Received: by 2002:a63:9548:: with SMTP id t8mr47687048pgn.256.1560757061866; Mon, 17 Jun 2019 00:37:41 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:1e8:: with SMTP id b95ls3749427plb.10.gmail; Mon, 17 Jun 2019 00:37:41 -0700 (PDT) X-Received: by 2002:a17:90a:ae12:: with SMTP id t18mr18170077pjq.32.1560757061540; Mon, 17 Jun 2019 00:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757061; cv=none; d=google.com; s=arc-20160816; b=gLlid58jxXMfTEBUpBfgKzEcE+wJSjftRfYfrZ6YYsTTgz/Lm4A1X0D5b5tUlzs4/Z mhKsF5474OU++h4qq5NAy70VH4FQH8UCLX71LGqNurTmLW8hR31fjELAGWmsIhVu0RiF jsTuAZBjJlO49ee78LkIMYK9Eu2OsPuIbZoCAohslpa8eeU+uD+qRmh9ZHipaNjYh7Jg 6G/vvZnH4i8PXgfoFl8zoueQATFrj1Ef9dXRslHgJapkkQqxLDUg9Q/iBE4Fq2LAFyuJ 6hiVoUDHtE3hSeVwDHF2migoS7fWXTYpqTJ5cv9xuNYTD5hgKGX17ksKh6OhaVsjp7lb 5sOw== 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=BBtNfOK0Ro21ytRNoCKnmpt1juDbqa+4SOET3zxwhf0=; b=nqbyCHLorI2sx7ZUtSSDGOklnXIt8SIgXwvjlQCsIA0DbCBfZTOo1kMil2IjrBEec4 fGHTicOaPTrpFkDI2uoTgqQpm+tjAMLkYFAQojadoqIcF10Zqbbk5JbtTViA7SsIYbEf RVoGdbH5IQoPICIiKj/4z3cqEULQelTUUDji2ND9ka4GwvXiJd1qNJnlo+XlBqZPwrQr x2Nq6ryygo081ST5fjnrL0JwQwuqI5pwHBOMouAYTRCG/2rdwDPY7CYBkTlJ8ZfhBPHs TtMyjNu5TTuVRbDuxGy3II0+nv4jtYv4+mi3qvuyTKGg/4L43j9NBTNwbUM7NNqVpV2H iGdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=f4esqCLQ; 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 k34sor6848460pgi.67.2019.06.17.00.37.41 for (Google Transport Security); Mon, 17 Jun 2019 00:37:41 -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:eb0a:: with SMTP id t10mr43092553pgh.99.1560757061225; Mon, 17 Jun 2019 00:37:41 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.37.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:37:40 -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 v2 24/99] ram: rk3399: Update cs1_row to use sys_reg3 Date: Mon, 17 Jun 2019 13:01:37 +0530 Message-Id: <20190617073252.27810-25-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190617073252.27810-1-jagan@amarulasolutions.com> References: <20190617073252.27810-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=f4esqCLQ; 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: , cs1_row can handle the pmu via sys_reg2 and sys_reg3 while configuring the dram instead of just sys_reg2. So, update cs1_row macro to make use of both sys_reg2, sys_reg3. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 10 ++++++++-- drivers/ram/rockchip/sdram_rk3399.c | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 4fe7d60daf..7062cb57d9 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -54,8 +54,6 @@ #define SYS_REG_CS0_ROW_MASK 3 #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_ENC_BW(n, ch) ((2 >> (n)) << SYS_REG_BW_SHIFT(ch)) @@ -69,6 +67,14 @@ (5 + 2 * (ch)); \ } while (0) +#define SYS_REG_ENC_CS1_ROW(n, os_reg2, os_reg3, ch) do { \ + (os_reg2) &= (~(0x3 << (4 + 16 * (ch)))); \ + (os_reg3) &= (~(0x1 << (4 + 2 * (ch)))); \ + (os_reg2) |= (((n) - 13) & 0x3) << (4 + 16 * (ch)); \ + (os_reg3) |= ((((n) - 13) & 0x4) >> 2) << \ + (4 + 2 * (ch)); \ + } while (0) + /* 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 40cc31601c..21c1c6566a 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1026,10 +1026,12 @@ static void dram_all_config(struct dram_info *dram, sys_reg2 |= SYS_REG_ENC_RANK(info->rank, channel); sys_reg2 |= SYS_REG_ENC_COL(info->col, channel); sys_reg2 |= SYS_REG_ENC_BK(info->bk, channel); - sys_reg2 |= SYS_REG_ENC_CS1_ROW(info->cs1_row, channel); sys_reg2 |= SYS_REG_ENC_BW(info->bw, channel); sys_reg2 |= SYS_REG_ENC_DBW(info->dbw, channel); SYS_REG_ENC_CS0_ROW(info->cs0_row, sys_reg2, sys_reg3, channel); + if (info->cs1_row) + SYS_REG_ENC_CS1_ROW(info->cs1_row, sys_reg2, + sys_reg3, channel); ddr_msch_regs = dram->chan[channel].msch; noc_timing = ¶ms->ch[channel].noc_timings;