Message ID | 20190611145135.21399-23-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBX4A77TQKGQENMBXLCI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D9D6C3F08F for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 11 Jun 2019 16:53:20 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id bc12sf7908533plb.0 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 11 Jun 2019 07:53:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264799; cv=pass; d=google.com; s=arc-20160816; b=pgNj2H9+jT00C+QYqYoKnb8Km2LS0tJjRS7+OkzIij1seGnxnmz2bfgUxoyfWME1OZ JWfccSV/l8vHMCstHDKqdpzIiefYpr8U+eX/EEwCFRNOQauKH24sGJKIjOeTuvFhNiKc 4aJLwFXKgT1P8uOnnbEOnCyB8EJsOi2LsHeRK8UOvJpTdsaL3BBuG9eMYxVZUajcTu+I fjVS0fTh0y+xyaTT7P9PM+qr3OVPT3dct1Z/0ctayqR+02jSasTSFwAVfechgBxTsDkI Fr11PM4hZCyAJUOebJ7B5IG72HhpzK4VF8JORjCcBUmn7gRI2w19RVMNhiObaFL/8VoP rUFg== 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=ki+GQ0xV9h/qjl0M3m+2pb1v4PDI8NuUzYtzkYdgvMw=; b=KfXt8qcKsFIkUuYR0Gy5yYN4X5AccDDeHkjDKzlDff1n2IddDnSYrW3E+syTh6VukF UotIzhyI11OCouwQ8TYIu3IkGf4PVUvzkoapJ2F1C45P1YLyCen2i5m1bRi7xEtdCCXh LO74kfbbZahj32GxBdE043xNwNdwlawcKiVfKUoq/dFmJuSuveANLKPQGaaME9GSk4O3 pULQVM1uIoWSSwhT6apYRwZgmsF3A3+r/LFbgALW5EtFVcd/D6JZaaNqZ7MOt06S7woq 9kzznEXjI+LgBx2abXI5PD69YEaNjxcshhFTotz5PSzWh7nQyUu7p/5K8yo6UF9FaNmA aLJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XxaHj+zD; 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=ki+GQ0xV9h/qjl0M3m+2pb1v4PDI8NuUzYtzkYdgvMw=; b=VuqlGN2FpaSRXHZ6FBcg1AEz+R3RKkDBbkyhI+3UkYvk3gD5Z79uPwXFMV5R7HUs6H j5+CNGq69g66CHWv/By9xBY9s0eeEpvOSJ/SdHVvJS8NIBAmkNQ2zrxmvrHESSlBpEDT zs7XQrpE9rngCDLynMZKTjoroed1hlXETyGPU= 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=ki+GQ0xV9h/qjl0M3m+2pb1v4PDI8NuUzYtzkYdgvMw=; b=IL5Q9gLco2fHpJhCOPyJLZEePuBN5i8kBfjOjizWcGSZe23QYmda1oTxTNtsFdsqgd C/14R/S29tE4vee1uvoNyiS26eQ1XWPBXHHmCJEjBti74vVtjF0maUtpUXCaQMxLh05V XbJBGHK+5V+owDak55cVvbW4Jzdw/ba29k4807qnFAJ9PTOmGXOvP8msFhy7iafY8T1q HwuA8gkJve1jzSS6P+nTm/9fdeTMhfTGITIxjF6u6uDvoQ4skzJtP4/JeNPZtQbgugNT DaPUE/dLrL4gR7X5udCPv2JMuP2xN83zn8wBjT3NKrVwuyqJJoel9LPzd0D3wbGY/i9G eFtQ== X-Gm-Message-State: APjAAAUSsUvCguY2k6A2P+hOeKst9kfsQMiE8JQF/BYk5L9R5xVmvIoR XF0mr3mdoJQyjzE8ztwm8MzPMajy X-Google-Smtp-Source: APXvYqw0da4scrvfwnbDdukH6iRDjjpxoOu6TpmRN57LP6aOuIyXoWGae7Zlgfg7FPWqbgv7phL7bg== X-Received: by 2002:a65:6495:: with SMTP id e21mr6539541pgv.383.1560264799581; Tue, 11 Jun 2019 07:53:19 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:d0c2:: with SMTP id y2ls858117pjw.5.gmail; Tue, 11 Jun 2019 07:53:19 -0700 (PDT) X-Received: by 2002:a17:90a:ad86:: with SMTP id s6mr2697599pjq.42.1560264799211; Tue, 11 Jun 2019 07:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264799; cv=none; d=google.com; s=arc-20160816; b=vrQtV+O1SUuYhhsLrIsDRVi/jDebhrr4WnfBlLT55/TS/0Dnaz/INrK8TVSTKkgZqO kk0QIu92jw6jJX9vcFL2p360pMueR3TrnR3aBxETR9XATPhLbb3yGlF81uWPNebSadA7 SoszLJULH6Kxgn4RTnNhRYb4kL9XEmpg8dQYQY19H+H0+4GjrJqV07KJvZ8Wyv0E/lVX ccjIzKP0HllOaBYGLRPyj32KPSe2hJPSeB1B+G9WLWwqZqBTxvikzqWbJVAEMMbBiZcj qtgq3ZWovqGCruPH7EYcQwNiniKYWawiiwzQZ6qSLsCzaSUIA7Eb9xMlQu3gcNHC1N3a KBwQ== 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=blUjXzdLmw8GcUgJeI2ZJaLvV6/uY4Q7JuRFDVODbMY=; b=drGRUWX56tg5HxHdmvgKfpEJrF72C9gSqROEX9EBiEbccGw4b/v3Z6jPuEmmU2QbrH fh0YQ4JBqmEWTtd44v/1TVI062FtryEm6nS5942JiN0elsJNVYKRSRUKKTUDUipOzp53 XUDCebvBISFs7eU6KrZUjlg7gq5UZ2nT6v9YcCFUJpt1gzOiR+Z/KsRewNgjSyNKsqvQ HlzNbZGV5YzrnZlHKubJswlJ4muqCntoDeLKXc5fV+6uBLF9pOwYSCYucg9VxyH4UcwC x+6JU9a7rKvrXKJBzZXXi8J8LWfNs3XI59zrmHtm/LjGEUyvElgnPV0nK/WLfQqbMo9B oxdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XxaHj+zD; 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 e8sor15272438plb.48.2019.06.11.07.53.19 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 11 Jun 2019 07:53:19 -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:da4:: with SMTP id 33mr17850928plv.209.1560264798868; Tue, 11 Jun 2019 07:53:18 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.53.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:53:18 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Simon Glass <sjg@chromium.org>, Philipp Tomsich <philipp.tomsich@theobroma-systems.com>, Kever Yang <kever.yang@rock-chips.com>, YouMin Chen <cym@rock-chips.com>, u-boot@lists.denx.de Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH 22/92] ram: rk3399: Update cs0_row to use sys_reg3 Date: Tue, 11 Jun 2019 20:20:25 +0530 Message-Id: <20190611145135.21399-23-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=XxaHj+zD; 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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 7e0b491859..3d1d5badb4 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -51,8 +51,6 @@ SYS_REG_BK_SHIFT(ch)) #define SYS_REG_CS0_ROW_SHIFT(ch) (6 + (ch) * 16) #define SYS_REG_CS0_ROW_MASK 3 -#define SYS_REG_ENC_CS0_ROW(n, ch) (((n) - 13) << \ - 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) << \ @@ -64,6 +62,12 @@ #define SYS_REG_DBW_MASK 3 #define SYS_REG_ENC_DBW(n, ch) ((2 >> (n)) << SYS_REG_DBW_SHIFT(ch)) +#define SYS_REG_ENC_CS0_ROW(n, os_reg2, os_reg3, ch) do { \ + (os_reg2) |= (((n) - 13) & 0x3) << (6 + 16 * (ch)); \ + (os_reg3) |= ((((n) - 13) & 0x4) >> 2) << \ + (5 + 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 4463fc84c8..2408246d0d 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1006,6 +1006,7 @@ static void dram_all_config(struct dram_info *dram, const struct rk3399_sdram_params *sdram_params) { u32 sys_reg2 = 0; + u32 sys_reg3 = 0; unsigned int channel, idx; sys_reg2 |= SYS_REG_ENC_DDRTYPE(sdram_params->base.dramtype); @@ -1026,10 +1027,10 @@ 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_CS0_ROW(info->cs0_row, 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); ddr_msch_regs = dram->chan[channel].msch; noc_timing = &sdram_params->ch[channel].noc_timings; @@ -1051,6 +1052,7 @@ static void dram_all_config(struct dram_info *dram, } writel(sys_reg2, &dram->pmugrf->os_reg2); + writel(sys_reg3, &dram->pmugrf->os_reg3); rk_clrsetreg(&dram->pmusgrf->soc_con4, 0x1f << 10, sdram_params->base.stride << 10);