From patchwork Mon Jul 15 18:20:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 715 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 003A73F0E1 for ; Mon, 15 Jul 2019 20:21:26 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id 91sf8686153pla.7 for ; Mon, 15 Jul 2019 11:21:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214885; cv=pass; d=google.com; s=arc-20160816; b=fQEQrP6cldm3+cY3ABrtF/VAyKKj7epMJrJA1q4iieOFvfMBwZLOvXlQNk+ifz2Yxl I67l4KbBx5AotyOeuDpZpzzp5yYk/xE2sLKp+rdsXareXWB+Pp/zF4T8tSapyjJHY29J vN0ZXXx6DVDPKh63oZarOKzIvwBFe825PX1i7ZVGbPR0mijE012b+aFD98nE3aPk2Van RilLR+ENEwpMnECy4KceGePEdkZOaISU6WO4F/odWRgOG7K4i+AJPT+Pey3t9kkT0sp7 oxIxwV8nkwr66Ed8De0SzALKa8dmR9XBAxB++ilCJLqKF1Yewb00BuLb5PfHieXhbLX1 yxkQ== 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=fbIOjBncaxjUy1ozd74sJdK4VqYBy8fhm0C/20q+hyY=; b=fUvqmjNjfQiMrw1+HJ31AftCfV1LMX0VPHPq8YRyDOCLh+rt+YnzgxfSsTxAu3r1pe B/4ASWosxrOg0OUHRz8vI0nj2B3qcSRDYC6vJRfB8cX2+jId6Z3/ZSQ3nhM+FJUGP9tq o2VwcQ/Qega0+E4IxVdYTiftvQ9EQ1Fgv4dS9zbTKK30eyTgeuFre77NMXa5Od/qNB0Z eDAHQ+lIslEZ1kSfl+jSnzAta1cNvby0pk7yJoBwJIzg6WQavtdS1BKRSFWcQIKMr4B8 7RUQgNlB8ge6ioGpXaWsyA684KaflZ5PRrautSA4au+SyOu6447Ac+sRE7CvXpbNISTU kVqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NUbRoT4L; 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=fbIOjBncaxjUy1ozd74sJdK4VqYBy8fhm0C/20q+hyY=; b=NRrFK79bnx/WtiwMoeofSGcCjkbNUioGpPH7u3L1qOZHuvhNcvVcc7/OWzBYupD+2g 0DSvMMPhAdtHmO75ogdQ3M7qNb29ikMC+fl79pRhzzQU60lygLmnzr1LiiB8uBvWUG5s KCnAtrcR3lnH/qbl2i4t7mAmYdKqNl5yMG8jY= 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=fbIOjBncaxjUy1ozd74sJdK4VqYBy8fhm0C/20q+hyY=; b=prmgg4q4dUIqzuKUfxbPb7LEG/JdG24/RWNnKUhihoCNqmRuFA1MwEHzmDlTaPs6Sw +wtGmfZvqKDlBK/9GdTq0lovEpVZJ7yLu2JnIYKc+8FCAJPohese/P1Gf+QNYfolS/mH LJy/vY5DsmOlNH001EEBx/awTvXWJmXe4pQkk9XoROrceZj8q3U/6+NwsEItNwxN01hh hbVStADX0C6tzp9GBZA1rCxvW3b+gZHuobthG+1JjDkwGZcBwPKNCzKB70i6bblF5A42 nwNeY9BiU4HKVTdbUvU7zdEP8fToiM8QuqKaVJgX7AK8rb23/qAqui3CVmOk5Iw5ciQn IKLQ== X-Gm-Message-State: APjAAAVM6slro58ePH7hfjQiRcMJMMjwWgCpLuZjtn2126Ic621TmBou H2xkY/lDkwTqNfnW9q5aIswWJtVa X-Google-Smtp-Source: APXvYqxvHgAE3nUNVrL1Yht3l9oVTXehNcd/7d6flQr2Y54HxqZ1nLsUwfMtfbZp56ZeY59r/IggBw== X-Received: by 2002:a17:902:e210:: with SMTP id ce16mr30215619plb.335.1563214885332; Mon, 15 Jul 2019 11:21:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:1654:: with SMTP id 81ls3003203pfw.2.gmail; Mon, 15 Jul 2019 11:21:25 -0700 (PDT) X-Received: by 2002:a63:e62:: with SMTP id 34mr28017263pgo.331.1563214884852; Mon, 15 Jul 2019 11:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214884; cv=none; d=google.com; s=arc-20160816; b=t2RbD0+EuMotHwIkmUJoXLIDsXvyLrl8pjcoAXrir13UmsltWDbSEsOkFeWHdU1ucj d3ih5NuC75hXER+B8EAeiIDEAWYfyutQSkUb8SSxi1rfNTx0tD0swCPO4wK4H82KVYrJ Ix00KhQUVOEMtFwkusKSlEMeRaH7fe4XS2pmhQQPxeR3Hn9epSVUJ6mP93XxyyQOgfAu zXmA80YPt3sdlmkXDdVKDOULpyZ6WHDpFj0jJHrl6XOJOa9FgS7MfjXuA6AxoVHuNuLu SpWNk6QyXMJTG1ff5ucPthswcLg3x8RMmf+XYevNu25ZMkKfuRzGKqibBsGHJdH1zc9h 4Aeg== 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=2PZmOlDxLIZ3hi1XK1/L5fS7ODHlI/voHjGPAwKMURw=; b=0A4WO11u7IStFl/J5x0nU/KHz6/tUnmYyR4olEKcjQprLf1Yia0UQpWP6zAMGBRJDH GlrMCIXJ/Tno7XR9YWlO5cCmYcXgoUXjMTYsT0Fy2Oh9iqYF5ayEmLFpY6rVaq/3qjHy PTH0SoWZRGdm6AfkCMti1LeNVk4G4wPJamHSIGWdp68gw7JDTigkKZMJ3RYwf9UhnOAd FG3wIKQ4FZg8JvQ70eFX1jx9sLb20tv1fZGAhrKCbN9yjeQeTfjz+1N18gFXo9Yz72I2 Kq2YQAUzWpn3q/RempCOVMzsdEVRS2Dp1CHxNh6XLNnxYFq24yTr8057TQMDiS3WSToh 0TYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NUbRoT4L; 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 j5sor22140678pjf.7.2019.07.15.11.21.24 for (Google Transport Security); Mon, 15 Jul 2019 11:21:24 -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:90a:e397:: with SMTP id b23mr30897202pjz.117.1563214884535; Mon, 15 Jul 2019 11:21:24 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:24 -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 01/15] ram: rk3399: Fix code warnings Date: Mon, 15 Jul 2019 23:50:56 +0530 Message-Id: <20190715182110.21336-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=NUbRoT4L; 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: , Fix checkpatch warninigs on sdram_rk3399.c like - Avoid CamelCase - Unnecessary parentheses - Alignment should match open parenthesis - multiple blank lines - misspelled - spaces preferred around that '>>' Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 48 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 52518656c4..541e4a4b1e 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -47,7 +47,7 @@ struct dram_info { #define PRESET_GPIO0_HOLD(n) ((0x1 << (7 + 16)) | ((n) << 7)) #define PRESET_GPIO1_HOLD(n) ((0x1 << (8 + 16)) | ((n) << 8)) -#define PHY_DRV_ODT_Hi_Z 0x0 +#define PHY_DRV_ODT_HI_Z 0x0 #define PHY_DRV_ODT_240 0x1 #define PHY_DRV_ODT_120 0x8 #define PHY_DRV_ODT_80 0x9 @@ -150,7 +150,7 @@ static void set_memory_map(const struct chan_info *chan, u32 channel, ((16 - row) << 24)); /* PI_41 PI_CS_MAP:RW:24:4 */ clrsetbits_le32(&denali_pi[41], 0xf << 24, cs_map << 24); - if ((sdram_ch->rank == 1) && (sdram_params->base.dramtype == DDR3)) + if (sdram_ch->rank == 1 && sdram_params->base.dramtype == DDR3) writel(0x2EC7FFFF, &denali_pi[34]); } @@ -166,10 +166,10 @@ static void set_ds_odt(const struct chan_info *chan, u32 reg_value; if (sdram_params->base.dramtype == LPDDR4) { - tsel_rd_select_p = PHY_DRV_ODT_Hi_Z; + tsel_rd_select_p = PHY_DRV_ODT_HI_Z; tsel_wr_select_p = PHY_DRV_ODT_40; ca_tsel_wr_select_p = PHY_DRV_ODT_40; - tsel_idle_select_p = PHY_DRV_ODT_Hi_Z; + tsel_idle_select_p = PHY_DRV_ODT_HI_Z; tsel_rd_select_n = PHY_DRV_ODT_240; tsel_wr_select_n = PHY_DRV_ODT_40; @@ -181,10 +181,10 @@ static void set_ds_odt(const struct chan_info *chan, ca_tsel_wr_select_p = PHY_DRV_ODT_48; tsel_idle_select_p = PHY_DRV_ODT_240; - tsel_rd_select_n = PHY_DRV_ODT_Hi_Z; + tsel_rd_select_n = PHY_DRV_ODT_HI_Z; tsel_wr_select_n = PHY_DRV_ODT_34_3; ca_tsel_wr_select_n = PHY_DRV_ODT_48; - tsel_idle_select_n = PHY_DRV_ODT_Hi_Z; + tsel_idle_select_n = PHY_DRV_ODT_HI_Z; } else { tsel_rd_select_p = PHY_DRV_ODT_240; tsel_wr_select_p = PHY_DRV_ODT_34_3; @@ -294,7 +294,7 @@ static void set_ds_odt(const struct chan_info *chan, } static int phy_io_config(const struct chan_info *chan, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *sdram_params) { u32 *denali_phy = chan->publ->denali_phy; u32 vref_mode_dq, vref_value_dq, vref_mode_ac, vref_value_ac; @@ -423,7 +423,6 @@ static int phy_io_config(const struct chan_info *chan, /* PHY_939 PHY_PAD_CS_DRIVE */ clrsetbits_le32(&denali_phy[939], 0x7 << 14, mode_sel << 14); - /* speed setting */ if (sdram_params->base.ddr_freq < 400) speed = 0x0; @@ -492,7 +491,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, setbits_le32(&denali_pi[0], START); setbits_le32(&denali_ctl[0], START); - /* Wating for phy DLL lock */ + /* Waiting for phy DLL lock */ while (1) { tmp = readl(&denali_phy[920]); tmp1 = readl(&denali_phy[921]); @@ -547,12 +546,12 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, /* PHY_DLL_RST_EN */ clrsetbits_le32(&denali_phy[957], 0x3 << 24, 0x2 << 24); - /* Wating for PHY and DRAM init complete */ + /* Waiting for PHY and DRAM init complete */ tmp = get_timer(0); do { if (get_timer(tmp) > timeout_ms) { pr_err("DRAM (%s): phy failed to lock within %ld ms\n", - __func__, timeout_ms); + __func__, timeout_ms); return -ETIME; } } while (!(readl(&denali_ctl[203]) & (1 << 3))); @@ -569,7 +568,7 @@ static void select_per_cs_training_index(const struct chan_info *chan, u32 *denali_phy = chan->publ->denali_phy; /* PHY_84 PHY_PER_CS_TRAINING_EN_0 1bit offset_16 */ - if ((readl(&denali_phy[84])>>16) & 1) { + if ((readl(&denali_phy[84]) >> 16) & 1) { /* * PHY_8/136/264/392 * phy_per_cs_training_index_X 1bit offset_24 @@ -646,7 +645,7 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, if ((((tmp >> 11) & 0x1) == 0x1) && (((tmp >> 13) & 0x1) == 0x1) && (((tmp >> 5) & 0x1) == 0x0) && - (obs_err == 0)) + obs_err == 0) break; else if ((((tmp >> 5) & 0x1) == 0x1) || (obs_err == 1)) @@ -700,7 +699,7 @@ static int data_training_wl(const struct chan_info *chan, u32 channel, if ((((tmp >> 10) & 0x1) == 0x1) && (((tmp >> 13) & 0x1) == 0x1) && (((tmp >> 4) & 0x1) == 0x0) && - (obs_err == 0)) + obs_err == 0) break; else if ((((tmp >> 4) & 0x1) == 0x1) || (obs_err == 1)) @@ -759,7 +758,7 @@ static int data_training_rg(const struct chan_info *chan, u32 channel, if ((((tmp >> 9) & 0x1) == 0x1) && (((tmp >> 13) & 0x1) == 0x1) && (((tmp >> 3) & 0x1) == 0x0) && - (obs_err == 0)) + obs_err == 0) break; else if ((((tmp >> 3) & 0x1) == 0x1) || (obs_err == 1)) @@ -955,8 +954,10 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(channel); sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(channel); sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(channel); - sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(channel); - sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(channel); + sys_reg |= (info->cs0_row - 13) << + SYS_REG_CS0_ROW_SHIFT(channel); + sys_reg |= (info->cs1_row - 13) << + SYS_REG_CS1_ROW_SHIFT(channel); sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(channel); sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(channel); @@ -991,7 +992,7 @@ static void dram_all_config(struct dram_info *dram, } static int switch_to_phy_index1(struct dram_info *dram, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *sdram_params) { u32 channel; u32 *denali_phy; @@ -1026,7 +1027,7 @@ static int switch_to_phy_index1(struct dram_info *dram, denali_phy = dram->chan[channel].publ->denali_phy; clrsetbits_le32(&denali_phy[896], (0x3 << 8) | 1, 1 << 8); ret = data_training(&dram->chan[channel], channel, - sdram_params, PI_FULL_TRAINING); + sdram_params, PI_FULL_TRAINING); if (ret) { debug("index1 training failed\n"); return ret; @@ -1116,8 +1117,8 @@ static int conv_of_platdata(struct udevice *dev) int ret; ret = regmap_init_mem_platdata(dev, dtplat->reg, - ARRAY_SIZE(dtplat->reg) / 2, - &plat->map); + ARRAY_SIZE(dtplat->reg) / 2, + &plat->map); if (ret) return ret; @@ -1199,8 +1200,8 @@ static int rk3399_dmc_probe(struct udevice *dev) priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); debug("%s: pmugrf=%p\n", __func__, priv->pmugrf); priv->info.base = CONFIG_SYS_SDRAM_BASE; - priv->info.size = rockchip_sdram_size( - (phys_addr_t)&priv->pmugrf->os_reg2); + priv->info.size = + rockchip_sdram_size((phys_addr_t)&priv->pmugrf->os_reg2); #endif return 0; } @@ -1218,7 +1219,6 @@ static struct ram_ops rk3399_dmc_ops = { .get_info = rk3399_dmc_get_info, }; - static const struct udevice_id rk3399_dmc_ids[] = { { .compatible = "rockchip,rk3399-dmc" }, { } From patchwork Mon Jul 15 18:20:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 716 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AE24D3F0E1 for ; Mon, 15 Jul 2019 20:21:30 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id c18sf10957409pgk.2 for ; Mon, 15 Jul 2019 11:21:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214889; cv=pass; d=google.com; s=arc-20160816; b=tHyPicE8WQ8dGQj1FzUillHFwqMuRrZ9VbYlrJIF6AOcbcESiWG8UK0oea0xBMJ0Pl hFPBzOpfKK//SUf9DF8j/lyZSYT1YiGiwOpTJbNvYrCMi9EFNCtd2StVclKx3Nhdr7n6 dvxzyYjAEQk8h1D4zmDGpiS8vYuEdPg4I5JltP0mQVlXVOuj+xY6iAsEVkolyPf5QZ6o Cnafku8rEfBry7nLAeVLIEMZONHgoxqBz+MWpN4P0I9SozgvOspdExV1psZv/yg3bx8K BHFU9Ox17/t6Bq6Ir7mVG0V+/AcCb0qcuGsTApbla7tN41Tf4OKb9bSmAFFK1qZlHxNd jcMA== 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=UpxS2f6EJlWVL0GNXl8SsihK+H8nqSTPHPQbBRCXmOg=; b=TvE138odBqm7Ey9UKXsrVovnuaJqUDdFgaZM6gv3LhZvSWsvsKEbyLDwb3PrSFfvPc 9OvZu6Jt9L/HmRnkycxfaTvP8yzjlo2vhKrF56JaElG1sTl1lmNcwVze8ejVKiR9mmGU caVv9g9FCYCnmcjKEGv75NKJ/vXzFlLWMqtBszYyNNSrpWH6M9eXkf0tPtlyp0Sho1Oe 2KaiN8kGRv3lQRZa3pluptId/wOTx7vBGmDMgJkzGtHpcREOY/uQg3I96ABLLRIybsKY 3tnwD9SL2sZBuSmXpQWNzkd2Zj8OcV6nq+qe7TzSChOWCGFq7X220uDmUoiJ/0j/cjBO 265g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DFiE9O5X; 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=UpxS2f6EJlWVL0GNXl8SsihK+H8nqSTPHPQbBRCXmOg=; b=aCyPeSX4u+DgDZjgDiPWM/brqb6hF3ETPvxXcHbeCGxtLoBtWZ+cKlUS0lxXvg9opY cNFvnGWD2ODHckfxPJUIdv3MFTMPg1CYBvzMeqrlX3dimdspZQAnXPW+rDuAyYvoHtuj KJYRimj0geKUeRZB8mfqeB0yXLipYGo3CB+cY= 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=UpxS2f6EJlWVL0GNXl8SsihK+H8nqSTPHPQbBRCXmOg=; b=Bv6duP3/OcjTb8rHlZUZwjT8VVjO6D5e2nQYY3QJufPh8UoRrpUeeb0XLq56LPokpd mhxj/CYa6wKvchslHMt346SbbXAfJf9KiwwmryopCdxgLMsOdq4iLOX9XF8SRon0ahs7 OppZz9FMEbi9Vr9Dae697bp4A0/JXaxc7v8v1Gl74ns64O4isjTx7BOMfIBwyzfdurXX 3b9pL82MJ3aoYQOiy/uYN9bOIHlt01AM+u6o0n1PQSJfsDOLStphSo3Zanmyw4sIjeMY B9aV9WNKqciPEWQlZ/mNfULdeU9/TVGRpFObrxXUGOisg5Rj6SYMFPBiHZbldSWjCW0+ SNKA== X-Gm-Message-State: APjAAAX4R2cEyMFF6uUKWJO2cc3qZevm0IN2b9v0KcOZJtteLYXgxtFr CMqqIIQPI1te2C71VjNJR2kL1Xt9 X-Google-Smtp-Source: APXvYqyyw1Qy37R4oDYce9VFJsf6wJrPf1t/6+cfl8fuLrowrQzvD+d+r7tXGUoMCct2v5imrJcFdQ== X-Received: by 2002:a17:902:f46:: with SMTP id 64mr30105296ply.235.1563214889505; Mon, 15 Jul 2019 11:21:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:63c1:: with SMTP id x184ls2995639pfb.5.gmail; Mon, 15 Jul 2019 11:21:29 -0700 (PDT) X-Received: by 2002:a63:181:: with SMTP id 123mr29038468pgb.63.1563214889038; Mon, 15 Jul 2019 11:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214889; cv=none; d=google.com; s=arc-20160816; b=qjlRmU1I73B74sIkckJ0yiKbd2dFa+1uzyWaAKEnLqjnhb3toVLt2Gd+VSWLoBLRLA lf+7l4cMIZi3KWUxz0ZId1pcQdeZgkXa1hW3bqkswjmfFcAATQqf5eaaRoPviAoJawDE 61+Z53kwGlTo2DVXE64vL0Yj3OeyuICmRFFC1HJFg2QTDSSskjvOI0rnA9So/rei2H9/ iJ392fnUk4BkxZvDgD4c1BsQy9oT7Z8SSnRMcTyXMeZJrjKtx38sAG9ABou7JYkijDDv C3Cj0t7nj1zBb23fMGYQUB5B8SSn/lIGL971NZge7Zirmlwlj5CEgLY/91VozZ56ySKA segw== 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=91XSnQx5BFEbjjDU1Kng5TwLgRBduu4DBFPUieipXW0=; b=VgaQD57+x10Dr/X+EZqXg5shgnPoiQ0VsdpAw4+Fjc1bmON7YGli92s586uCGzZ/Nk rsylqIvQowrt5SXe7zhG0BGQgOPd0cphFXqDbv5y4l1Fhe4pS4s6z4QKK2AYkGx3LZfF FDVfc7LwLMo5qzLeb1iRRsq/VJE5qeUqIALgAf/Z8oaetLGJ1UqVKP1jYkhnzCdNkIW/ JdTdAWc8GcFqbtvLCCwA00xmdGPEJHd3uviozoCBBkm+vY9YL3YTOVZoYEJDYro4QfJ2 mh6LA7IIdG58fDDZWwWaTJMbcO97p4TZstaCFxU8AUPVwz2pSs17P8I3ZvEf8i9j+tLi FsFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=DFiE9O5X; 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 l4sor9514720pgj.48.2019.07.15.11.21.28 for (Google Transport Security); Mon, 15 Jul 2019 11:21:28 -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:d4c:: with SMTP id 12mr28947708pgn.30.1563214887849; Mon, 15 Jul 2019 11:21:27 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:27 -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 02/15] ram: rk3399: Some trivial code fixes Date: Mon, 15 Jul 2019 23:50:57 +0530 Message-Id: <20190715182110.21336-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=DFiE9O5X; 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 proper spaces in data training, rk3399_dmc_init, pctl_cfg - Order include files - Move macro after include files Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 60 +++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 541e4a4b1e..733864f5d2 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -14,14 +14,27 @@ #include #include #include -#include -#include #include #include #include +#include +#include #include #include +#define PRESET_SGRF_HOLD(n) ((0x1 << (6 + 16)) | ((n) << 6)) +#define PRESET_GPIO0_HOLD(n) ((0x1 << (7 + 16)) | ((n) << 7)) +#define PRESET_GPIO1_HOLD(n) ((0x1 << (8 + 16)) | ((n) << 8)) + +#define PHY_DRV_ODT_HI_Z 0x0 +#define PHY_DRV_ODT_240 0x1 +#define PHY_DRV_ODT_120 0x8 +#define PHY_DRV_ODT_80 0x9 +#define PHY_DRV_ODT_60 0xc +#define PHY_DRV_ODT_48 0xd +#define PHY_DRV_ODT_40 0xe +#define PHY_DRV_ODT_34_3 0xf + struct chan_info { struct rk3399_ddr_pctl_regs *pctl; struct rk3399_ddr_pi_regs *pi; @@ -43,19 +56,6 @@ struct dram_info { struct rk3399_pmugrf_regs *pmugrf; }; -#define PRESET_SGRF_HOLD(n) ((0x1 << (6 + 16)) | ((n) << 6)) -#define PRESET_GPIO0_HOLD(n) ((0x1 << (7 + 16)) | ((n) << 7)) -#define PRESET_GPIO1_HOLD(n) ((0x1 << (8 + 16)) | ((n) << 8)) - -#define PHY_DRV_ODT_HI_Z 0x0 -#define PHY_DRV_ODT_240 0x1 -#define PHY_DRV_ODT_120 0x8 -#define PHY_DRV_ODT_80 0x9 -#define PHY_DRV_ODT_60 0xc -#define PHY_DRV_ODT_48 0xd -#define PHY_DRV_ODT_40 0xe -#define PHY_DRV_ODT_34_3 0xf - #if defined(CONFIG_TPL_BUILD) || \ (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) @@ -473,8 +473,10 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, copy_to_reg(&denali_ctl[1], ¶ms_ctl[1], sizeof(struct rk3399_ddr_pctl_regs) - 4); writel(params_ctl[0], &denali_ctl[0]); + copy_to_reg(denali_pi, &sdram_params->pi_regs.denali_pi[0], sizeof(struct rk3399_ddr_pi_regs)); + /* rank count need to set for init */ set_memory_map(chan, channel, sdram_params); @@ -620,8 +622,10 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); + /* PI_100 PI_CALVL_EN:RW:8:2 */ clrsetbits_le32(&denali_pi[100], 0x3 << 8, 0x2 << 8); + /* PI_92 PI_CALVL_REQ:WR:16:1,PI_CALVL_CS:RW:24:2 */ clrsetbits_le32(&denali_pi[92], (0x1 << 16) | (0x3 << 24), @@ -651,9 +655,11 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, (obs_err == 1)) return -EIO; } + /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); } + clrbits_le32(&denali_pi[100], 0x3 << 8); return 0; @@ -670,8 +676,10 @@ static int data_training_wl(const struct chan_info *chan, u32 channel, for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); + /* PI_60 PI_WRLVL_EN:RW:8:2 */ clrsetbits_le32(&denali_pi[60], 0x3 << 8, 0x2 << 8); + /* PI_59 PI_WRLVL_REQ:WR:8:1,PI_WRLVL_CS:RW:16:2 */ clrsetbits_le32(&denali_pi[59], (0x1 << 8) | (0x3 << 16), @@ -705,6 +713,7 @@ static int data_training_wl(const struct chan_info *chan, u32 channel, (obs_err == 1)) return -EIO; } + /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); } @@ -726,8 +735,10 @@ static int data_training_rg(const struct chan_info *chan, u32 channel, for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); + /* PI_80 PI_RDLVL_GATE_EN:RW:24:2 */ clrsetbits_le32(&denali_pi[80], 0x3 << 24, 0x2 << 24); + /* * PI_74 PI_RDLVL_GATE_REQ:WR:16:1 * PI_RDLVL_CS:RW:24:2 @@ -764,9 +775,11 @@ static int data_training_rg(const struct chan_info *chan, u32 channel, (obs_err == 1)) return -EIO; } + /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); } + clrbits_le32(&denali_pi[80], 0x3 << 24); return 0; @@ -781,8 +794,10 @@ static int data_training_rl(const struct chan_info *chan, u32 channel, for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); + /* PI_80 PI_RDLVL_EN:RW:16:2 */ clrsetbits_le32(&denali_pi[80], 0x3 << 16, 0x2 << 16); + /* PI_74 PI_RDLVL_REQ:WR:8:1,PI_RDLVL_CS:RW:24:2 */ clrsetbits_le32(&denali_pi[74], (0x1 << 8) | (0x3 << 24), @@ -805,9 +820,11 @@ static int data_training_rl(const struct chan_info *chan, u32 channel, else if (((tmp >> 2) & 0x1) == 0x1) return -EIO; } + /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); } + clrbits_le32(&denali_pi[80], 0x3 << 16); return 0; @@ -822,13 +839,16 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel, for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); + /* * disable PI_WDQLVL_VREF_EN before wdq leveling? * PI_181 PI_WDQLVL_VREF_EN:RW:8:1 */ clrbits_le32(&denali_pi[181], 0x1 << 8); + /* PI_124 PI_WDQLVL_EN:RW:16:2 */ clrsetbits_le32(&denali_pi[124], 0x3 << 16, 0x2 << 16); + /* PI_121 PI_WDQLVL_REQ:WR:8:1,PI_WDQLVL_CS:RW:16:2 */ clrsetbits_le32(&denali_pi[121], (0x1 << 8) | (0x3 << 16), @@ -845,9 +865,11 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel, else if (((tmp >> 6) & 0x1) == 0x1) return -EIO; } + /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); } + clrbits_le32(&denali_pi[124], 0x3 << 16); return 0; @@ -938,6 +960,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT; sys_reg |= (sdram_params->base.num_channels - 1) << SYS_REG_NUM_CH_SHIFT; + for (channel = 0, idx = 0; (idx < sdram_params->base.num_channels) && (channel < 2); channel++) { @@ -1164,6 +1187,7 @@ static int rk3399_dmc_init(struct udevice *dev) priv->chan[1].publ, priv->chan[1].msch); debug("cru %p, cic %p, grf %p, sgrf %p, pmucru %p\n", priv->cru, priv->cic, priv->pmugrf, priv->pmusgrf, priv->pmucru); + #if CONFIG_IS_ENABLED(OF_PLATDATA) ret = clk_get_by_index_platdata(dev, 0, dtplat->clocks, &priv->ddr_clk); #else @@ -1173,14 +1197,16 @@ static int rk3399_dmc_init(struct udevice *dev) printf("%s clk get failed %d\n", __func__, ret); return ret; } + ret = clk_set_rate(&priv->ddr_clk, params->base.ddr_freq * MHz); if (ret < 0) { printf("%s clk set failed %d\n", __func__, ret); return ret; } + ret = sdram_init(priv, params); if (ret < 0) { - printf("%s DRAM init failed%d\n", __func__, ret); + printf("%s DRAM init failed %d\n", __func__, ret); return ret; } @@ -1198,7 +1224,7 @@ static int rk3399_dmc_probe(struct udevice *dev) struct dram_info *priv = dev_get_priv(dev); priv->pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); - debug("%s: pmugrf=%p\n", __func__, priv->pmugrf); + debug("%s: pmugrf = %p\n", __func__, priv->pmugrf); priv->info.base = CONFIG_SYS_SDRAM_BASE; priv->info.size = rockchip_sdram_size((phys_addr_t)&priv->pmugrf->os_reg2); From patchwork Mon Jul 15 18:20: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: 717 Return-Path: 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 B10F83F0E1 for ; Mon, 15 Jul 2019 20:21:33 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id j12sf8681968pll.14 for ; Mon, 15 Jul 2019 11:21:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214892; cv=pass; d=google.com; s=arc-20160816; b=iNFnCQ7+7+RdNaLEytev18C4Hwldv96lCSQ5tlNijy0qvt8zIsr0nZtdnvnPlOgrWx fKZZ3Sf74vOw8u0NCTVwxfAMwzwtDuWRG1JKJV2q7qfERPzeP9mB2kszAXHEoa4abhhS PNI10lIvi+SxeydtIySMYuj31jv4O4niVOopmAGCn91M/ALSUhUnmISoW4B4GjyNKWyQ WFS9qMYtEL3f9SdH8STUn9e2gOrSIKfYQKLAcrjR6b/HVGbgOimcur5X/139E/gNLRia irv4FG7nuxgDcHtTa6cDLz9eLVyOK6rZw1ShBdTNzNYgwzwMUiWRafEYCoH1ap0SWjn8 n9+g== 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=KVvVzFKuNzQrgr1R0DR9SpfkSWCQ90miw9YYRH9pZCQ=; b=mEG/EdR4cCbfRtZinFtmMz0AjjTwtOE/X9MIT1vyfiK2YoIuQDpbTFKnERgv9Cr4db YjUplhKDsU2sASUyGDntGJNaiNlZKYMVceZSS0XsoJrvpE14b3algXSxAjr3JmISQuRv 3vq2au11wvpd1/o0Tteak7rltOrQ3Df2n37uV0hTvaX1uJZDHHJacuE03N0yY04uAiq0 xXmTmP0L/vGKqAVc2VrJHmQIoh80UNIKAQv5Af2NCI3fYM22IKnS7eJMQJBQNtPOWvSw 23/quR0tLVprgFO3sr060DAkdpDjtOkSNxId9RyJ35ehSjlN55OTagEMo9qZ2RlOsiTF /PjQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TIPHR5LT; 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=KVvVzFKuNzQrgr1R0DR9SpfkSWCQ90miw9YYRH9pZCQ=; b=RCKd9nu3Q3krd3EKhYLAP2mFSFaGdy+zk86Ojy+SE8wV55BNMB8nEojQdpidvws3iP 3IaDv+EtFpDx+diVR3YyFPlwElrwvRQLR4ps1RbhvqJk4ZyFplZZC9YKnPb4uglPVepY F+205LQqWTD/+iJDWwnLO+PHhBOIseR4lE7GQ= 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=KVvVzFKuNzQrgr1R0DR9SpfkSWCQ90miw9YYRH9pZCQ=; b=DEj6nALpe4MEhUSrSUGCmlGQmJdPG0czWQ+3/cOeUHz/O9dRYgX1Ob/cVAKNJAfyOn wGmsiIDODpdE39UhJDPqQBeL5R3NvSTnLIyizKvjlpYLCtATu0PpseylLOOL330TBemt 5J9D/V8q8EBFNf3s4wTzeNXKdsBk/lOMfe/oNWPBlQeWWwy6N35X+CygPuW+Ouc6iZ9F dEUSh2Xs2+Y/nqMFtzg+BWCSqhP7H4rGefrqz+FFhzAFrTaGnaScwIilSazI+8ZMM9Pk kJIyRSNgqGm6a8lg3/TLXCjBFk25+hA+n/JWk1E5t4dLfDbX8zScMzZ4cAL5Nu2qc80r XaIQ== X-Gm-Message-State: APjAAAUROrAOPJFPTlMcDtur3IZUs9DZAq2h4wR8Se6ketBugOmgfWMG ikPSebSWrwPAaytFw1FhHeGTABhL X-Google-Smtp-Source: APXvYqyT/g10FU4Fo3libOdRZTZ9tW6ISY9ymLPxgds0jBgq1AJzf0fFSbGVLi6HoVf7R0wuLU3RwA== X-Received: by 2002:a17:902:b08a:: with SMTP id p10mr30174403plr.83.1563214892477; Mon, 15 Jul 2019 11:21:32 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b402:: with SMTP id x2ls4700789plr.14.gmail; Mon, 15 Jul 2019 11:21:32 -0700 (PDT) X-Received: by 2002:a17:90a:b387:: with SMTP id e7mr31789255pjr.113.1563214892025; Mon, 15 Jul 2019 11:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214892; cv=none; d=google.com; s=arc-20160816; b=VkXrVxZlBVYIctqj0aZwrOQX2TmHMEB0rgdok4W51N9TXApBPJ3z+FHjp+uepcPpqg P9e0O+wwd5HIE3axMahMq62XVYwnXi3J+UBhrTDiKXFS1G2nQEDjKUpGh+T7eGQCTPA6 z+D86XvzBDeCRy8jX58GLlJTJ6B/1kSsVSkfuJ8s76AsWZJp51QSpNjxATpEZvO/FG0l 9vI8NelQFVhuH7W3MulBJpbiU4LNMBfUAE9A+MiIh3fW3E0aLIcHFF58iNVMhfLNikg5 987p+PTu8WL2bk+lqY2bltu3a7W8HmfdiWJvQMzv8AcsBWF8aK2ijgqFtG5Fucy5oQld AJug== 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=KmKFsDAGwxoAiqCijRqUKLZ7ZLjpJJLsduhpkwVMnGU=; b=AniiIBNy+JDIB+jDZIIxiWMQBksS1iQK8pXo4RCeLiyRId6mlkmQzoS+rWZLbgl5VV VWLPSxhVQRxUVm7t/modYxfQpJ11Wb0JVeYqL5NKqMSYMwLq7fAvLmE2zmiisqA07xjG q4MZCXLVF+q2LAxqEc75oU9p6yJ7ejIhJSNv+eIeCzkA8LVKf/2F2WChqx1muydd/ldS s6yBKBwEIaS7YqyuHl52e9GGV4zAlaqzan3/ubEVrz3StphFDOvUpcI5cWp7gMP7YcZS ulnhoRBpCMy9jN5GnYTG2JgjySVB01MFRcIzOqT17VVzn6xBIFNtlMTa6foSFCig0Glw lbdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TIPHR5LT; 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 x18sor9184075pgh.47.2019.07.15.11.21.31 for (Google Transport Security); Mon, 15 Jul 2019 11:21: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:da52:: with SMTP id l18mr28566377pgj.131.1563214891417; Mon, 15 Jul 2019 11:21:31 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:30 -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 03/15] ram: rk3399: s/sdram_params/params Date: Mon, 15 Jul 2019 23:50:58 +0530 Message-Id: <20190715182110.21336-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=TIPHR5LT; 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: , Rename variable name of struct rk3399_sdram_params from sdram_params with params for more code readability. No functionality change. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 160 ++++++++++++++-------------- 1 file changed, 78 insertions(+), 82 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 733864f5d2..c918c2e588 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -111,10 +111,9 @@ static void phy_dll_bypass_set(struct rk3399_ddr_publ_regs *ddr_publ_regs, } static void set_memory_map(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { - const struct rk3399_sdram_channel *sdram_ch = - &sdram_params->ch[channel]; + const struct rk3399_sdram_channel *sdram_ch = ¶ms->ch[channel]; u32 *denali_ctl = chan->pctl->denali_ctl; u32 *denali_pi = chan->pi->denali_pi; u32 cs_map; @@ -150,12 +149,12 @@ static void set_memory_map(const struct chan_info *chan, u32 channel, ((16 - row) << 24)); /* PI_41 PI_CS_MAP:RW:24:4 */ clrsetbits_le32(&denali_pi[41], 0xf << 24, cs_map << 24); - if (sdram_ch->rank == 1 && sdram_params->base.dramtype == DDR3) + if (sdram_ch->rank == 1 && params->base.dramtype == DDR3) writel(0x2EC7FFFF, &denali_pi[34]); } static void set_ds_odt(const struct chan_info *chan, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_phy = chan->publ->denali_phy; @@ -165,7 +164,7 @@ static void set_ds_odt(const struct chan_info *chan, u32 tsel_idle_select_n, tsel_wr_select_n, tsel_rd_select_n; u32 reg_value; - if (sdram_params->base.dramtype == LPDDR4) { + if (params->base.dramtype == LPDDR4) { tsel_rd_select_p = PHY_DRV_ODT_HI_Z; tsel_wr_select_p = PHY_DRV_ODT_40; ca_tsel_wr_select_p = PHY_DRV_ODT_40; @@ -175,7 +174,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_wr_select_n = PHY_DRV_ODT_40; ca_tsel_wr_select_n = PHY_DRV_ODT_40; tsel_idle_select_n = PHY_DRV_ODT_240; - } else if (sdram_params->base.dramtype == LPDDR3) { + } else if (params->base.dramtype == LPDDR3) { tsel_rd_select_p = PHY_DRV_ODT_240; tsel_wr_select_p = PHY_DRV_ODT_34_3; ca_tsel_wr_select_p = PHY_DRV_ODT_48; @@ -197,7 +196,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_idle_select_n = PHY_DRV_ODT_240; } - if (sdram_params->base.odt == 1) + if (params->base.odt == 1) tsel_rd_en = 1; else tsel_rd_en = 0; @@ -294,7 +293,7 @@ static void set_ds_odt(const struct chan_info *chan, } static int phy_io_config(const struct chan_info *chan, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_phy = chan->publ->denali_phy; u32 vref_mode_dq, vref_value_dq, vref_mode_ac, vref_value_ac; @@ -304,14 +303,14 @@ static int phy_io_config(const struct chan_info *chan, u32 speed; /* vref setting */ - if (sdram_params->base.dramtype == LPDDR4) { + if (params->base.dramtype == LPDDR4) { /* LPDDR4 */ vref_mode_dq = 0x6; vref_value_dq = 0x1f; vref_mode_ac = 0x6; vref_value_ac = 0x1f; - } else if (sdram_params->base.dramtype == LPDDR3) { - if (sdram_params->base.odt == 1) { + } else if (params->base.dramtype == LPDDR3) { + if (params->base.odt == 1) { vref_mode_dq = 0x5; /* LPDDR3 ODT */ drv_value = (readl(&denali_phy[6]) >> 12) & 0xf; odt_value = (readl(&denali_phy[6]) >> 4) & 0xf; @@ -370,7 +369,7 @@ static int phy_io_config(const struct chan_info *chan, } vref_mode_ac = 0x2; vref_value_ac = 0x1f; - } else if (sdram_params->base.dramtype == DDR3) { + } else if (params->base.dramtype == DDR3) { /* DDR3L */ vref_mode_dq = 0x1; vref_value_dq = 0x1f; @@ -397,11 +396,11 @@ static int phy_io_config(const struct chan_info *chan, /* PHY_915 PHY_PAD_VREF_CTRL_AC 12bits offset_16 */ clrsetbits_le32(&denali_phy[915], 0xfff << 16, reg_value << 16); - if (sdram_params->base.dramtype == LPDDR4) + if (params->base.dramtype == LPDDR4) mode_sel = 0x6; - else if (sdram_params->base.dramtype == LPDDR3) + else if (params->base.dramtype == LPDDR3) mode_sel = 0x0; - else if (sdram_params->base.dramtype == DDR3) + else if (params->base.dramtype == DDR3) mode_sel = 0x1; else return -EINVAL; @@ -424,11 +423,11 @@ static int phy_io_config(const struct chan_info *chan, clrsetbits_le32(&denali_phy[939], 0x7 << 14, mode_sel << 14); /* speed setting */ - if (sdram_params->base.ddr_freq < 400) + if (params->base.ddr_freq < 400) speed = 0x0; - else if (sdram_params->base.ddr_freq < 800) + else if (params->base.ddr_freq < 800) speed = 0x1; - else if (sdram_params->base.ddr_freq < 1200) + else if (params->base.ddr_freq < 1200) speed = 0x2; else speed = 0x3; @@ -454,13 +453,13 @@ static int phy_io_config(const struct chan_info *chan, } static int pctl_cfg(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_ctl = chan->pctl->denali_ctl; u32 *denali_pi = chan->pi->denali_pi; u32 *denali_phy = chan->publ->denali_phy; - const u32 *params_ctl = sdram_params->pctl_regs.denali_ctl; - const u32 *params_phy = sdram_params->phy_regs.denali_phy; + const u32 *params_ctl = params->pctl_regs.denali_ctl; + const u32 *params_phy = params->phy_regs.denali_phy; u32 tmp, tmp1, tmp2; u32 pwrup_srefresh_exit; int ret; @@ -474,15 +473,15 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, sizeof(struct rk3399_ddr_pctl_regs) - 4); writel(params_ctl[0], &denali_ctl[0]); - copy_to_reg(denali_pi, &sdram_params->pi_regs.denali_pi[0], + copy_to_reg(denali_pi, ¶ms->pi_regs.denali_pi[0], sizeof(struct rk3399_ddr_pi_regs)); /* rank count need to set for init */ - set_memory_map(chan, channel, sdram_params); + set_memory_map(chan, channel, params); - writel(sdram_params->phy_regs.denali_phy[910], &denali_phy[910]); - writel(sdram_params->phy_regs.denali_phy[911], &denali_phy[911]); - writel(sdram_params->phy_regs.denali_phy[912], &denali_phy[912]); + writel(params->phy_regs.denali_phy[910], &denali_phy[910]); + writel(params->phy_regs.denali_phy[911], &denali_phy[911]); + writel(params->phy_regs.denali_phy[912], &denali_phy[912]); pwrup_srefresh_exit = readl(&denali_ctl[68]) & PWRUP_SREFRESH_EXIT; clrbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT); @@ -513,7 +512,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, copy_to_reg(&denali_phy[512], ¶ms_phy[512], (549 - 512 + 1) * 4); copy_to_reg(&denali_phy[640], ¶ms_phy[640], (677 - 640 + 1) * 4); copy_to_reg(&denali_phy[768], ¶ms_phy[768], (805 - 768 + 1) * 4); - set_ds_odt(chan, sdram_params); + set_ds_odt(chan, params); /* * phy_dqs_tsel_wr_timing_X 8bits DENALI_PHY_84/212/340/468 offset_8 @@ -541,7 +540,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, tmp = (readl(&denali_phy[467]) >> 16) & 0xff; clrsetbits_le32(&denali_phy[467], 0xff << 16, (tmp + 0x10) << 16); - ret = phy_io_config(chan, sdram_params); + ret = phy_io_config(chan, params); if (ret) return ret; @@ -612,13 +611,13 @@ static void override_write_leveling_value(const struct chan_info *chan) } static int data_training_ca(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_pi = chan->pi->denali_pi; u32 *denali_phy = chan->publ->denali_phy; u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_err = 0; - u32 rank = sdram_params->ch[channel].rank; + u32 rank = params->ch[channel].rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -666,13 +665,13 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, } static int data_training_wl(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_pi = chan->pi->denali_pi; u32 *denali_phy = chan->publ->denali_phy; u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0; - u32 rank = sdram_params->ch[channel].rank; + u32 rank = params->ch[channel].rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -725,13 +724,13 @@ static int data_training_wl(const struct chan_info *chan, u32 channel, } static int data_training_rg(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_pi = chan->pi->denali_pi; u32 *denali_phy = chan->publ->denali_phy; u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0; - u32 rank = sdram_params->ch[channel].rank; + u32 rank = params->ch[channel].rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -786,11 +785,11 @@ static int data_training_rg(const struct chan_info *chan, u32 channel, } static int data_training_rl(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_pi = chan->pi->denali_pi; u32 i, tmp; - u32 rank = sdram_params->ch[channel].rank; + u32 rank = params->ch[channel].rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -831,11 +830,11 @@ static int data_training_rl(const struct chan_info *chan, u32 channel, } static int data_training_wdql(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 *denali_pi = chan->pi->denali_pi; u32 i, tmp; - u32 rank = sdram_params->ch[channel].rank; + u32 rank = params->ch[channel].rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -876,7 +875,7 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel, } static int data_training(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *sdram_params, + const struct rk3399_sdram_params *params, u32 training_flag) { u32 *denali_phy = chan->publ->denali_phy; @@ -885,14 +884,14 @@ static int data_training(const struct chan_info *chan, u32 channel, setbits_le32(&denali_phy[927], (1 << 22)); if (training_flag == PI_FULL_TRAINING) { - if (sdram_params->base.dramtype == LPDDR4) { + if (params->base.dramtype == LPDDR4) { training_flag = PI_CA_TRAINING | PI_WRITE_LEVELING | PI_READ_GATE_TRAINING | PI_READ_LEVELING | PI_WDQ_LEVELING; - } else if (sdram_params->base.dramtype == LPDDR3) { + } else if (params->base.dramtype == LPDDR3) { training_flag = PI_CA_TRAINING | PI_WRITE_LEVELING | PI_READ_GATE_TRAINING; - } else if (sdram_params->base.dramtype == DDR3) { + } else if (params->base.dramtype == DDR3) { training_flag = PI_WRITE_LEVELING | PI_READ_GATE_TRAINING | PI_READ_LEVELING; @@ -901,23 +900,23 @@ static int data_training(const struct chan_info *chan, u32 channel, /* ca training(LPDDR4,LPDDR3 support) */ if ((training_flag & PI_CA_TRAINING) == PI_CA_TRAINING) - data_training_ca(chan, channel, sdram_params); + data_training_ca(chan, channel, params); /* write leveling(LPDDR4,LPDDR3,DDR3 support) */ if ((training_flag & PI_WRITE_LEVELING) == PI_WRITE_LEVELING) - data_training_wl(chan, channel, sdram_params); + data_training_wl(chan, channel, params); /* read gate training(LPDDR4,LPDDR3,DDR3 support) */ if ((training_flag & PI_READ_GATE_TRAINING) == PI_READ_GATE_TRAINING) - data_training_rg(chan, channel, sdram_params); + data_training_rg(chan, channel, params); /* read leveling(LPDDR4,LPDDR3,DDR3 support) */ if ((training_flag & PI_READ_LEVELING) == PI_READ_LEVELING) - data_training_rl(chan, channel, sdram_params); + data_training_rl(chan, channel, params); /* wdq leveling(LPDDR4 support) */ if ((training_flag & PI_WDQ_LEVELING) == PI_WDQ_LEVELING) - data_training_wdql(chan, channel, sdram_params); + data_training_wdql(chan, channel, params); /* PHY_927 PHY_PAD_DQS_DRIVE RPULL offset_22 */ clrbits_le32(&denali_phy[927], (1 << 22)); @@ -926,7 +925,7 @@ static int data_training(const struct chan_info *chan, u32 channel, } static void set_ddrconfig(const struct chan_info *chan, - const struct rk3399_sdram_params *sdram_params, + const struct rk3399_sdram_params *params, unsigned char channel, u32 ddrconfig) { /* only need to set ddrconfig */ @@ -934,14 +933,14 @@ static void set_ddrconfig(const struct chan_info *chan, unsigned int cs0_cap = 0; unsigned int cs1_cap = 0; - cs0_cap = (1 << (sdram_params->ch[channel].cs0_row - + sdram_params->ch[channel].col - + sdram_params->ch[channel].bk - + sdram_params->ch[channel].bw - 20)); - if (sdram_params->ch[channel].rank > 1) - cs1_cap = cs0_cap >> (sdram_params->ch[channel].cs0_row - - sdram_params->ch[channel].cs1_row); - if (sdram_params->ch[channel].row_3_4) { + cs0_cap = (1 << (params->ch[channel].cs0_row + + params->ch[channel].col + + params->ch[channel].bk + + params->ch[channel].bw - 20)); + if (params->ch[channel].rank > 1) + cs1_cap = cs0_cap >> (params->ch[channel].cs0_row + - params->ch[channel].cs1_row); + if (params->ch[channel].row_3_4) { cs0_cap = cs0_cap * 3 / 4; cs1_cap = cs1_cap * 3 / 4; } @@ -952,24 +951,22 @@ static void set_ddrconfig(const struct chan_info *chan, } static void dram_all_config(struct dram_info *dram, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 sys_reg = 0; unsigned int channel, idx; - sys_reg |= sdram_params->base.dramtype << SYS_REG_DDRTYPE_SHIFT; - sys_reg |= (sdram_params->base.num_channels - 1) - << SYS_REG_NUM_CH_SHIFT; + sys_reg |= params->base.dramtype << SYS_REG_DDRTYPE_SHIFT; + sys_reg |= (params->base.num_channels - 1) << SYS_REG_NUM_CH_SHIFT; for (channel = 0, idx = 0; - (idx < sdram_params->base.num_channels) && (channel < 2); + (idx < params->base.num_channels) && (channel < 2); channel++) { - const struct rk3399_sdram_channel *info = - &sdram_params->ch[channel]; + const struct rk3399_sdram_channel *info = ¶ms->ch[channel]; struct rk3399_msch_regs *ddr_msch_regs; const struct rk3399_msch_timings *noc_timing; - if (sdram_params->ch[channel].col == 0) + if (params->ch[channel].col == 0) continue; idx++; sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(channel); @@ -985,7 +982,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(channel); ddr_msch_regs = dram->chan[channel].msch; - noc_timing = &sdram_params->ch[channel].noc_timings; + noc_timing = ¶ms->ch[channel].noc_timings; writel(noc_timing->ddrtiminga0, &ddr_msch_regs->ddrtiminga0); writel(noc_timing->ddrtimingb0, @@ -998,14 +995,14 @@ static void dram_all_config(struct dram_info *dram, &ddr_msch_regs->ddrmode); /* rank 1 memory clock disable (dfi_dram_clk_disable = 1) */ - if (sdram_params->ch[channel].rank == 1) + if (params->ch[channel].rank == 1) setbits_le32(&dram->chan[channel].pctl->denali_ctl[276], 1 << 17); } writel(sys_reg, &dram->pmugrf->os_reg2); rk_clrsetreg(&dram->pmusgrf->soc_con4, 0x1f << 10, - sdram_params->base.stride << 10); + params->base.stride << 10); /* reboot hold register set */ writel(PRESET_SGRF_HOLD(0) | PRESET_GPIO0_HOLD(1) | @@ -1015,11 +1012,11 @@ static void dram_all_config(struct dram_info *dram, } static int switch_to_phy_index1(struct dram_info *dram, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { u32 channel; u32 *denali_phy; - u32 ch_count = sdram_params->base.num_channels; + u32 ch_count = params->base.num_channels; int ret; int i = 0; @@ -1050,7 +1047,7 @@ static int switch_to_phy_index1(struct dram_info *dram, denali_phy = dram->chan[channel].publ->denali_phy; clrsetbits_le32(&denali_phy[896], (0x3 << 8) | 1, 1 << 8); ret = data_training(&dram->chan[channel], channel, - sdram_params, PI_FULL_TRAINING); + params, PI_FULL_TRAINING); if (ret) { debug("index1 training failed\n"); return ret; @@ -1061,10 +1058,10 @@ static int switch_to_phy_index1(struct dram_info *dram, } static int sdram_init(struct dram_info *dram, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *params) { - unsigned char dramtype = sdram_params->base.dramtype; - unsigned int ddr_freq = sdram_params->base.ddr_freq; + unsigned char dramtype = params->base.dramtype; + unsigned int ddr_freq = params->base.ddr_freq; int channel; debug("Starting SDRAM initialization...\n"); @@ -1082,10 +1079,10 @@ static int sdram_init(struct dram_info *dram, phy_dll_bypass_set(publ, ddr_freq); - if (channel >= sdram_params->base.num_channels) + if (channel >= params->base.num_channels) continue; - if (pctl_cfg(chan, channel, sdram_params) != 0) { + if (pctl_cfg(chan, channel, params) != 0) { printf("pctl_cfg fail, reset\n"); return -EIO; } @@ -1094,17 +1091,16 @@ static int sdram_init(struct dram_info *dram, if (dramtype == LPDDR3) udelay(10); - if (data_training(chan, channel, - sdram_params, PI_FULL_TRAINING)) { + if (data_training(chan, channel, params, PI_FULL_TRAINING)) { printf("SDRAM initialization failed, reset\n"); return -EIO; } - set_ddrconfig(chan, sdram_params, channel, - sdram_params->ch[channel].ddrconfig); + set_ddrconfig(chan, params, channel, + params->ch[channel].ddrconfig); } - dram_all_config(dram, sdram_params); - switch_to_phy_index1(dram, sdram_params); + dram_all_config(dram, params); + switch_to_phy_index1(dram, params); debug("Finish SDRAM initialization...\n"); return 0; From patchwork Mon Jul 15 18:20:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 718 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CD1833F0E1 for ; Mon, 15 Jul 2019 20:21:36 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id a21sf4108362pgv.0 for ; Mon, 15 Jul 2019 11:21:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214895; cv=pass; d=google.com; s=arc-20160816; b=DT0w2fzixXwVtBfiT5KWs44LUDiYcVb7VyZUBUIAnls8S/IT5dF7TDY3f1JqrwL0Y+ +oHfkkC+sMrBvw0Wn63mFczC1QlGUaxB2yNXWZDwnYHViJL6IgVhPGu4lcb6ZOSQwyDT wC+f7Jh2eg01TH9KDJxqNvl21WEy03bCZLNL4j6FowO0EsTagKcmtxH5Ks2W+RVbNupo UwDtgQabi7H6eBDBKBBnyOcgbqdAQey/9FuT0yBo3SHV/I4YTlnsvFFaFtwCDSP9uFoZ qdmqgJ3nF7NKeKEcdX4tHmh8Jaj/mYGkEt1dbKhArpwAgBm0SBDNDmgaDntJb0a09p0N fwPw== 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=iJ7j/+YZfWFybOhMFjwtDQpLbeGViqOtHszwkAn30rQ=; b=mScqEXYiXl7BI7qG5uAAvrvkuqzhNo1riv7y6JBq1qOGfCGtVubCvYg1w4kxG6PZNf fQezOo7xl2ZAUkrIpXdr6fdSLozr7CN2eYOxjS7oT7htNXkVolT5qDN2lnWCBONjbAkC ZWFMI5jDC94pWN4jHBtTbM4AAP0K25uhToNFrFhoQ1jUP5DS29f8lvDPlnW7AWvqGLzq n3VmJhwifEhPDaRPZK0sMr76gtH5CC22ygGpXy8MqBEOlGbBmulBH+c3hwHVUxBGOskQ g1tyt0K8CQge++3ObD5PamjT0k8bI1hyxFASjpXUoLPIkDfeS6/29ytBwwEqqpIJqgGs JeaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQY2ym+H; 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=iJ7j/+YZfWFybOhMFjwtDQpLbeGViqOtHszwkAn30rQ=; b=F3km0LsJVHpJA1t+vFfMhvhUZfIcVi9iFLXHjKEYHbBqEvyx2hByCFH/Sp1kR7834R t9oaGr0vRSpg39AH9lGxxDDxWHEHKMSigwmXkRxa5u0Fh9ElEX5c1bxxbTkoC85UqIn4 MrLk7Y/4Ih4E8ZJRn0Fs3YtW7e/nl/2FhwKi0= 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=iJ7j/+YZfWFybOhMFjwtDQpLbeGViqOtHszwkAn30rQ=; b=K3adNAiUS2u/Rmhv3pZlmE26nloMXs1f6VyV9yhrvRlEm8j2N0C5EiWtBvM9wABK2L W43/JCPyEJqTzxZB830DwqSbrFx2P924qMDBZQAZnyQOedpEF8NrAf6eA9cCAhP9y7oL foyT6PhI+Zgfe+s6yuzUhehQ2f8WEDKGrvgNbHo393hzIZ9j82Zu2Jd9yRkTR2f8qzAu nUBytyaGsxduKCOdVxE+dRCbTfWdVuAoI2PHoGHrW2Hb9R10EBUq1uxipRcJ/zefrruw eu+EaJu+holhu5JWqhcBlCpnLobxFzDDN0YDdmawDHB+r7vgU+Fn4J5OotT9Yai8YZ6i 3Uxw== X-Gm-Message-State: APjAAAUO/zCFZSbvrgWFqlUJ4WnrMwhfnxyod60ZEWUCYFtQkB76E9i4 7v4gM8k3a7yhOI/x39kuT3H1cJaO X-Google-Smtp-Source: APXvYqzklp9Jm4QcXVZd3FydCqqmmpNnyJUmftUybZRdoD9GFAW7F6uI3rze2Qr3q7rz1B9CresBzA== X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr30853617pjd.72.1563214895648; Mon, 15 Jul 2019 11:21:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:614e:: with SMTP id o14ls2981136pgv.7.gmail; Mon, 15 Jul 2019 11:21:35 -0700 (PDT) X-Received: by 2002:a65:448a:: with SMTP id l10mr3974729pgq.327.1563214895241; Mon, 15 Jul 2019 11:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214895; cv=none; d=google.com; s=arc-20160816; b=kqEjTRmkA63rSSCHkBJtQyz/N7zD4MtaWjAZkb0ero6aLhfJwVm0wnzry0IhthhV5P XoEMfkjUyuZPmpatRgiOkHMzKQIycExeBn/s+bEs4wmo43Wmz0CK+LLd5G9RcqOwkL58 wF1zaG5cqjCfWK3JguuoXs6EQ/dGXlvtVeoNZwNJGzp7g3QjubIoFcDDI+OmD5QAdXci 3p0OkeTWjHadOWj4vo2fwo2SpGfQBnPa+Q5vf7TXV6IfZrfCIVNB2s1PjSfg1Hpd/ZyP XtK5wQmiWVWdpd60oCIzI4eIufvFKwim8KCt+aicOII5sF7v3AozZvdNHB0L6XocQSxF /2kA== 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=wtH+L++PhkK0wx6pSCUYJbZO6pOG2ERf3vcIuQe4X5s=; b=JkGxcubakn0y4NNUT4NPee7jcK69ZnrOuNdQUJtXi9iLf5mcOYZasiaonj5wSDQ5wi /ODFl3tgIPBV0Rf9GtwkN6pxrjYIidU3Xbc8Nreazw12t82Z6sv3xdlOalp5HtuhdYBg lovM8/r3pO/auf4NV+jLxHAJ67gRSg2YnbUjiMkB6A3mOZtIh3+p0LJuOuYdBkR5StOb dZwEPQhjROFOUBQyjDazXobiviUIQIH+tJ6SQkroYrZ6VNBOT+aVseUlLWRBT058v/UM +HfnrM+9MthbfGsyyvq+1HtNOUbvcnDkG+1yMBIgxR+iuskTfbfDHOl6uu1y/Z1rtWHT GS+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hQY2ym+H; 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 s16sor9591903pfd.52.2019.07.15.11.21.35 for (Google Transport Security); Mon, 15 Jul 2019 11:21:35 -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:d448:: with SMTP id i8mr9006870pgj.173.1563214894885; Mon, 15 Jul 2019 11:21:34 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:34 -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 04/15] ram: rk3399: Handle pctl_cfg return type Date: Mon, 15 Jul 2019 23:50:59 +0530 Message-Id: <20190715182110.21336-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=hQY2ym+H; 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 proper return type handling of pctl_cfg with meaningful print statement. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index c918c2e588..de5d8c1b5f 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1063,6 +1063,7 @@ static int sdram_init(struct dram_info *dram, unsigned char dramtype = params->base.dramtype; unsigned int ddr_freq = params->base.ddr_freq; int channel; + int ret; debug("Starting SDRAM initialization...\n"); @@ -1082,9 +1083,10 @@ static int sdram_init(struct dram_info *dram, if (channel >= params->base.num_channels) continue; - if (pctl_cfg(chan, channel, params) != 0) { - printf("pctl_cfg fail, reset\n"); - return -EIO; + ret = pctl_cfg(chan, channel, params); + if (ret < 0) { + printf("%s: pctl config failed\n", __func__); + return ret; } /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */ From patchwork Mon Jul 15 18:21:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 719 Return-Path: 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 3E8643F0E1 for ; Mon, 15 Jul 2019 20:21:40 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id n1sf8681232plk.11 for ; Mon, 15 Jul 2019 11:21:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214899; cv=pass; d=google.com; s=arc-20160816; b=cevXlQQcrGHl5+QPfXSS3AWlwT1PLXb6/JdLP7ALyK2T1b1Ly7JcL7pHX+jKUQHXSf pp4prfo4Qd12bsO1tjXsYJL/ZJPaocHkrKoq/35xxHEvRDBDE5uenZIlsHAxhEiFlAkc s4lZ9yGWeY5y4YdNoaEuw3QU7Zks9jWp0spblX5SuSo/gJKzWLPaPVOjChJyKU+vnTMO wRVyqgR0J375AY3s0TlQKBDLBpXIgMg2ES5vPjQ1hQxabRgcCMsx74BwFhY5OAO5vd6e Yq3d8rTdV2jP9ep0ZE6GeOAYeg2tOTn1yxJ6HsF73q1xN14aeSzjmkzpl2tLmzf/gB35 Ib9w== 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=vKZvHLWgdgduHXOwn6HCX00nwtw0TNZIW6MbbCNSjE8=; b=vbxoabnj8VkD6jDcRRMQT8SoOlWKzzD86lVqQOlR8/nFfeUDhUUs49DlL8Gs8cvSkT ntfTOgmvsQaPNGS/UA29oCOThGw9OQWRlKqXX8o2TgUZJv7C9dfq3JU69aoi1rvzJSLI Ia81iY4xJDE4sSCU9ksbkMSOa5ZFQO9PJAuJ+n4eui5WrWbqXLkQJcqcVlOEDcReiWg2 o4daWshnf1jloQF9dkX9EERsRiNHCmcC1wVNDmvdAe9pQHi4oJRQuyjfwE4xbuA3/kty is2cEvL19kBYydZdIDPOkOE28XhthgGSy7lhaWj3QePGUcU4UBPyZdl1uVMh3OgP5DJy Omsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NneR+4kE; 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=vKZvHLWgdgduHXOwn6HCX00nwtw0TNZIW6MbbCNSjE8=; b=raHHi2WvH9Brn6o5WOIr/KKzQyIMNqbxRHSk+MmkyHBsag9CLUc0ZKnj5gxMetzNDz LraoYNRo0guJnYYkFswma2+gTtMopOiPcZ0kYksHpQMGCisDKac9WkFOF6v/9qjYkmrA 35dljZoqgWRFG0vO9c51ybVQMg4/kBJTEiHIU= 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=vKZvHLWgdgduHXOwn6HCX00nwtw0TNZIW6MbbCNSjE8=; b=B90xLJFsra94OUz9j74QPKo4PVLZAaiUjEit47dI3oPTfwd9GU3lT+eM/6ceEr3JDj yBog1z8LiCQCoXiwxM5FIXvCrAOlw3SOHPtYkCjDAAapOYr3sF/zrcM9rza23jvhysFE oKAf+RrWiXHfK8YsdLf394jo137b1PVu4lQDMNjtubIxBIYoixQl/odpPOn9jXcDZjZL 2oMev8Qay5f+TLd2lXRNpXUGSiR/OCELPnXZ4m4wOp4NEYCC4ywjGfgBUfGK1AnCBs/X ixgKYOCxnawkYAEn+2MU1AyWs9uoO71m3Ak4X5lmYcb3lYqwzIvEdWkvjBZcFGkEQChj 7b4g== X-Gm-Message-State: APjAAAXWzHPr2yPfu9xa0BAi02Qhak2eckLkLo6BrQylKr6MzZQjs6pd ui0ZNTL/8vfcd8HCqAtT+EgWLzuX X-Google-Smtp-Source: APXvYqxRokqpSj7NRPO0qp29RSvED/EZmu7shx5M0GwhXakEm80qx1olKLLPhZUugc9UnakmZBMq4A== X-Received: by 2002:a63:5452:: with SMTP id e18mr11890475pgm.232.1563214899019; Mon, 15 Jul 2019 11:21:39 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:ca05:: with SMTP id x5ls6188248pjt.3.canary-gmail; Mon, 15 Jul 2019 11:21:38 -0700 (PDT) X-Received: by 2002:a17:902:6ac6:: with SMTP id i6mr30074692plt.233.1563214898663; Mon, 15 Jul 2019 11:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214898; cv=none; d=google.com; s=arc-20160816; b=A2xeewyxH66GIJ+/WhBUX47pBuji4bQdF62XFp/oCjJQ0vgoKQKIR/A/d6jrhvZpMI semlPEhu1Z1Z1xfBqsLDwrL3tL44y564aOUCCXip7KxVKotIRNlVlP5y8HlVay8HT6go P36d8VAkcUqSDV5J/illRuevRhxwD3KDBcFfoB2Oj8xHLzwhJjkr57JZ6st+vXNiucW2 KTbO8M/e6F8W917N7NF6EuyuvldE/CLn7Qg7uCVTZiRAhVnv+gl3sNxFxrKvEgzfLZ+k gaucRxnXaQrg6IlFGduIrXyTKcfdELP29ysxeOFcq8pu9ykxZeiiVpAIA/LXjt+YnX53 6Bsg== 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=CH7kXC/55njW0bSaZl2qK2J6bkupjI9qTVeY0Js/mVA=; b=FKz+zqNmw4bkVrxT3s/FqAOMc0kQaxeGKFsSjZEuo+7fdwxnJ0wl+89I/k3z/SGEGI VkgMJFzJh0K8xMv8SlFqqPWzFNdxPABtoGSfyQ5vPMWimDciOqL/UVvZc9ewYoIwCXSI L/SqnmQhbPh9+Y3bdTaFbv3O6NnVqqh0wVy5X4VIqHYvEK+8ZJ38RUYmnplXKWOmkrxj NJQM2wAIVqoxMRbsqKJKO4Xlzk8NWi9xe61hSYqcITgJDT1DUhkH/34oTimP5lBaANku TyelC2izKp4jpGhvhpHkxS8p9S3frvXKfJb2Dl73C7UWthGBPOX50wDK9n/s1L0oTFCh CPeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=NneR+4kE; 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 l4sor9514977pgj.48.2019.07.15.11.21.38 for (Google Transport Security); Mon, 15 Jul 2019 11:21:38 -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:4e60:: with SMTP id o32mr28875943pgl.68.1563214898284; Mon, 15 Jul 2019 11:21:38 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:37 -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 05/15] ram: rk3399: s/tsel_wr_select_n/tsel_wr_select_dq_n Date: Mon, 15 Jul 2019 23:51:00 +0530 Message-Id: <20190715182110.21336-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=NneR+4kE; 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: , Rename tsel_wr_select_n to tsel_wr_select_dq_n based on the bsp code. No functionality change. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index de5d8c1b5f..85ff47f133 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -161,7 +161,7 @@ static void set_ds_odt(const struct chan_info *chan, u32 tsel_idle_en, tsel_wr_en, tsel_rd_en; u32 tsel_idle_select_p, tsel_wr_select_p, tsel_rd_select_p; u32 ca_tsel_wr_select_p, ca_tsel_wr_select_n; - u32 tsel_idle_select_n, tsel_wr_select_n, tsel_rd_select_n; + u32 tsel_idle_select_n, tsel_wr_select_dq_n, tsel_rd_select_n; u32 reg_value; if (params->base.dramtype == LPDDR4) { @@ -171,7 +171,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_idle_select_p = PHY_DRV_ODT_HI_Z; tsel_rd_select_n = PHY_DRV_ODT_240; - tsel_wr_select_n = PHY_DRV_ODT_40; + tsel_wr_select_dq_n = PHY_DRV_ODT_40; ca_tsel_wr_select_n = PHY_DRV_ODT_40; tsel_idle_select_n = PHY_DRV_ODT_240; } else if (params->base.dramtype == LPDDR3) { @@ -181,7 +181,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_idle_select_p = PHY_DRV_ODT_240; tsel_rd_select_n = PHY_DRV_ODT_HI_Z; - tsel_wr_select_n = PHY_DRV_ODT_34_3; + tsel_wr_select_dq_n = PHY_DRV_ODT_34_3; ca_tsel_wr_select_n = PHY_DRV_ODT_48; tsel_idle_select_n = PHY_DRV_ODT_HI_Z; } else { @@ -191,7 +191,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_idle_select_p = PHY_DRV_ODT_240; tsel_rd_select_n = PHY_DRV_ODT_240; - tsel_wr_select_n = PHY_DRV_ODT_34_3; + tsel_wr_select_dq_n = PHY_DRV_ODT_34_3; ca_tsel_wr_select_n = PHY_DRV_ODT_34_3; tsel_idle_select_n = PHY_DRV_ODT_240; } @@ -210,7 +210,7 @@ static void set_ds_odt(const struct chan_info *chan, * for write cycles for DQ/DM */ reg_value = tsel_rd_select_n | (tsel_rd_select_p << 0x4) | - (tsel_wr_select_n << 8) | (tsel_wr_select_p << 12) | + (tsel_wr_select_dq_n << 8) | (tsel_wr_select_p << 12) | (tsel_idle_select_n << 16) | (tsel_idle_select_p << 20); clrsetbits_le32(&denali_phy[6], 0xffffff, reg_value); clrsetbits_le32(&denali_phy[134], 0xffffff, reg_value); @@ -250,7 +250,7 @@ static void set_ds_odt(const struct chan_info *chan, /* phy_pad_fdbk_drive 23bit DENALI_PHY_924/925 */ clrsetbits_le32(&denali_phy[924], 0xff, - tsel_wr_select_n | (tsel_wr_select_p << 4)); + tsel_wr_select_dq_n | (tsel_wr_select_p << 4)); clrsetbits_le32(&denali_phy[925], 0xff, tsel_rd_select_n | (tsel_rd_select_p << 4)); From patchwork Mon Jul 15 18:21:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 720 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C6F233F0E1 for ; Mon, 15 Jul 2019 20:21:43 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id q11sf8667465pll.22 for ; Mon, 15 Jul 2019 11:21:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214902; cv=pass; d=google.com; s=arc-20160816; b=hR/YM9Z6HfINKr3i0yLG99Xtqx40+PQp7c0I5rOBqDpgXTcJHQBYhnwbR18XekZkSC BIv/B6k6t86qPuw0s83i6c1XOBG889Vmx9GHfyQfcOws05N3+jbh3Y2PVfYUr/z2uf42 X7lAyl8PrIRuUQryWn/0LL5H1bKg3Y/m6+d2H1FY2CCAWHNUgBCZfMtJxA8URIneMAx5 eIFehr+7b1H/mQeWMuWg01AmTFo2l03kjlzxXGyHz0lIkniNxKpxB4wDhGkhtP1ZVn1M 9aLFhzGRRuxRxvEsBrGdAjb2r/7ZUk+n3Z6JA4ylRoNV/IESouSN9QphXmSgotjwBrU/ BynQ== 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=q+O7iO565t55okf1lqALAD+m34hDDvuHNsBNntw+1ls=; b=QbwUes7wKq10wUt4gOxLkVPWES6wMcOwey1TKqGj/RYgOc2iQOS2x1AB0iYcBvZggu 0iBMnjskKxCwAMSh0STsZVOMgXIFsC658JZbE4UkW0l3eGmXykj/qlmKhioNvEj1mKM+ qwljob5aUhA2I5JCL7r9Q+jdfRpcvvhU7EnlrlStGl6xXYL46n6wJaptV9tG5y2w/FPJ RJAc8pUWMbeVTK3AuQQmsPKtUm9+QsvRkaSOItzI1z96CvOCa1d8GuTcHNexYAwzQ6Ur V0R5MDM/gsPVSxRlQQ1ivzuQs0CZfRPSTaqetWrQ1ARIjyct80VZnSAxIVmRrMikzQoe OVlA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XGDF2bjF; 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=q+O7iO565t55okf1lqALAD+m34hDDvuHNsBNntw+1ls=; b=qUysdBWT9be9ZY1F5hRWBZcy6qyjvPdsWaUpBRBzk+FEUrMZIn8uj/Eo0XLbeJfD28 8Uwocwcof7IpVvwp7pEOaehlqcnYpPxP/YUZZEDtpBPGR2V+m3snlh12elpFcRmwFve9 qDs2t6Vh/NPif6IWk+vfyKdQ4fry3Ft8FUkJw= 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=q+O7iO565t55okf1lqALAD+m34hDDvuHNsBNntw+1ls=; b=URzBIDEYeGu2n9v88aDOmNiRq9iQZceThoeWkEX9OZhA1/+Nnhbr25duE3GlZWH8pO k0X1gODyQc3pgPQrJTz95NN3PJVbb2QLFnxNsNwa1tAbXin4vB4pFgeG4a9tMKNtpglM Xcw4lcLDnDxuP8Fyo2zOJTSxIPLZTaXeCLmRjI2a3w6s2wbiZjLfy2m6w1ZCSWaEfKUR 5ZlR1AaZ8E3eN+w5j/BgSOjgdqgkemh9ZM74/sYOF8yM9SJOsPw8+mQMKtbVZW7yPkIa 1NBMixt4oeUJBFO/FlQjY/LbKNatEqYR1xyJ6rRjgNKFpxBb+abz57fV+bKtqIXB6sqv /lSQ== X-Gm-Message-State: APjAAAXS0Lpwgpj2c4WFzqIrnSxh1Chc5VORSkQI7+ZK+pJUzVJBR7Nq +6xwS8kKr6lLEnKTYVMrAWfEnM9k X-Google-Smtp-Source: APXvYqypXOhjklZVMlphpKMavCndTKIrtEuzEpilOVxbBGYBK+Sv7YI1piroBwuDR34kRNk0KyLk9w== X-Received: by 2002:a63:6fc9:: with SMTP id k192mr28043913pgc.20.1563214902494; Mon, 15 Jul 2019 11:21:42 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:5f87:: with SMTP id t129ls2999777pfb.8.gmail; Mon, 15 Jul 2019 11:21:42 -0700 (PDT) X-Received: by 2002:a65:4808:: with SMTP id h8mr28039619pgs.22.1563214902071; Mon, 15 Jul 2019 11:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214902; cv=none; d=google.com; s=arc-20160816; b=BlmxyL97LV5Rnur3pCZKXLOvOeABLzdq52nQzdguEN1FtFuzH/wZcorvkgI6j63i8l NmTLZUK8JJ55kgILwBjbZSkUY+m5A9X8KAqwVWIq5qlPv0/VhFDKBUhmUJrdFOE1umIp bKz8YfDnvgg4lztcl2n1eVyOkWJQoD5555xEiuuDPvqp3MgXYOljcYy4XxpuETLyV9ro PhiOd2PiEmR57rltgJwEVgtG2MnjijzwXyMJwleP35RcU4R+z7mqKasB9SRrm4aEuEc1 EqVHWYzGEwBSpTtqbRJ/E3Ysk8pTvogrM1qXAArb2h6VLkTaxl31O+MbqfYfhBKQX2Qa kp1Q== 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=mAq8wnGC/zrJTe+0GXuXV5LHXLk5FFdePopy2DicZZs=; b=Lssv+aJX978858LYmxjwuXgo3sO4485YehtUr9Cx7pmnwp3C6ZHbcCg6mVlfURsUmZ /K6dToJYeUJBA/hwzdNog7PgJ/Slqf+VsSiGhRv520GMORC/mzmAO4GPJygIth8p8Dh4 c8C0veIjY5vaBFeSOpV2dw2sLdJYooDrtFrLTgqVO/pY6b9YLgJixw5ffdH1r22Pgu6E DMUJdDCmppdewCaxBjKDypWBJxWyUfwjK66BW4gBeHCv4pa1/UM9CAAp+ELoHzvvy+ek OhsKzsbEDwxfgGh377L4eh4hE+RkTpai8BOQ2AI5G9no0xiqYwUOQmJzFMdgQDtxCBED +cJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XGDF2bjF; 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 h4sor21835266pji.23.2019.07.15.11.21.42 for (Google Transport Security); Mon, 15 Jul 2019 11:21:42 -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:90a:2385:: with SMTP id g5mr31489416pje.12.1563214901730; Mon, 15 Jul 2019 11:21:41 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:41 -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 06/15] ram: rk3399: s/tsel_wr_select_p/tsel_wr_select_dq_p Date: Mon, 15 Jul 2019 23:51:01 +0530 Message-Id: <20190715182110.21336-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=XGDF2bjF; 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: , Rename tsel_wr_select_p to tsel_wr_select_dq_p based on the bsp code. No functionality change. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 85ff47f133..3ec32bdbc0 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -159,14 +159,14 @@ static void set_ds_odt(const struct chan_info *chan, u32 *denali_phy = chan->publ->denali_phy; u32 tsel_idle_en, tsel_wr_en, tsel_rd_en; - u32 tsel_idle_select_p, tsel_wr_select_p, tsel_rd_select_p; + u32 tsel_idle_select_p, tsel_wr_select_dq_p, tsel_rd_select_p; u32 ca_tsel_wr_select_p, ca_tsel_wr_select_n; u32 tsel_idle_select_n, tsel_wr_select_dq_n, tsel_rd_select_n; u32 reg_value; if (params->base.dramtype == LPDDR4) { tsel_rd_select_p = PHY_DRV_ODT_HI_Z; - tsel_wr_select_p = PHY_DRV_ODT_40; + tsel_wr_select_dq_p = PHY_DRV_ODT_40; ca_tsel_wr_select_p = PHY_DRV_ODT_40; tsel_idle_select_p = PHY_DRV_ODT_HI_Z; @@ -176,7 +176,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_idle_select_n = PHY_DRV_ODT_240; } else if (params->base.dramtype == LPDDR3) { tsel_rd_select_p = PHY_DRV_ODT_240; - tsel_wr_select_p = PHY_DRV_ODT_34_3; + tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; ca_tsel_wr_select_p = PHY_DRV_ODT_48; tsel_idle_select_p = PHY_DRV_ODT_240; @@ -186,7 +186,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_idle_select_n = PHY_DRV_ODT_HI_Z; } else { tsel_rd_select_p = PHY_DRV_ODT_240; - tsel_wr_select_p = PHY_DRV_ODT_34_3; + tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; ca_tsel_wr_select_p = PHY_DRV_ODT_34_3; tsel_idle_select_p = PHY_DRV_ODT_240; @@ -210,7 +210,7 @@ static void set_ds_odt(const struct chan_info *chan, * for write cycles for DQ/DM */ reg_value = tsel_rd_select_n | (tsel_rd_select_p << 0x4) | - (tsel_wr_select_dq_n << 8) | (tsel_wr_select_p << 12) | + (tsel_wr_select_dq_n << 8) | (tsel_wr_select_dq_p << 12) | (tsel_idle_select_n << 16) | (tsel_idle_select_p << 20); clrsetbits_le32(&denali_phy[6], 0xffffff, reg_value); clrsetbits_le32(&denali_phy[134], 0xffffff, reg_value); @@ -250,7 +250,7 @@ static void set_ds_odt(const struct chan_info *chan, /* phy_pad_fdbk_drive 23bit DENALI_PHY_924/925 */ clrsetbits_le32(&denali_phy[924], 0xff, - tsel_wr_select_dq_n | (tsel_wr_select_p << 4)); + tsel_wr_select_dq_n | (tsel_wr_select_dq_p << 4)); clrsetbits_le32(&denali_phy[925], 0xff, tsel_rd_select_n | (tsel_rd_select_p << 4)); From patchwork Mon Jul 15 18:21:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 721 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 54AF73F0E1 for ; Mon, 15 Jul 2019 20:21:47 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id y66sf10703560pfb.21 for ; Mon, 15 Jul 2019 11:21:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214905; cv=pass; d=google.com; s=arc-20160816; b=d5hGM+qyIVjfjsI+uM5iHP/EviEOjwBXU/71YFERamm2Vm+mJgy6SONxtMMGN/55UW MF6gAHV0JDgKrTBbPtYxJ1eHFlcKkEQxOSDuGjYKMBZbOgvyDcLeCqkP2mTZ+oqnjJZx 2AZs4w7gEfLC+ySmdOQfRFtbvYcQstxcQAqVf07f8+LQrOVga8PutoJIet44LV9fSule Lj9RhBoesPVGojNdtlCMBVzsuH6ASiykbsCJNNTx1JX9MQDKNI+W5YVlPQv8ITl79jI6 pqde/XGbBR7WZ4sNZ+wUbLgQkGgpy/835eyUBFFrLYvR+kWrksFh79WIw1oRsuAFY8hb wAsw== 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=sw+4Jawy8IE5IDQ0tZtfzr+4/fLdF63QnJCRV5tRdV8=; b=KCcV3C1ZOJCLZtmmhhUeHtJNPA3DQlWX6c43VziPZ8OCbqZPV/qQ0VcYTfWo0ytm0f 1z1Euu57qr96wiDtgkOTb9UFToB7llqPrkiQJgOeDusIhzFHXp9AwGgO8Kh5vP6kbZRZ NH3ih0gZknbbT8PKrYwk68vQPd/tDO9NGDrFARk/7OMsqALdxTlSTGSf+zTehelwubmw MiKyBwUYI3+KWN7ay4PS/qhzfqfuJBnlfSyqhlQe3zw3j4+9nq5PwlJsNe2FHVTaUugJ V6cIv+zLssVBdeTZx1ms8VV0rmyhbPXdWb6DCAw3NCcIoy4ton0coZVepgddDk9JCNvS Qb6g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WWKux90h; 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=sw+4Jawy8IE5IDQ0tZtfzr+4/fLdF63QnJCRV5tRdV8=; b=QTSj729DbLtlKtuHbPspswrZU01cpPU9s9+WE8xyQhIwltMLt3SN0gkXKuKam6GbAc lUUR07i7nsR0oIHGa6A6klfxRNEP+PvuPib1nyYszfmcFzF3NEbOyDGb2itY8BqpnqYH oE02pHiRybSXEwVCdOCzrE2jjcnyMICufXIh0= 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=sw+4Jawy8IE5IDQ0tZtfzr+4/fLdF63QnJCRV5tRdV8=; b=sEJI1/YSK1mPZjYPqv1E2D7n6c93PDgZaZogXrLg1w4nsn3JISHgUp4Nn+wmcvPxT+ rrcrq5GissQoPCrrpJuPFdKJr04+8S8ZkBj831LGVemC+RyzXYnGTOC9ehJKAFwRk9c4 78BqE50NKmCs40d68oJ5xsQIoMJx1961NLM6Q8zJOB0lMV/koqCsxUqOayCZORL4YDVl F/qij6/3GR3S+nDTGwPz8XwFte8tuRAxFCdXKND0OB6H9HBYjO3F0sPh1fugjwwjWB1B 0vuDhYg1PtVTHwK0Q3s4RtnbaPbunGnxctdKxg/VosWsAg9A3GeMUJpbMKLFa/B85t0+ nwGQ== X-Gm-Message-State: APjAAAU0f+QhjLhsIi+4tDoj06tzxqJyaQCrvd2Ae8d7+5A/CWwOKlsi DFr5W/lx9cnpVNF612Tux4PKxzoI X-Google-Smtp-Source: APXvYqw3BUGpFNV0u9UUR0P5cBErQBgJptB+FCDH+TdtiotgaJrHNaK6q0LoS9J9vF4JdUnhofUX2Q== X-Received: by 2002:a63:2004:: with SMTP id g4mr27156856pgg.97.1563214905793; Mon, 15 Jul 2019 11:21:45 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:b21:: with SMTP id 33ls2982112pgl.1.gmail; Mon, 15 Jul 2019 11:21:45 -0700 (PDT) X-Received: by 2002:a63:205f:: with SMTP id r31mr28363892pgm.159.1563214905357; Mon, 15 Jul 2019 11:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214905; cv=none; d=google.com; s=arc-20160816; b=idiUDWnjIFgt+hE8b90aClPueHiHtvFThMjOCt2EigI5XCHXGnImXCGisBIoJlWehz SE310BQ+JKbSHpmqWZ6eXsgZMwDFqJd6PONUll8jQqBGg7dShc5ejXCEdXoE8eqnUW0/ zFre5o1E358hvU3L6XGvJjFf44JLm6y99FCD3Zfmu4zdJgnhgpzERuhW7g0iW3rMf2tQ cocYW2kTXxgxPWociP15iRJAOyewBhh3Evaj/719IYftNA5loh4WTg8qz/EsHev8g+x0 gxXEZowmD5ovnY6DWt03J1poGx5LVhaqvAu9cJt/+/GBNSkZeEsZXX9iCoBFmN68ams4 wk5Q== 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=eYOvN0Xd3Hh0f6x0tsIZeUhFC5PjypbYAEBgDLIMbqc=; b=AOmfh5ffYm5IBKccjVxyJQ1rsei6koSeK5Iz0Gx04p5NdR+WQE1Vuw6fhq9wHbA+PK Oh8bFBg/Xg/Hm+wK+bMEEIaFqbd6DSPaLIK96Ym6WKNBIufRAEdlxvyoLtDdXM6rb9/C XGnYGhyTvhLVTSv9zW0ccsNnFCb9nD/rI1Yq8dE1xvr0Vkt+bBMyDcx+gI1Qi1oPBNTz vScmQoAwleSNTX+AnMIg8QWoWzm4JEFxVpgU8Ks2svV2W9w8+vAcDYrEInhaizlkm1sv 0sP99aQGoHNnGVWEq52uNYvp17ZIeik837WFc8Rfuwp+ehcJyqVpThUQIeafF8QeQD2j zuLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=WWKux90h; 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 x129sor9556317pfb.58.2019.07.15.11.21.45 for (Google Transport Security); Mon, 15 Jul 2019 11:21:45 -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:a65:51c1:: with SMTP id i1mr6888627pgq.417.1563214905009; Mon, 15 Jul 2019 11:21:45 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:44 -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 07/15] ram: rk3399: s/ca_tsel_wr_select_n/tsel_wr_select_ca_n Date: Mon, 15 Jul 2019 23:51:02 +0530 Message-Id: <20190715182110.21336-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=WWKux90h; 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: , Rename ca_tsel_wr_select_n to tsel_wr_select_ca_n based on the bsp code. No functionality change. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 3ec32bdbc0..bdb46a0128 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -160,7 +160,7 @@ static void set_ds_odt(const struct chan_info *chan, u32 tsel_idle_en, tsel_wr_en, tsel_rd_en; u32 tsel_idle_select_p, tsel_wr_select_dq_p, tsel_rd_select_p; - u32 ca_tsel_wr_select_p, ca_tsel_wr_select_n; + u32 ca_tsel_wr_select_p, tsel_wr_select_ca_n; u32 tsel_idle_select_n, tsel_wr_select_dq_n, tsel_rd_select_n; u32 reg_value; @@ -172,7 +172,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_rd_select_n = PHY_DRV_ODT_240; tsel_wr_select_dq_n = PHY_DRV_ODT_40; - ca_tsel_wr_select_n = PHY_DRV_ODT_40; + tsel_wr_select_ca_n = PHY_DRV_ODT_40; tsel_idle_select_n = PHY_DRV_ODT_240; } else if (params->base.dramtype == LPDDR3) { tsel_rd_select_p = PHY_DRV_ODT_240; @@ -182,7 +182,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_rd_select_n = PHY_DRV_ODT_HI_Z; tsel_wr_select_dq_n = PHY_DRV_ODT_34_3; - ca_tsel_wr_select_n = PHY_DRV_ODT_48; + tsel_wr_select_ca_n = PHY_DRV_ODT_48; tsel_idle_select_n = PHY_DRV_ODT_HI_Z; } else { tsel_rd_select_p = PHY_DRV_ODT_240; @@ -192,7 +192,7 @@ static void set_ds_odt(const struct chan_info *chan, tsel_rd_select_n = PHY_DRV_ODT_240; tsel_wr_select_dq_n = PHY_DRV_ODT_34_3; - ca_tsel_wr_select_n = PHY_DRV_ODT_34_3; + tsel_wr_select_ca_n = PHY_DRV_ODT_34_3; tsel_idle_select_n = PHY_DRV_ODT_240; } @@ -228,7 +228,7 @@ static void set_ds_odt(const struct chan_info *chan, clrsetbits_le32(&denali_phy[391], 0xffffff, reg_value); /* phy_adr_tsel_select_ 8bits DENALI_PHY_544/672/800 offset_0 */ - reg_value = ca_tsel_wr_select_n | (ca_tsel_wr_select_p << 0x4); + reg_value = tsel_wr_select_ca_n | (ca_tsel_wr_select_p << 0x4); clrsetbits_le32(&denali_phy[544], 0xff, reg_value); clrsetbits_le32(&denali_phy[672], 0xff, reg_value); clrsetbits_le32(&denali_phy[800], 0xff, reg_value); From patchwork Mon Jul 15 18:21: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: 722 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 850883F0E1 for ; Mon, 15 Jul 2019 20:21:50 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id i26sf10682017pfo.22 for ; Mon, 15 Jul 2019 11:21:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214909; cv=pass; d=google.com; s=arc-20160816; b=BHvcmO7UyClv9OSNzUmIxVhk3ZxcNijab4QJwGsKWLg2+5GcfhCaqADghpPfSl7Ws3 m6scL07DL61ISEVIRRlfhkQcPQPTgTWcnTfrAv/gbs/fZgeBHtiT1iNMTQbqI1kqBe5d Z2fPdMgnbtty/8+gihrkYx90v/6FfpEPE4aJDbKkpRymQV2tiPTnkE0f/oh+6AvV1KFw qeN3FYa7dMg//wNmFcyD6imQjHCnJGXnL7vsjoN21VotfyaJ2tCoeTJfEVrTpXYaIHZz /yMC4m9ZIyeHvtHWU1tiJT8CLRqMkw5Iksvn9i0F/8zKjP2n9vA2NpIcqcdRLjH5FMe8 eRxQ== 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=9lo5rYCHGQP07P9jN44jxafqpIdB4xO91gjsg2Nj1LY=; b=xemMR9InCMUCvuIkDPsTKNm/t8b47Lnb1qbODRHqav/YEiR69Iq2VES4uqUpzYJXO5 ErlcAZMqIULP410WJYg7BFa5BGuPbuUtMe8/vADjiG7Po4ggrmrfVxbnkZIcTEtwR79A HC9on6SU+bFGNoMPWBEFN3Qx0T+GYOLyZqZzxBt1iOQ/jJENuM+eJ3MIfoJbvNV7Flvh HHZyFspoTihSJrJJgx41iIKAFDZ2WgXsqOHPZRI36YKxXFJVl5WICZHisD0sZiaAYl60 6f8M5ZUzzrunG0qLVcJItRcCJ95oAp0Ldsdh2kZc1g+ZnahkQGDoYF8Wn5TXh2hxRNDS mRow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bZMfoeuf; 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=9lo5rYCHGQP07P9jN44jxafqpIdB4xO91gjsg2Nj1LY=; b=Pw9cYU+DK0OsrVe+mdwFhvlI6DNe3JTbjGeVHRe+YzEAvF+FCQcHjIwQbdBdmw9iZp 4Q6l/KFqV60FEXF/y/LxCyfyBQ9jjlp7iz0Ptj9xDwuyyc2mRChi9KC5Y/dYuHJL8/1s X36UZFV9HeLpuWmsIuacFjXKS9rnSHrFp+AWg= 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=9lo5rYCHGQP07P9jN44jxafqpIdB4xO91gjsg2Nj1LY=; b=MwVOlYg7oiAe2H0C9+jpjSYlDu1qXXqF0JOtPiWAgp1g6AXkm9krjYq35jcZeN6yq7 WECItGIgBDfkZo8u3xjXyYdB7gS0I0oH//eDmE3h5s3TQW+kVXE9aAkSp8uDrq4HO9Px G0dUwxS0cOMBUmmd/ve1lQh07CzFmBEryF+db+O/6wErbCQMk7wiU5ZzemQk/buZMEQ0 L7Be/di7p3TmjToBHqGm0BIRlTjjdZUrj2eu70SFjqCkeVJnlYxyIe1CT9AvqKJsh1XV LYM/0oeM7oaHSMfLpu3H1aq+yo+EGOjEC0dcGuvl9QKqVOWDKRTKpNlIamQEvE3+sQbB wRTw== X-Gm-Message-State: APjAAAUCDqM+5LlAOo22yBkuwJ6UzVNvhNM9Hhc5xzqc7z9cTDTZDvl+ 69y6xFlS3MLGVBVOyTqsKUUXv5CK X-Google-Smtp-Source: APXvYqxxyeyLn8avGrUs5FB/d8To8nmhK8mQuwJgKuB8FDy+b9dsETuBPPji2BXmT6vCIpqFYvxPBQ== X-Received: by 2002:a63:2784:: with SMTP id n126mr27441926pgn.92.1563214909276; Mon, 15 Jul 2019 11:21:49 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:9406:: with SMTP id x6ls2993188pfo.16.gmail; Mon, 15 Jul 2019 11:21:49 -0700 (PDT) X-Received: by 2002:a63:5452:: with SMTP id e18mr11891242pgm.232.1563214908834; Mon, 15 Jul 2019 11:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214908; cv=none; d=google.com; s=arc-20160816; b=WvlVCezDr1apUuhqibiidbp63rw090NtC4S+ZdhRnbOw1Z8otxAOLORFMVWfCf98GN CQgpRVJUFsKV75wJ28rejXQgBfF5MO3BZk0P4gxlKX+yWreScZkpDShZXGtx/7FrVUkT V3Yh6txlJDKGR7BuSvTkzecpFwMzjm0wwZJ3zgM3kIauTGs0b9IzvDWt1DtiZ464njlm 150EnoAKnABz8zVVQ56AiNJkVntwpAbzpXzyyGUgyIpea+gcY9oeqxSV5yT4FIlD7g3u ZrfNgbX9NJsYKq1rIspcpvDlImTuiHdlVwPoCCgMd1WLi9IRAYJEODdbCNs7qPfiXHHk jBrQ== 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=bP5RUNOPzdBiXN4Wuu7IIKjZLRMU38B7qIBozOuu1g8=; b=RymfgiWCaDKIvqO/zP96TfXR5x5Wqp9/XmrClWSq/gn+z7Qxzf1Y3zs1fLv/4L2IAT 8PQYCAMCYVH8vntEqORIIHQqEVsNJNLHNKG0QzvIeMD5i1s+DwiyiBa8bVX+A+nmoAsM w4D199nDgmUfEUSIJO7/Lvvou6rJn/MxswVAfKcttatXaO1FfLR9XA2yWcUjIKh+6s5k XxmGF6ZKVwxU5SjBdQHKuDrbWJqKK0aH8NXe73ApG7+uW9cWz3EBEnbns50uzDXf3yKZ 2pJxp1cQmYUBSiiog4Z9SGX5K0uYqsCe21Q4B/XNgFsgB8TjBgBD/Sc78hYSKdjSNOTl snWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bZMfoeuf; 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 i13sor9326703pgr.87.2019.07.15.11.21.48 for (Google Transport Security); Mon, 15 Jul 2019 11:21:48 -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:a65:5c0a:: with SMTP id u10mr28580554pgr.410.1563214908423; Mon, 15 Jul 2019 11:21:48 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:47 -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 08/15] ram: rk3399: s/ca_tsel_wr_select_p/tsel_wr_select_ca_p Date: Mon, 15 Jul 2019 23:51:03 +0530 Message-Id: <20190715182110.21336-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=bZMfoeuf; 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: , Rename ca_tsel_wr_select_p to tsel_wr_select_ca_p based on the bsp code. No functionality change. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index bdb46a0128..8a983f9bb1 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -160,14 +160,14 @@ static void set_ds_odt(const struct chan_info *chan, u32 tsel_idle_en, tsel_wr_en, tsel_rd_en; u32 tsel_idle_select_p, tsel_wr_select_dq_p, tsel_rd_select_p; - u32 ca_tsel_wr_select_p, tsel_wr_select_ca_n; + u32 tsel_wr_select_ca_p, tsel_wr_select_ca_n; u32 tsel_idle_select_n, tsel_wr_select_dq_n, tsel_rd_select_n; u32 reg_value; if (params->base.dramtype == LPDDR4) { tsel_rd_select_p = PHY_DRV_ODT_HI_Z; tsel_wr_select_dq_p = PHY_DRV_ODT_40; - ca_tsel_wr_select_p = PHY_DRV_ODT_40; + tsel_wr_select_ca_p = PHY_DRV_ODT_40; tsel_idle_select_p = PHY_DRV_ODT_HI_Z; tsel_rd_select_n = PHY_DRV_ODT_240; @@ -177,7 +177,7 @@ static void set_ds_odt(const struct chan_info *chan, } else if (params->base.dramtype == LPDDR3) { tsel_rd_select_p = PHY_DRV_ODT_240; tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; - ca_tsel_wr_select_p = PHY_DRV_ODT_48; + tsel_wr_select_ca_p = PHY_DRV_ODT_48; tsel_idle_select_p = PHY_DRV_ODT_240; tsel_rd_select_n = PHY_DRV_ODT_HI_Z; @@ -187,7 +187,7 @@ static void set_ds_odt(const struct chan_info *chan, } else { tsel_rd_select_p = PHY_DRV_ODT_240; tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; - ca_tsel_wr_select_p = PHY_DRV_ODT_34_3; + tsel_wr_select_ca_p = PHY_DRV_ODT_34_3; tsel_idle_select_p = PHY_DRV_ODT_240; tsel_rd_select_n = PHY_DRV_ODT_240; @@ -228,7 +228,7 @@ static void set_ds_odt(const struct chan_info *chan, clrsetbits_le32(&denali_phy[391], 0xffffff, reg_value); /* phy_adr_tsel_select_ 8bits DENALI_PHY_544/672/800 offset_0 */ - reg_value = tsel_wr_select_ca_n | (ca_tsel_wr_select_p << 0x4); + reg_value = tsel_wr_select_ca_n | (tsel_wr_select_ca_p << 0x4); clrsetbits_le32(&denali_phy[544], 0xff, reg_value); clrsetbits_le32(&denali_phy[672], 0xff, reg_value); clrsetbits_le32(&denali_phy[800], 0xff, reg_value); From patchwork Mon Jul 15 18:21:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 723 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0DFDB3F0E1 for ; Mon, 15 Jul 2019 20:21:54 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id f25sf10692592pfk.14 for ; Mon, 15 Jul 2019 11:21:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214913; cv=pass; d=google.com; s=arc-20160816; b=OLLDlqo07Yk+0/mq/0/nSPWCYLmvkjWA3LdrULyi/N/nzQKIMjc9qWCO8/NxXsHTqY 5Sv7VllUNW/QMxMceISl7moE37rpMiXaHOCjdmo9MluHyPH0UG35D4Xlav93ZKdoOoEB Y9uDxFU0iWiCYGuIUbeOcRf9hXjBaffldubtUP2YIM1GJRSn77NESp+47XbQWAXPUltd 2jV92nbnXmLf51qgyhAXpD+kYg70nhQUCVHeXbd86Jt+KKNCRat7tMzFLfC2Id6nsoQD W1G+Go/6EJDQM1wtvpff8hZLWRKJhaEYwDBVNlKrBwH+f7MkEbySbqiJTd33XsYhC0k0 tPNA== 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=4txk8yp80sVcQ/jfsW5GToj+zXh/ACD4HNok5s1whqM=; b=IcBOb7yAHPDbnhM16UKIBTiL6XyxF8tdNFwzhaIhFMLruRIBmmK5igVZwD4Xkxbwqr lP75D62lyk88Ioi0PhJay9NcJyoXMiPyvtOggbWNDyK3M+vI5UlyVMaulVSHhw2z4x1v 7lefAcvyx7WDtQuBaflewkn/+u57NJF9RZDBpkG7+Wia36Xngn2fUJpwshb14DSZzWBW /ie+P67hbRRtynzVr0H6KCb/grfh8KBvsIVbGAlCmBb5WDD8ngSWNN5U1yfBffWZRD+r DXX0hjea6r64kMlLqRaXCJDNhWjB5v7W8ctBKdPgCp4ukXVCCO9wB84vPrVyLh7mbk2c g13g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nOtJJ5Ng; 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=4txk8yp80sVcQ/jfsW5GToj+zXh/ACD4HNok5s1whqM=; b=XLhs+Hnu8JTdGvP/UykHJYy0qQF6bSpyLy00/fMXfXI7In+CmMyOfoU0Up382OIAfP FObx5go3fREsNFT9H+lz74gwkpfhNSgmd9ZOY7SaHDwFOiikAH+o8sl2Q2DTIRWgcSNv vK2TqOHgsTusge7MZxNq5gyYHKpKmVRuJb1R4= 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=4txk8yp80sVcQ/jfsW5GToj+zXh/ACD4HNok5s1whqM=; b=b4XrgCEKyt75SlTRJ/C/B3Ob3mk6Wc6vxLAlHFNmRGvwJPYkHkeb1kF4q0IOpctKtd mOKDHbwIrjsfB8oTaMLNYo+L6ulIh9eUfP7IyjcIZixycEuM+nJBZI0YBN+wiTaFYKq0 tkalF/oaiFXYRG/4pnxaU4gmUWrj9lJJt6JjTFKQx9TX4QYE7ntr0rW5XCi2+zXL7ib9 fKd3gnpWk5Zlkc+voGZzbaXednDK84yTOcwJTB5Lo3qflAQCXT/8ZZTkrC/hLvhwcHQj ggzqr6h2GJn+eFqz61fsy3o3KulbDke2PO1M35ot+AZe902e+08PKGvTAYPx3DHxWZ9v v+xg== X-Gm-Message-State: APjAAAVL9a4FK7CL4cL6PNsOD37MDAzyul7602k2wzUb1hN+RVq540MY 2rsccoayUV/Zya3Ag9Yzz31usXO5 X-Google-Smtp-Source: APXvYqwwc85S+1LW2/FHuNVXxxVxA9+aO+m5yNAhCruIpcZYWn6buGM9tvO6GBtgodJwVn/QgxM4ew== X-Received: by 2002:a63:f807:: with SMTP id n7mr29275253pgh.119.1563214912816; Mon, 15 Jul 2019 11:21:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6452:: with SMTP id s18ls2980925pgv.2.gmail; Mon, 15 Jul 2019 11:21:52 -0700 (PDT) X-Received: by 2002:a65:6546:: with SMTP id a6mr18543789pgw.220.1563214912387; Mon, 15 Jul 2019 11:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214912; cv=none; d=google.com; s=arc-20160816; b=Iur8kEbG7ptjTiG41W9T/xW10X1lFkj31JU4VIlVJiSJ3SycND8zVLUoUKb81juTGH TgMKAAhgwgutb4PyGhr90kxfjgEotD+iiEzqRQCrbmGv3MycSoxgVOpYOoYZDvfe61aI 1irdj9cCC3A/MEXXvK66AlIvTRJSLVxABY1+IW6OhzEAFNJi8A7drcH8K3viAHRHgeSt biktNV341LT7lQm/bVvwJ9OnlBKXnmZUhp2wEAbYSoFR6fYFYsPtZ7Xte/wflJxlU9Jz /wJoa0vL+RDpQPOuk2yNpz1riWkO/xtKL2KFgqujHFeuIOgGwXqT9I6LO3crvY6cjMJI IRfA== 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=0YK9sxvx6/20fN7RQUyVJZjyj0RELmE6vtRuEvdGvmc=; b=QdaH7gwNiIZh93ebxGy20CajlgLOaDZUJgKakGrexzvxHlK9168SoNvF3TP5DiSVxR a8Lu6NFBAcRBkhUJ+TRmLdHkURiXmBc/OirxUSkr9ehVMWNphf8GTHCVLLHZKOkv3M4y a11VG+IFy9iIpEPbGvILXQv65k8SQ/T7VvEDW/lS3y873mrjwh1WSvljp1iNpKMHOe15 gYp6sHJHML4EYmdaAyb/T5HECvEV6JaL7mm04z+Cdjvzq17EbemYpP+Pk9TatjiajQAt 81AStpecoytfsYVQ6UFHgQXjmV7jCYdTry5W5PKHfPX++K2QEv8wmYp5AXjLAFf7X5vN /wPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nOtJJ5Ng; 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 t12sor9562418pfl.32.2019.07.15.11.21.52 for (Google Transport Security); Mon, 15 Jul 2019 11:21:52 -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:a65:4103:: with SMTP id w3mr17029883pgp.1.1563214911846; Mon, 15 Jul 2019 11:21:51 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:51 -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 09/15] ram: rk3399: Order tsel variables Date: Mon, 15 Jul 2019 23:51:04 +0530 Message-Id: <20190715182110.21336-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=nOtJJ5Ng; 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: , Order tsel* variable declarations and assignment in proper and meaningful way. No functionality change. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 37 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 8a983f9bb1..043b27737d 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -159,41 +159,48 @@ static void set_ds_odt(const struct chan_info *chan, u32 *denali_phy = chan->publ->denali_phy; u32 tsel_idle_en, tsel_wr_en, tsel_rd_en; - u32 tsel_idle_select_p, tsel_wr_select_dq_p, tsel_rd_select_p; - u32 tsel_wr_select_ca_p, tsel_wr_select_ca_n; - u32 tsel_idle_select_n, tsel_wr_select_dq_n, tsel_rd_select_n; + u32 tsel_idle_select_p, tsel_rd_select_p; + u32 tsel_idle_select_n, tsel_rd_select_n; + u32 tsel_wr_select_dq_p, tsel_wr_select_ca_p; + u32 tsel_wr_select_dq_n, tsel_wr_select_ca_n; u32 reg_value; if (params->base.dramtype == LPDDR4) { tsel_rd_select_p = PHY_DRV_ODT_HI_Z; - tsel_wr_select_dq_p = PHY_DRV_ODT_40; - tsel_wr_select_ca_p = PHY_DRV_ODT_40; + tsel_rd_select_n = PHY_DRV_ODT_240; + tsel_idle_select_p = PHY_DRV_ODT_HI_Z; + tsel_idle_select_n = PHY_DRV_ODT_240; - tsel_rd_select_n = PHY_DRV_ODT_240; + tsel_wr_select_dq_p = PHY_DRV_ODT_40; tsel_wr_select_dq_n = PHY_DRV_ODT_40; + + tsel_wr_select_ca_p = PHY_DRV_ODT_40; tsel_wr_select_ca_n = PHY_DRV_ODT_40; - tsel_idle_select_n = PHY_DRV_ODT_240; } else if (params->base.dramtype == LPDDR3) { tsel_rd_select_p = PHY_DRV_ODT_240; - tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; - tsel_wr_select_ca_p = PHY_DRV_ODT_48; + tsel_rd_select_n = PHY_DRV_ODT_HI_Z; + tsel_idle_select_p = PHY_DRV_ODT_240; + tsel_idle_select_n = PHY_DRV_ODT_HI_Z; - tsel_rd_select_n = PHY_DRV_ODT_HI_Z; + tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; tsel_wr_select_dq_n = PHY_DRV_ODT_34_3; + + tsel_wr_select_ca_p = PHY_DRV_ODT_48; tsel_wr_select_ca_n = PHY_DRV_ODT_48; - tsel_idle_select_n = PHY_DRV_ODT_HI_Z; } else { tsel_rd_select_p = PHY_DRV_ODT_240; - tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; - tsel_wr_select_ca_p = PHY_DRV_ODT_34_3; + tsel_rd_select_n = PHY_DRV_ODT_240; + tsel_idle_select_p = PHY_DRV_ODT_240; + tsel_idle_select_n = PHY_DRV_ODT_240; - tsel_rd_select_n = PHY_DRV_ODT_240; + tsel_wr_select_dq_p = PHY_DRV_ODT_34_3; tsel_wr_select_dq_n = PHY_DRV_ODT_34_3; + + tsel_wr_select_ca_p = PHY_DRV_ODT_34_3; tsel_wr_select_ca_n = PHY_DRV_ODT_34_3; - tsel_idle_select_n = PHY_DRV_ODT_240; } if (params->base.odt == 1) From patchwork Mon Jul 15 18:21:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 724 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 7D6073F0E1 for ; Mon, 15 Jul 2019 20:21:57 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id 91sf8686804pla.7 for ; Mon, 15 Jul 2019 11:21:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214916; cv=pass; d=google.com; s=arc-20160816; b=mKaDZTQifMiN7cm0uDbvY69GIQ41Hwj8BbJjo6wQH/cGOwk3bFaW/QWO78Ix3QmHsa euPQBub6uO7lEOKroZHIx8kn/atIDZ/t7rJiSOeRj1szEbHGQAer4LY0+UKopsB0eFD2 m9ewC5V+788Al1wjy+Exn2ZCpiyl56xngVYCC5H0ettloE30OTDM6juOPvWs1f2tx/tB mRazWGV8AUDMvK7TvsjBL/lz0WgLla4nkX4RQrz50sjkVbcBEfIcVe+1gNyAPXyH8U3x uJ23lT/2Nif0W493L2GQ4M1552RW2eHSczkVlky64jgN4BngkeHqkrNvvSOQZnthINDg KrnQ== 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=ivRRJjxArUDORLvpjX6jFg5BYgeXYjD3/KdIdn96GlI=; b=OIZ5mwmjH15JGo+2SmNasv9TCojNldyBt+Y94h62HQIShoY6N1Mwebnql/Sai8qAE/ ++rD+PFQhvWn3WGzV316kx5YcDJTbbXJwWO4jtWBPI/nvIkiIp83QHqhkYkD6ITem5a0 CtsRlilgZv/jfbB/OULXFB3S/BAKreX8tm75U/P2e49rynDtwocVSUoOMIQTqg9gNysw OTNjk3p71Y/t2iDi1rvtIgNPVomFXLp/xMaV0JlsbLSWUAuP/+raNHB/FdSPNyY3Dn2P JTD+5KbvywP7LjEC3O+qNqgLr51DAftdCMHeSt79XfTtqoJoR68K/Jqq5OufTN8hkrKC Noiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JUmjZMbz; 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=ivRRJjxArUDORLvpjX6jFg5BYgeXYjD3/KdIdn96GlI=; b=rpCKFmtHf7VlvDBXH630XMgRAZnBLViDFElnoCE8ZPERnj5hnHzEDIwWpN2UGBoTJv j79FtrUHCpkvVH2QjqHboq7QckhXGzIlzrIGfhfO+tDhbmlatjmwNvClpkQqIk2i/qUL OjEnwFad5x5HpNu2+VuQG79Xt1+qF1B1UfPDQ= 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=ivRRJjxArUDORLvpjX6jFg5BYgeXYjD3/KdIdn96GlI=; b=DYWwJuNi0xykvDf+nLeM+AHA0db1jo97p9kIfIY6OMDG85qsiUlBVP8wzL0GSk77Li xI99Xflr51RI6o1yV+xdnukOY6Rb19PVvUGKLMBgmPv0XuJvUXMrpFADklpcsRpuVoxv NMipdYVPzmn2zexOTNOGgf10ZIoUAkyN2ZnimTp/tJYUO1SJWrgOMe+DVK1YLCrQ+h4a wFwypXcGYgL9z8NnX1MdwjISqTRwx+oA9bqYP9B1tGqIY1P5d/qm4h7g6UKmHb9WbfXb cvWfDQB/o36M2caS1CfzQIOKQmU/+q+KZWcDpiyxsATRTJiwDkaJQ1Tunn0bydf7M4jh yQDA== X-Gm-Message-State: APjAAAX7Xkj9FtqUA46uqtiIxnKU3X8iq54g42FfBmHuwPDqBFi7i7yE TYBXyOF694XYt6qfITC99mhcdpa8 X-Google-Smtp-Source: APXvYqweMpREg9ELxW+fsZYyS8C/FNXaa5kaeR/WmtdO28ZGxl7tI8UJtIdCS5GG8SFsoHGYcV16XQ== X-Received: by 2002:a63:2ad5:: with SMTP id q204mr15467723pgq.140.1563214916213; Mon, 15 Jul 2019 11:21:56 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:454c:: with SMTP id x12ls2209786pgr.10.gmail; Mon, 15 Jul 2019 11:21:56 -0700 (PDT) X-Received: by 2002:a63:755e:: with SMTP id f30mr28533797pgn.246.1563214915821; Mon, 15 Jul 2019 11:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214915; cv=none; d=google.com; s=arc-20160816; b=VS5kfd0ylOpoAr+RXSWykyWG6p/vbbNnvuqt2JrdMANQUMYuajMUeEe9hlisq8fdoK DsaYALrclfwhIBmyP5PoiJA+LDTNpJ2PpnH9OvA801YiT27mf6fJn+/Zebcts3eSBp3e PAtFXd948CsTKA8nbI34IKHxuW5yyA/PChN7F4F1IGCGiwdnEeMkoCiM+fDfZlWRAg9U jS8PbN6UNgCskpvKKFkLkP3BNKr/bxX7d9NSHSCJ9ToZko+gzvrnCXcMS5sXxY43v7OZ 5MLf+YnyLO2WgT1E52nF7yxpk0DzTN3lzYD7dLGvXKAmzVNDGmZAdEoGU2gy5SjqtmwW LU5g== 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=+9/anVDS7Q12usMSqx4jEVXDSHZX9ttjNc+q4flrxR8=; b=fwuCB55uONC/mB3sqQopGEDVZ9yMSygKVkYLqtOdhl/Pq+hGguw6t7AeLLukScyKhW 2CYIpMvJRg1xeI3rmyiip6BF5FTMsw9fLoG5RtmEzuOcsnlimwK3bu99z8snuph9vZy3 /nOqPGodxx0w64kUgCB/JdnMvf+8cr6gyPAy/iMouQe3iKfilz5xRm4yXFEGutYjh19s q/F4etGEzOOUXZTPz6oBwfZ3Em0BT1EG3yqMGkAZJIWDTUHFU+DIfk3GA1xRAwwsyNmh cQV/4+4RFd2kIIpKKKVNStfxjc0qygj9koRk3o3Km4F8lbhzEWM0faAtOENu5a/FHB6O 8Vfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JUmjZMbz; 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 f7sor9254086pgc.20.2019.07.15.11.21.55 for (Google Transport Security); Mon, 15 Jul 2019 11:21:55 -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:9c5:: with SMTP id 188mr3258004pgj.2.1563214915446; Mon, 15 Jul 2019 11:21:55 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:55 -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/15] ram: rockchip: rk3399: Add cap_info structure Date: Mon, 15 Jul 2019 23:51:05 +0530 Message-Id: <20190715182110.21336-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=JUmjZMbz; 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: , Group common ddr attributes like - rank - col - bk - bw - dbw - row_3_4 - cs0_row - cs1_row - ddrconfig into a common cap_info structure for more code readability and extend if possible based on the new features. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- .../include/asm/arch-rockchip/sdram_rk3399.h | 6 +- drivers/ram/rockchip/sdram_rk3399.c | 73 ++++++++++--------- 2 files changed, 45 insertions(+), 34 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index c6a260bad8..683093d4ca 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -71,7 +71,7 @@ struct rk3399_ddr_cic_regs { /* DENALI_CTL_274 */ #define MEM_RST_VALID 1 -struct rk3399_sdram_channel { +struct sdram_cap_info { unsigned int rank; /* dram column number, 0 means this channel is invalid */ unsigned int col; @@ -89,6 +89,10 @@ struct rk3399_sdram_channel { unsigned int cs0_row; unsigned int cs1_row; unsigned int ddrconfig; +}; + +struct rk3399_sdram_channel { + struct sdram_cap_info cap_info; struct rk3399_msch_timings noc_timings; }; diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 043b27737d..492b0975dd 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -121,35 +121,36 @@ static void set_memory_map(const struct chan_info *chan, u32 channel, u32 row; /* Get row number from ddrconfig setting */ - if (sdram_ch->ddrconfig < 2 || sdram_ch->ddrconfig == 4) + if (sdram_ch->cap_info.ddrconfig < 2 || + sdram_ch->cap_info.ddrconfig == 4) row = 16; - else if (sdram_ch->ddrconfig == 3) + else if (sdram_ch->cap_info.ddrconfig == 3) row = 14; else row = 15; - cs_map = (sdram_ch->rank > 1) ? 3 : 1; - reduc = (sdram_ch->bw == 2) ? 0 : 1; + cs_map = (sdram_ch->cap_info.rank > 1) ? 3 : 1; + reduc = (sdram_ch->cap_info.bw == 2) ? 0 : 1; /* Set the dram configuration to ctrl */ - clrsetbits_le32(&denali_ctl[191], 0xF, (12 - sdram_ch->col)); + clrsetbits_le32(&denali_ctl[191], 0xF, (12 - sdram_ch->cap_info.col)); clrsetbits_le32(&denali_ctl[190], (0x3 << 16) | (0x7 << 24), - ((3 - sdram_ch->bk) << 16) | + ((3 - sdram_ch->cap_info.bk) << 16) | ((16 - row) << 24)); clrsetbits_le32(&denali_ctl[196], 0x3 | (1 << 16), cs_map | (reduc << 16)); /* PI_199 PI_COL_DIFF:RW:0:4 */ - clrsetbits_le32(&denali_pi[199], 0xF, (12 - sdram_ch->col)); + clrsetbits_le32(&denali_pi[199], 0xF, (12 - sdram_ch->cap_info.col)); /* PI_155 PI_ROW_DIFF:RW:24:3 PI_BANK_DIFF:RW:16:2 */ clrsetbits_le32(&denali_pi[155], (0x3 << 16) | (0x7 << 24), - ((3 - sdram_ch->bk) << 16) | + ((3 - sdram_ch->cap_info.bk) << 16) | ((16 - row) << 24)); /* PI_41 PI_CS_MAP:RW:24:4 */ clrsetbits_le32(&denali_pi[41], 0xf << 24, cs_map << 24); - if (sdram_ch->rank == 1 && params->base.dramtype == DDR3) + if (sdram_ch->cap_info.rank == 1 && params->base.dramtype == DDR3) writel(0x2EC7FFFF, &denali_pi[34]); } @@ -624,7 +625,7 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, u32 *denali_phy = chan->publ->denali_phy; u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_err = 0; - u32 rank = params->ch[channel].rank; + u32 rank = params->ch[channel].cap_info.rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -678,7 +679,7 @@ static int data_training_wl(const struct chan_info *chan, u32 channel, u32 *denali_phy = chan->publ->denali_phy; u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0; - u32 rank = params->ch[channel].rank; + u32 rank = params->ch[channel].cap_info.rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -737,7 +738,7 @@ static int data_training_rg(const struct chan_info *chan, u32 channel, u32 *denali_phy = chan->publ->denali_phy; u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0; - u32 rank = params->ch[channel].rank; + u32 rank = params->ch[channel].cap_info.rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -796,7 +797,7 @@ static int data_training_rl(const struct chan_info *chan, u32 channel, { u32 *denali_pi = chan->pi->denali_pi; u32 i, tmp; - u32 rank = params->ch[channel].rank; + u32 rank = params->ch[channel].cap_info.rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -841,7 +842,7 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel, { u32 *denali_pi = chan->pi->denali_pi; u32 i, tmp; - u32 rank = params->ch[channel].rank; + u32 rank = params->ch[channel].cap_info.rank; for (i = 0; i < rank; i++) { select_per_cs_training_index(chan, i); @@ -940,14 +941,14 @@ static void set_ddrconfig(const struct chan_info *chan, unsigned int cs0_cap = 0; unsigned int cs1_cap = 0; - cs0_cap = (1 << (params->ch[channel].cs0_row - + params->ch[channel].col - + params->ch[channel].bk - + params->ch[channel].bw - 20)); - if (params->ch[channel].rank > 1) - cs1_cap = cs0_cap >> (params->ch[channel].cs0_row - - params->ch[channel].cs1_row); - if (params->ch[channel].row_3_4) { + cs0_cap = (1 << (params->ch[channel].cap_info.cs0_row + + params->ch[channel].cap_info.col + + params->ch[channel].cap_info.bk + + params->ch[channel].cap_info.bw - 20)); + if (params->ch[channel].cap_info.rank > 1) + cs1_cap = cs0_cap >> (params->ch[channel].cap_info.cs0_row + - params->ch[channel].cap_info.cs1_row); + if (params->ch[channel].cap_info.row_3_4) { cs0_cap = cs0_cap * 3 / 4; cs1_cap = cs1_cap * 3 / 4; } @@ -973,20 +974,26 @@ static void dram_all_config(struct dram_info *dram, struct rk3399_msch_regs *ddr_msch_regs; const struct rk3399_msch_timings *noc_timing; - if (params->ch[channel].col == 0) + if (params->ch[channel].cap_info.col == 0) continue; idx++; - sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(channel); + sys_reg |= info->cap_info.row_3_4 << + SYS_REG_ROW_3_4_SHIFT(channel); sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(channel); - sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(channel); - sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(channel); - sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(channel); - sys_reg |= (info->cs0_row - 13) << + sys_reg |= (info->cap_info.rank - 1) << + SYS_REG_RANK_SHIFT(channel); + sys_reg |= (info->cap_info.col - 9) << + SYS_REG_COL_SHIFT(channel); + sys_reg |= info->cap_info.bk == 3 ? 0 : 1 << + SYS_REG_BK_SHIFT(channel); + sys_reg |= (info->cap_info.cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(channel); - sys_reg |= (info->cs1_row - 13) << + sys_reg |= (info->cap_info.cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(channel); - sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(channel); - sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(channel); + sys_reg |= (2 >> info->cap_info.bw) << + SYS_REG_BW_SHIFT(channel); + sys_reg |= (2 >> info->cap_info.dbw) << + SYS_REG_DBW_SHIFT(channel); ddr_msch_regs = dram->chan[channel].msch; noc_timing = ¶ms->ch[channel].noc_timings; @@ -1002,7 +1009,7 @@ static void dram_all_config(struct dram_info *dram, &ddr_msch_regs->ddrmode); /* rank 1 memory clock disable (dfi_dram_clk_disable = 1) */ - if (params->ch[channel].rank == 1) + if (params->ch[channel].cap_info.rank == 1) setbits_le32(&dram->chan[channel].pctl->denali_ctl[276], 1 << 17); } @@ -1106,7 +1113,7 @@ static int sdram_init(struct dram_info *dram, } set_ddrconfig(chan, params, channel, - params->ch[channel].ddrconfig); + params->ch[channel].cap_info.ddrconfig); } dram_all_config(dram, params); switch_to_phy_index1(dram, params); From patchwork Mon Jul 15 18:21:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 725 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C40863F0E1 for ; Mon, 15 Jul 2019 20:22:00 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id c18sf10958145pgk.2 for ; Mon, 15 Jul 2019 11:22:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214919; cv=pass; d=google.com; s=arc-20160816; b=SPp4hBmkPZFl3sOnmB32a2cq2W/zdOup2ylmQXkvVzwr80ZZJd1Sw3t/h4+E5HUNsY XEbuAYEL0oAOLYHScZTxCnkVftIJilEbGHeS3pBt74ELHNIP+SlwP0c6jyNz7KPpYhdy 64HfD2jRFfhfYg1cF5kt7DDMvEMArBK4ShU6xfm0ssIwE102qLZjXs+ldqY3tPRcAEMi 8D+v+RkAP0u0qkdOXY+tsW2Z4f9ZzdDerkz84nQ5LoDCsrqOyzchsHbvmd91FbAWsT65 5gS/UIjQc7SorqJCi/D/CxwTtwxxZpCCTMl0Mzuagv1htKoTGZSAO5f2Zgpypnr44sQ5 YmNQ== 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=VmrYqvT0/0VOlIiYrlPJ1nwfiMFWfgvkmdo/ow5r9As=; b=TEWaL9gfQyPHV1ckK4358rGMVgkusrDUe3eNwNHq2Cmf4doDSAcDpWcPVYJ4MP+mgn hPtKf78YWKd02yqfomc/Mj5mRRU2cOFZY2xEhaSHO+m71c3cC5BNqyTikQW3tYjxmcbD beIunK7rzkqchd9jF80pkw65utxtgQwAEwj6NXZLohdlCkk8QrB1ZDVmSLu91iAZBPaS nlaYJKIZdZIqn7Cdc2BuOMa9uFhn6QA3ItEggOna/PF8dnT8UtiUQDumekmPo6OAbpxy PaefhsXxnYmetKh2xdD82JIbYAT/7BzjjkiE+MFB6Su49XTyWu8wkSqmQI1qrX/r0+fk GoVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="fijZIa/k"; 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=VmrYqvT0/0VOlIiYrlPJ1nwfiMFWfgvkmdo/ow5r9As=; b=JmX24bflTvCBHK56O2wpI4bV1CCaxFYluGD/gOUYTL0Gq1ZDOVYNqoBX/XrA+5qB8t xkhzXREdqeEgwL1NwZj4u9OuLAZtSFwZSWama4niJhyskZRXMSnIbWvY6z/wBAb+GngP N7MoIoQMBr+4dLZ/05NhWuAQ6LWb0Sai0likg= 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=VmrYqvT0/0VOlIiYrlPJ1nwfiMFWfgvkmdo/ow5r9As=; b=nrPwWuCm+1IG7ed3KjDElUvBHM9RagJ7rbxhrb12gzuJAN0rwc7TQMtFSTPJjE+Sks zGukVZT0TWGnxIT/26jNMd+RX99gJGjDcV5jouGqLnyhap7QSS6WyLN/1zFr6yh4EIzN peGkgQ/nmDP+9W8yCGDsiGFq5/pY7Omhjwly917keFLZNbUCI/wPtmeaipRouQj7Z3Y3 oJPtmKWHlq+0wJ0GEBHInVBJuxvGJSgAYxBRarOBkLXGs6W939gH0pU7f56enfikJRN2 nQc6WOoURhfU906+MZu8zJjuGsZZfrkJFOtd+37Tp96ZTqxRxcthJ8NPXurH/gJhZuUe geow== X-Gm-Message-State: APjAAAVafO9Hm7icNpCqA5b8nqw3EkQHkr0tqpJlUV0WWzHZRsJePLmR f/b8nMw21l8L5V6jnqjb3yDt3sdW X-Google-Smtp-Source: APXvYqzBMt3Cc92yM96/UAfFkFGx9gj9IfWSwXw39MIW4BhljppYRuh4sHQKHWzz1JWazFj7h0pMZQ== X-Received: by 2002:a17:902:b603:: with SMTP id b3mr30387166pls.9.1563214919645; Mon, 15 Jul 2019 11:21:59 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:db53:: with SMTP id u19ls6192071pjx.3.gmail; Mon, 15 Jul 2019 11:21:59 -0700 (PDT) X-Received: by 2002:a17:90a:4f0e:: with SMTP id p14mr29805659pjh.40.1563214919277; Mon, 15 Jul 2019 11:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214919; cv=none; d=google.com; s=arc-20160816; b=FSsYbD630BYQ/m0EwIEraikGZcgJfQ64UYXv+usAh/wTIkq96NF7b9S+GI/lqubYO1 4tpQeKYVm5QN3kF3krH3TB6D35DtDloi4GIDINdwl89Ji/gVeQcW1AdT5N4ugMtxa3PJ 3L+ror6buNVZAJSkl5ibJztfJcEg7tFUFgaSp2LUqkSQSZIF2WJ1QJzPyEZwj6fkzsyY SU1i13wb8vwC7TJwj36Piqg4vxJHDJOeZV3R43j4PbF7N5wIt7bdpEKWZwfNqlz2SDHg UH8i5Z6UdwJBolcUqGcfUsBu0+mKWrI/dlsv/Ezl2Q7FkN0pXNAo3siIIzOWsHYIjuMx Mthw== 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=tOgocXtcb9eoHiA9+8GIY1ESQs7h5zSAVTxuw+oyh2w=; b=MCa3cCT53uLm32zeWsA5zcEl33RLE392zWonQQdoX3Y/uZ/q+v27m+c3NJp8Wauwpu cvU4UxuMTeyBEnjhRmqkefUB1KF3ZJptniSA7t6VJ4e6gRHzVtr4mqR0LHxCdmBpifSx ZVcjhcmFgZUQ9EpTukZwD0uxPUVra1SO7vsYNlGuXM4JnXHHERS0HFhHNk6DsbnoRux5 H50LmKkPt9PFjSuoNwpsitkx/F4hBCV66GEcjgrAKWewaAgNjmAvHHRuuDQtrvGrIXB0 eSDWL6dJ4pFrCQeVo4Ts9b3qds71vnxxQBWpAkZRec4iK9yaz9clS5jillveuHRG5JS0 KBIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="fijZIa/k"; 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 w11sor9413141pfi.56.2019.07.15.11.21.59 for (Google Transport Security); Mon, 15 Jul 2019 11:21:59 -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:4006:: with SMTP id n6mr26798435pga.403.1563214918859; Mon, 15 Jul 2019 11:21:58 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:21:58 -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 11/15] ram: rk3399: s/rk3399_base_params/sdram_base_params Date: Mon, 15 Jul 2019 23:51:06 +0530 Message-Id: <20190715182110.21336-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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="fijZIa/k"; 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: , Most of the ddr parameters are common in rk3399_base_params structure and which would reuse it in another controller like px30 in future. So, rename the structure from rk3399_base_params into sdram_base_params. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_rk3399.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index 683093d4ca..5614b94ecb 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -96,7 +96,7 @@ struct rk3399_sdram_channel { struct rk3399_msch_timings noc_timings; }; -struct rk3399_base_params { +struct sdram_base_params { unsigned int ddr_freq; unsigned int dramtype; unsigned int num_channels; @@ -106,7 +106,7 @@ struct rk3399_base_params { struct rk3399_sdram_params { struct rk3399_sdram_channel ch[2]; - struct rk3399_base_params base; + struct sdram_base_params base; struct rk3399_ddr_pctl_regs pctl_regs; struct rk3399_ddr_pi_regs pi_regs; struct rk3399_ddr_publ_regs phy_regs; From patchwork Mon Jul 15 18:21:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 726 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 3E9003F0E1 for ; Mon, 15 Jul 2019 20:22:04 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id 6sf10718435pfz.10 for ; Mon, 15 Jul 2019 11:22:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214923; cv=pass; d=google.com; s=arc-20160816; b=XHgBV/DaNElLpyHq/0BcIO3+NhWPUKiXZr+FYY2iZgKDmfj9zD46QOc84AWRLhbB/o pLXfiWqVevwPAh649VbZMaIWKBeapJHnwrGoWVQGosH/+b7zbsV4vvoDee0BhMKzuAkX Tb4b5aY+6BnAgo57Q3waf9i1hyuxoXN97zLAR2De+nh2NZgGKRp4EpHRH0m6d5ulNnhX ++NeG4n+dwRhNSKsOy4M0SrMx1pNuKtpdkIjARXWMixJoE6V73j/pYv1L+J71IxGd+Zy MjbHsUABrC95IZrdMz0ipfyuTiCON5fgXxta/5VBY1ZENARtSYUUphHpYocJ9OM7Rrev IdjQ== 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=wKjIodNveQmbgHhcWLojl8Isiz+15KLp58753K6lsxM=; b=UVHioWTj0saWcRgghL4A9J5xTOKnYextdNKkr+ms+tPxzE0WgSltux+S+bStAju94C iCgreVDINlOGCAAwPHExmTKkbZzx5dwQVKJxsp3ZP0fQhsMtrywjYqJ1jDE9XSGVAaWg 1iCBszDoxsCh8xfx/+Bw3PnEZTozTSmg28CfSUSdSDntb9Y9g3QjQkcMOUGaWbhb60G/ FgitJVYfeBVbsLh9zddBu1zQOMvTHe9xd92azP/YXBuUqQVWhqcuMbGpYgsg9CfQiXkd gRKlrh3F1djg4CIXC0shkhbdAd5pjsCRm+uydhFLBLS9Za7GyEhII+zRg5eu5Z5zCnmQ a1OA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=C9ix2b+u; 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=wKjIodNveQmbgHhcWLojl8Isiz+15KLp58753K6lsxM=; b=gj12Wdf7yl1/+AbRMbC5TzCzVz/+Quf+XP52i5iKkZd8ySWkDSsb1Ej2ku3gDOxi6l CjHCFnAx9/EUf0a20G3CoXFSgSwYBCm0svApCamJ+80nxeSfXY8yKTwCzmPdQbK/dMl2 a7lBX5okfpsjpIaRR+IDKceP5WhkSUsNQfMc0= 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=wKjIodNveQmbgHhcWLojl8Isiz+15KLp58753K6lsxM=; b=ey2a9MAMfCPFxMzJ+MoizvswsPnJDCmIqXbLDqbQudliy3HUOl3wjJUYE3Wc40oX0t osBip2Uu8+ooVWbRq0cje/W+q24zzJvyci/Voj4w+sF91f3UJofY086vMjWugaBtWoCj B4Zd1Prq27qPjBIZwpeY6hDWW5WjXhJt520108ShVDoAD7Xf/lIufhq0yWYbUCpirC47 /dmUERv8ViyNfLjL5jlBPk30oE9vqcdVXWK5QoCeusS1Cy98eFiJSUspOqPLePO5JkBp 8tPrFwm6npC6rTpDtI7hD6Y3DXGOgxvTWnnG/wddJ6G5MR7U9GYLRizu5FpZz4Wm78Ic cgFw== X-Gm-Message-State: APjAAAUbvb4P86qnYMB86NXCtSBbkYMiATjGKGBN/VqaBZjTlOUzhpcV zV4mpceP4Gg5BlgMNWG/xzIjbuvm X-Google-Smtp-Source: APXvYqzPkfNy1kdBwyUPNjW4btKV/nOFQWxE70KgcnOt0mON1ZHtgAOge8/BXqj7gIwhOHpmYynYpQ== X-Received: by 2002:a65:690e:: with SMTP id s14mr14167560pgq.47.1563214922998; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:a9:: with SMTP id a38ls4714084pla.5.gmail; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) X-Received: by 2002:a17:902:a5c7:: with SMTP id t7mr30328041plq.288.1563214922671; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214922; cv=none; d=google.com; s=arc-20160816; b=Fb5OKwZQQcxdrHaxvB5rXUaa99CNVwbgAoslOzBFYm0Uz08QbN6f4F5gfHo+xaofl9 bUYzIC035/5Q63uP53yjcCsulwldKe1+sqQTeaDGLkwYFHnlni52vR4KctAI1HI372i7 tQRTs46+pTuGL8o2kuXPOo1cAd0MLqZv5wjzGAtubNoqF9bw0AU89yfyhESE/538bwf/ PwO4KMvyVr3gw+OgS28TNxhNU5nWva1XtnHdU9CGHb3w6z83zMi0Ge29xlhREcWntw5D pkuurNgRRhI9/s1uG+6SkYNSbXegnyCo1woTfNyJx0FNUMwbzbpy0uuH3UPsLypWBIlW kc+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=GhyKwnagao9aNVYww6EAzysFAFTMSOWzSUv3cqsoz+w=; b=S/8DnjjRfD+vdh94iqLx117JgeRG/hDsNIeM8i4mO6YvD2And/JBEuz9ahwBSbbASM z4AArpr+iRBzlq9Xst+FBa95VeBIxQdoSisEPEXFL/uL8YjUXcCpaiuw9SCae2GW+31f uVE+Eo5gQFVr33Vlnbrxe0f6RnSBcQ1AO6UlOnQKPIBXboi3Z5azoK7KjYcwFbzbdc0D gM+VdKdQRysu++7ShzJ1PvTaI8H+t7P27Y7ACqUdms5jLpMdfsM3ycSMIBoA2Dtf4MLA 2tm/zQXZ15GzudgnfA6Q+amVeYIsf4anr/2Aw4UaTCM+5P3GHM4dzUzb+e6YwsfiU9vI j0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=C9ix2b+u; 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 m33sor21878201pjb.4.2019.07.15.11.22.02 for (Google Transport Security); Mon, 15 Jul 2019 11:22:02 -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:90a:db42:: with SMTP id u2mr30907608pjx.48.1563214922319; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:22:01 -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 12/15] ram: rk3399: Move common sdram structures in common header Date: Mon, 15 Jul 2019 23:51:07 +0530 Message-Id: <20190715182110.21336-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=C9ix2b+u; 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: , Move common sdram structures like sdram_cap_info, sdram_base_params into sdram_common header, this would help to reuse the same from another controllers like px30. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- .../include/asm/arch-rockchip/sdram_common.h | 29 +++++++++++++++++++ .../include/asm/arch-rockchip/sdram_rk3399.h | 28 ------------------ 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 671c318d50..82ce3d3fc9 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -5,6 +5,35 @@ #ifndef _ASM_ARCH_SDRAM_COMMON_H #define _ASM_ARCH_SDRAM_COMMON_H + +struct sdram_cap_info { + unsigned int rank; + /* dram column number, 0 means this channel is invalid */ + unsigned int col; + /* dram bank number, 3:8bank, 2:4bank */ + unsigned int bk; + /* channel buswidth, 2:32bit, 1:16bit, 0:8bit */ + unsigned int bw; + /* die buswidth, 2:32bit, 1:16bit, 0:8bit */ + unsigned int dbw; + /* + * row_3_4 = 1: 6Gb or 12Gb die + * row_3_4 = 0: normal die, power of 2 + */ + unsigned int row_3_4; + unsigned int cs0_row; + unsigned int cs1_row; + unsigned int ddrconfig; +}; + +struct sdram_base_params { + unsigned int ddr_freq; + unsigned int dramtype; + unsigned int num_channels; + unsigned int stride; + unsigned int odt; +}; + /* * sys_reg bitfield struct * [31] row_3_4_ch1 diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index 5614b94ecb..65c92cf744 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -71,39 +71,11 @@ struct rk3399_ddr_cic_regs { /* DENALI_CTL_274 */ #define MEM_RST_VALID 1 -struct sdram_cap_info { - unsigned int rank; - /* dram column number, 0 means this channel is invalid */ - unsigned int col; - /* dram bank number, 3:8bank, 2:4bank */ - unsigned int bk; - /* channel buswidth, 2:32bit, 1:16bit, 0:8bit */ - unsigned int bw; - /* die buswidth, 2:32bit, 1:16bit, 0:8bit */ - unsigned int dbw; - /* - * row_3_4 = 1: 6Gb or 12Gb die - * row_3_4 = 0: normal die, power of 2 - */ - unsigned int row_3_4; - unsigned int cs0_row; - unsigned int cs1_row; - unsigned int ddrconfig; -}; - struct rk3399_sdram_channel { struct sdram_cap_info cap_info; struct rk3399_msch_timings noc_timings; }; -struct sdram_base_params { - unsigned int ddr_freq; - unsigned int dramtype; - unsigned int num_channels; - unsigned int stride; - unsigned int odt; -}; - struct rk3399_sdram_params { struct rk3399_sdram_channel ch[2]; struct sdram_base_params base; From patchwork Mon Jul 15 18:21:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 727 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 86CAD3F0E1 for ; Mon, 15 Jul 2019 20:22:07 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id z14sf3974642pgr.22 for ; Mon, 15 Jul 2019 11:22:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214926; cv=pass; d=google.com; s=arc-20160816; b=d1EQl8/PPJBtGPyduONujGanM0gcF3ppHShCY3XZ2h22DOcxYZFc0slRNG8sG0BDuJ EYDc+At1s+GeH8bQ86vF5okBPyhO5s1rjQ9V5mLhJic8Q785b35rkRC20JekhapTo3KU 1b18Gzc5YxdqXYIxxriLKAHjdCJ+zbyduvjd7IO6p5UXzzebdmwkmgWhq6BTlZ2hYw3C 9sAwRBhhXrjj4Pl5BIIZ6oiH3A9lTFEt04XkDbksoG7smqHuAtGEDUgs5Lt19gff5NTw crE920n8a5DPb+RZDmuJSd7p1JnMSiAuojFGdh0c2Kmae+0SldfIIJ3s9rWOyRWqIW3D x7UQ== 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=pj2q5584G05ll9XqGOXiM3aR35AoLC5owdeWnP+eRfE=; b=a9oiRR7YP2gi6rffFsRl8/COHlg7CmoNGLLDq+TLPeggk1kwsBFpsJtMOKtETLgEtW K7hUYmNd45F7DpH1BDE2wI91oMv9596vRA0ksrUPJ0UVPtP2PgRZou3Vfiz3qG/eahoN H9gmOlqCzK3Wj8XRprSsJV1TgTeBKzmqNSFRWfyZyGEVSt6fkrFakWR0o0TU958lX+lN /Ty8oT3w13q2BNG88WhVAIvYb/mfQEcM6rFgaXBxOet5GUJt22fxPOTVeYQFWq39j++z kscRuniARnYrFmX/NADNq59m2IwQ3QsdGQ5wIyRnxXC5gw62OfL2JsAJ7cUU9d5mBFwj mc2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VMMh2Wun; 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=pj2q5584G05ll9XqGOXiM3aR35AoLC5owdeWnP+eRfE=; b=IXMoZTDUbSs01SE368t3fKFzZ8LgR51RXSpWBBW2z68z9nqFBD/5BZbpHGpNxPfV6r eSS9ZDAHGAOmsAbIRjHJRJEYIX8QkXdtPE616CCGx7fHeOa7NDfZ6MgWfiJ+hPYPNTAN d21lzFvCq/rAeW22C9NZtKXI4IP2m2Z7YnIJI= 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=pj2q5584G05ll9XqGOXiM3aR35AoLC5owdeWnP+eRfE=; b=qUCnubXgrcw/YbEnxdrf74olrxTskjXe/xCMj67GoIoXcvzVmvtf1mZLL/BcRKY5zr pGeuT7m2KhCb0O5bLLVsU6K2/+IlM7yNOlIRQzZIuNEm3Q1Onoc9ANS+GuTe9lgekEFq dffE5d+W9uzZKh6Co8XNVi+w0SfFd+d0mfsP488V01htiFAdezy2R3GNcJy3+wdS9H7S jyyIPehztCGbg++DmrbyMNC8+GKuAgFm3H2T5rsg1fW5yHw97kcOeUalLoBsZ6h7JuPb RFHCvNP0Siq/tj7a4a8tLzZRfFmnMfMtL4L7tmvhHgY7wCvPD9/QjlxBX221NqGOEewm +U/Q== X-Gm-Message-State: APjAAAVJ8JrXblrhYYrTtcy4yqD4dqjTybM/GiBCND1m2vdY1tW/6K4z wAFDnul3cXZc63S7UX/sA/DBM/yj X-Google-Smtp-Source: APXvYqzlKJVgS0U1/fc+l8sPZAV0+P8H8MHM2Jmw8dbwheg5/KNnuSEeYT1cWHTMPJTNm0ezj0jUgw== X-Received: by 2002:a17:90a:7d04:: with SMTP id g4mr31012836pjl.41.1563214926395; Mon, 15 Jul 2019 11:22:06 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3787:: with SMTP id v7ls6193325pjb.4.canary-gmail; Mon, 15 Jul 2019 11:22:06 -0700 (PDT) X-Received: by 2002:a17:90a:2430:: with SMTP id h45mr31577145pje.14.1563214925982; Mon, 15 Jul 2019 11:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214925; cv=none; d=google.com; s=arc-20160816; b=zAWrZg2XYcsYiMZgN/QwcRBzDJDA9roq/sPxHJOvenZk8rR3Kuq5TyrQm7gL2g0hS2 N2dSNXFdZFxqi5B3ofg4VTOVaFb5C8C0mP6ib5wifYkl6jxhoFpP/e9Z6kWTtklO/b0I z42X1EQNbly3ooGJvsG1/7yp/KsO3unjkXqO/OMroBWnv66LzhgR7VV2/vQAl1sVqZ02 XZnxwf2gVdLPpI3uqA0gfWl/nzyV6Q8e5ajg5/tIyxI7L6UCnB6blebfGtwbtWQFZlpx yxBug970ufhdAxMpjeDnDt7jHodtYSSUgw5gBQmikekJErEitgQSOOBPG459L/tSX9At 0+aQ== 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=+faoSNUq7ISOuktRNgl+n22wUdzlRqNIPSMIAahM4n4=; b=g6ZxyPvcrLLfjOv1E1k1drUZ1cbgeiLfJtjuHqnaqjEFxbBsqDYur9ppm3e8zcQNZ+ /DRImWCq5iPj+2C+kX/YzUrazfhlk77dvreFx8vlRf0S4vU1us7Ix4hEeUjvOecoybQO B6dcbxlHFXR1pcfU0vuMODxq14QLyWKHHr6tf2wOXDrLoJ75ZjoetnadxcWmU3D5RsYo 4k88E5P2dUCozwzribT2anG1YlaxTjgCQXJJ6PT3/lYa3aXlBO1iF//XC0jGooE1nGDe 89o+YL+zA+eaj4PFafWP3hVeIuQDH+qYv9S8NhoRUFkokq/SSh75QzcxU/YYGzqDnLpH 14ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VMMh2Wun; 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 h63sor22707076pjb.6.2019.07.15.11.22.05 for (Google Transport Security); Mon, 15 Jul 2019 11:22:05 -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:90a:b394:: with SMTP id e20mr30483168pjr.76.1563214925619; Mon, 15 Jul 2019 11:22:05 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.22.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:22:05 -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 13/15] arm: include: rockchip: Move dramtypes to common header Date: Mon, 15 Jul 2019 23:51:08 +0530 Message-Id: <20190715182110.21336-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=VMMh2Wun; 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: , dramtype enum numbers as common across all dram controllers in rockchip, so move the eneum values in common header. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram.h | 6 ------ arch/arm/include/asm/arch-rockchip/sdram_common.h | 8 ++++++++ arch/arm/include/asm/arch-rockchip/sdram_rk322x.h | 7 ------- arch/arm/include/asm/arch-rockchip/sdram_rk3399.h | 8 -------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram.h b/arch/arm/include/asm/arch-rockchip/sdram.h index bbe425deb9..9220763fa7 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram.h +++ b/arch/arm/include/asm/arch-rockchip/sdram.h @@ -8,12 +8,6 @@ #ifndef _ASM_ARCH_RK3288_SDRAM_H__ #define _ASM_ARCH_RK3288_SDRAM_H__ -enum { - DDR3 = 3, - LPDDR3 = 6, - UNUSED = 0xFF, -}; - struct rk3288_sdram_channel { /* * bit width in address, eg: diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 82ce3d3fc9..55abcdae77 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -6,6 +6,14 @@ #ifndef _ASM_ARCH_SDRAM_COMMON_H #define _ASM_ARCH_SDRAM_COMMON_H +enum { + DDR3 = 0x3, + LPDDR2 = 0x5, + LPDDR3 = 0x6, + LPDDR4 = 0x7, + UNUSED = 0xFF +}; + struct sdram_cap_info { unsigned int rank; /* dram column number, 0 means this channel is invalid */ diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h b/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h index d0091a7aaf..336c5d7e8c 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk322x.h @@ -7,13 +7,6 @@ #include -enum { - DDR3 = 3, - LPDDR2 = 5, - LPDDR3 = 6, - UNUSED = 0xFF, -}; - struct rk322x_sdram_channel { /* * bit width in address, eg: diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index 65c92cf744..471702f935 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -6,14 +6,6 @@ #ifndef _ASM_ARCH_SDRAM_RK3399_H #define _ASM_ARCH_SDRAM_RK3399_H -enum { - DDR3 = 0x3, - LPDDR2 = 0x5, - LPDDR3 = 0x6, - LPDDR4 = 0x7, - UNUSED = 0xFF -}; - struct rk3399_ddr_pctl_regs { u32 denali_ctl[332]; }; From patchwork Mon Jul 15 18:21:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 728 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B4D573F0E1 for ; Mon, 15 Jul 2019 20:22:10 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id i2sf10723177pfe.1 for ; Mon, 15 Jul 2019 11:22:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214929; cv=pass; d=google.com; s=arc-20160816; b=YuMOWJXImZMfbgFJvJv9jU9MIwe5oWCEeqJQiayTA6VRUNGfxb+bSa/SbZsiHlonfG PA46HslGKYkCJUtrVY4pfUE4LYoxK/Ur1J49/Q22MyBdiuvMGgIzWrRfRYR9nF34N03s fJ2Dsyzgr8DM1XCa11tSO8yvxjaHA+V0zsPJHcxAETVbHRvxhkKwNf9C4hgxYfWG8Kbq SS2m2LMCafmtrejoPol6GT51ob/rserp6ImjnHTjHkySlOd+aSEp+xUMzoFCVhV9CXxL 72od9/J1fJXlZLNDHHcr8q/N4NJcU8KOPky81bwwJkUj5D4B9xOa444XxzGWijlasd6r a9uQ== 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=d+6FJWK++ssNdtOwC8kNoWVBNBFrxM4EK9RHly6oRlI=; b=dx2ou4/2Fv2sVUynSw68Et2WnKrbnw7sQCMEfmeYOQiWUyrGtvIouxlBWBSVFZTNOO Wf7Aytld6AyEclUlIyNQhSglYE0CnlvexeFDJaC60Pojd2wSLGXgzwwl962p4QOyaToI Pt14i/C1/1SqNb7fwoufhKH4AZzxnokjIixdqeRshNBKRQni8K283ydace0hPq3i9Nzy augPhOivbRei21aSQ0751pqUpZR4b6j/OXJTLnpYy3HiIDEKUj8JPqOM7PtJx+F3GqEU RL8y+MlAgk0XUxBW6Cp9qMpQlYY7eYmf9RXRttNbPEPJo/70mC39fN8gOvVB7gzFX4vM IMfw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hRAkPB+7; 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=d+6FJWK++ssNdtOwC8kNoWVBNBFrxM4EK9RHly6oRlI=; b=knwZoOapNSuE+ViVgBT0xyqeohJFbT7lHjEyWOq4ic+YC6JwkSXVRW8G8t/N97EpLL s6L7O+D4bnv/KndBAyQkPGLZHSLTNuwjMGtMdmiHkkBdc8jkIz3rOIQM1nFbGItM+v8B OjICtXKt4e8fQl1NOZDx23dEYlbvat37saPYI= 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=d+6FJWK++ssNdtOwC8kNoWVBNBFrxM4EK9RHly6oRlI=; b=RY5OP9ouPjyW3o7u7CcBMA5J8IErMIhg0aPb8ai6D7xY6mPOPLEKtCNSp+tidIgJua jlU+/mtnDtK2izAWg0jnwww+X9ttTiruaW7omXNYuQUV06S9432cZ6TVZRnNNXGUR4mb 0Pyj22QykmpMJTKPAqZEGVQTg9IlRUtZDJSop2KWNufa5xfuNxFXL/cJ9drc1fe8bdj5 WUzBCM8G/KspvgTJTcUkInPDS4J7B2TkfLOZDjGRAVy0BPCtEekgPmBYsX9sAGYR6GZU d6XR4POXAFIE9myyLL92gyEMa5Hmn9n1T8CdU2AbSIxc4AifEGh6wtk/jg39Rd7K5qDs /exQ== X-Gm-Message-State: APjAAAXyMEDbgtX8ID3MeCrLuxqSReHvVAKb+iQSZzVi3OY1oWjBp7Fd q36CXtUzgG2+O2fuP83Ymi8ITYCW X-Google-Smtp-Source: APXvYqyvITAb785Gc3+5/+NTVnJarFB/XFHNM7yeGSTRBLL9AhY6DuWKoMlfA+HAWLtf301E/vge/A== X-Received: by 2002:a17:902:9b94:: with SMTP id y20mr29823121plp.260.1563214929620; Mon, 15 Jul 2019 11:22:09 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9684:: with SMTP id n4ls4716397plp.2.gmail; Mon, 15 Jul 2019 11:22:09 -0700 (PDT) X-Received: by 2002:a17:90a:1a45:: with SMTP id 5mr31460356pjl.43.1563214929298; Mon, 15 Jul 2019 11:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214929; cv=none; d=google.com; s=arc-20160816; b=GulT++vdooUD9PteMSVHGjyGAb/lt3/jIdpqvwp6VWAuVdAK17ilmtzNpCRZ8Jm4Nz CHnZKBzUYwtvmRwfW87DfYpRQ6XqYF77+Y6bB732hZ+NHLd1p5JiDYaq0srFIZv8B5aW 83zjBM8jNW0Fov/gyT/zTj75B5X9akuDv0/aF1DEonSRVrAjq5sNWxswm3+HyzhcXZYJ HRT0dslTDQNXv3NCw9EXyFUw9lgKMckYY4zklayxlUlFW7bT9Tcevq1HtgWIDgXwc4+c imAcsDU8eeEbU9IS530SJPV1CpxWCd6QF5d2bWBDfmxOSwU5piIooqNdT7RzjkH+JGVV o0UQ== 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=5Fw++nmbb4WyxKfVf62oDVeir0dauMI5LkgU071iwqA=; b=dUv3zhxBrvDyU4MJZJaEPKWPBpDaY1miN8PBmZTwMxz7SKDzPm7TrEMDF7EUr4kRYH XDlolI1HLkvgj/UPTiXCKinJnd52cqFSekro+r1p8gi2ekjvJC/Z6WkQCbHfNjyLjxLQ VGcZlqirRPRejRcund+WfUUEUIEa9+TyBM1AoT8mz92yaUMvLo73z2wUfVoNVoZJ6ml/ hVCwQr+GdxtLHIao2kOi3lHrmcxNRkzyD8NTGLISHIJpCrnDrud7hOLvmMf7kLXF2cCE TlUlO4FyL+Kabel8KabHOq5b+e9dfcnTJMSkU3ssmaC/2bC3TXArwLf3moXvJN2padhS gLaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=hRAkPB+7; 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 o11sor21333035plk.18.2019.07.15.11.22.09 for (Google Transport Security); Mon, 15 Jul 2019 11:22:09 -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:1101:: with SMTP id d1mr30136700pla.212.1563214929026; Mon, 15 Jul 2019 11:22:09 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.22.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:22:08 -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 14/15] arm: include: rockchip: Add DDR4 enum Date: Mon, 15 Jul 2019 23:51:09 +0530 Message-Id: <20190715182110.21336-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=hRAkPB+7; 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 DDR4 enum number in common header. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 55abcdae77..7ac25af327 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -7,6 +7,7 @@ #define _ASM_ARCH_SDRAM_COMMON_H enum { + DDR4 = 0, DDR3 = 0x3, LPDDR2 = 0x5, LPDDR3 = 0x6, From patchwork Mon Jul 15 18:21:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 729 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4B7F63F0E1 for ; Mon, 15 Jul 2019 20:22:14 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id d3sf10959056pgc.9 for ; Mon, 15 Jul 2019 11:22:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214933; cv=pass; d=google.com; s=arc-20160816; b=CWJ6d9je5slTPi/xZItmRu9st949jLq5+KpxR5M4hHYzBxJCngiYbaDhD9Mv11V1zn OQ+oxRzfvATCpq+cX/jH5Ybbqd9ApR/mkYCrT2ZmY7QGHJREyhYrkHzubxMBc153RrVg QXnJKZKDeBh67aFrP7dewI52cCkt3R0LewRoSHu+Lli4cA8TGLsrFrCbVzfGAkDdka1v 4nGDJAl6Ur8KJHvuTUgr6wLNkz5E/NREd1/gxciQ8BSKQec5cqJpcvYV9QL/iHFwW7F/ lsnImnf3DTe/5lFub09EjcKsOLlobJSFmi6w/dyVrnGj6Jro1szFyXlWa/vKQTktENJm UlZA== 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=F5mwDD3sBkpkDX77l5WXTAqoT52v4YLO8/5fyfm+9n8=; b=l2KJUgZV/1H5RtVJbrpnrZgGHaqUJAdHtQxfQ61iKkvVCdV8OLTCkrXotFtIGTG85p 09Hi4GFtdtJhajqoCYsUM5y2/w9oRBhdBv2THALshthWwv9Pzjyt+lI8VihTC6CWOwkv RKg5AsO4pjm4EyyaV1Cwtws4iXRP73wro7Pr1XDzaEKHu9nsoLol61l08R7dmuDsJycs 1NlTVrdffE/6JDEQKkyeBEaQgBnkNvsdPAOvfVLI55ua5hnnXOnQzRGN4xmcByZfQKqT 87Ayz4GCER35M6NJKvWP4JTaQJL9tDaWTTl/PNrEaq4BjAcC6Ei3DTu3UJvlLKwYEXxp weog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gMxdg588; 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=F5mwDD3sBkpkDX77l5WXTAqoT52v4YLO8/5fyfm+9n8=; b=SLU7PV/I9JdRSEOlr0x251IOMQhTH1Y8NEjmPFYoYTnXih3SDPIV0eT+cLyfSNsg9e c5lwXSDBQ1hWZOKeJrYH8h60Ex2i1Eh8L90kqS0Gi6XFoNHk2U+KCIlFWBVuR5VVsU/N kAUzAotiHcDl2Mn5ZFd3xoGaT81WGlvTnVemA= 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=F5mwDD3sBkpkDX77l5WXTAqoT52v4YLO8/5fyfm+9n8=; b=irCilrViTIGxviuz6FsKavCZRBqayla9xqMZONmE0a2AEifHRBZiDbcdukthe+kxTd UMpOl5ojqtbCb5NSqg+zSTuT+wMCra5V3Zk5YwjDh6W7CAEr+RJl3vy0krnidCcc4tpy B1Do+AjtA/vASmolHNkT4tk7mnk80y29J4kyLkTki+2SfE2zPX653Ikgv26u4H3WvqoT bfMoQOyyYp6MX1iU89wz+ewc74sQ/9d9tsnBN9fD5v/elDdihJQDm2wSRtG2EHlT/c0W fuHsWOm4AuVLT3i85Tw+kf9bbnEU2dL6mNssSpPpISr4lCOQ32HAwXY8lsktpEAjiWqs d67Q== X-Gm-Message-State: APjAAAU7VdF0w0xp/k8PsJ/Y/I3br2OKhNIdfM5v/l0lTIuwzo8xaN8i TxtBn4G8bPcrdJWLqROotlJEeuIV X-Google-Smtp-Source: APXvYqw4IyFks4sGX6rxkY4p8m9w0O9pMqPCmPEA1lQWsnOgP6SyagMn6ZtB0gfMPW8YKP4Jrr42dg== X-Received: by 2002:a17:902:b608:: with SMTP id b8mr30304943pls.303.1563214933096; Mon, 15 Jul 2019 11:22:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3662:: with SMTP id s89ls6196762pjb.1.canary-gmail; Mon, 15 Jul 2019 11:22:12 -0700 (PDT) X-Received: by 2002:a17:902:1101:: with SMTP id d1mr30137000pla.212.1563214932722; Mon, 15 Jul 2019 11:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214932; cv=none; d=google.com; s=arc-20160816; b=holVlfM54wSCHqjwtewN47Hnu7GgEluEpTmTIRxCS4iwn7UjXElpyt9r9XjfhFH0dv u1J7PqwZi1joGh7+ZFNrDSBOEmMGMcHD/kYoa9eX9aWctopCGZGRIx+gCez9l/hDi8za Zr0v0fiKYdDKLof1HeIu7U/KqTid6lPhYw9Bvm8xNFM7VcJcF6Cl/+fM2AIr5Aqmu2LK qagWLWigUH8HJ0eQ07/W7LguyqUysb+wuLQt5FQwIxnB0bkUNvrcEVoD+AEaoBE2j4m8 qLlOHstXKNvs4KP4d7X9N7YqY07HmYIJeS+MVSypr53Gm9wo3Zzh9cssB/XQExhR+S1k v0nw== 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=jYVJfJji5VncNUtRfq/ZDyMh3tw9MhBZTI5H0xl5J+I=; b=JXVvJz5RhwXRVvvZSE6f5Du/pcToJEeWsDKVd2MkbiJBA7SJa/rRoRlaxap1JAJjA/ xVZImrGdGIzfwxmIlmIfjScvVJLbKg3b71rrD8ocKwcs/31UM82rQ7LC6aTTl8+Zdlyn sXByxestXowEqlbsroYWE3j3xIX+YSI7PNWcRXpdLs+J5kET15aK2n6vl92+XIuLbD8p g8LpaKDTwi4u7vYod8SSmUHB7hKdPOY8vZH0SiUK6lIU4kpi7/zGJGAeHrHp8jXVqRLp tfRmj1+aqxLe1L6LYRZhXXt8xSU2mwYU0ohuq7AWrEzJT28jHq+qNK/cud2QxRG+CwBi LemQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=gMxdg588; 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 e79sor9446295pfh.26.2019.07.15.11.22.12 for (Google Transport Security); Mon, 15 Jul 2019 11:22:12 -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:d448:: with SMTP id i8mr9009773pgj.173.1563214932294; Mon, 15 Jul 2019 11:22:12 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.22.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:22:11 -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/15] clk: rockchip: rk3399: Fix check patch warnings and checks Date: Mon, 15 Jul 2019 23:51:10 +0530 Message-Id: <20190715182110.21336-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=gMxdg588; 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: , - CHECK: spaces preferred around that '*' - CHECK: spaces preferred around that '/' - CHECK: space preferred before that '|' - WARNING: macros should not use a trailing semicolon - CHECK: Unnecessary parentheses around 'fbdiv <= min_fbdiv' - CHECK: Unnecessary parentheses around 'parent->id == SCLK_MAC' - CHECK: Unnecessary parentheses around 'parent->dev == clk->dev' - WARNING: line over 80 characters - CHECK: Prefer kernel type 'u8' over 'uint8_t' - Add proper macro definitions arrangements Note: there are still line over 80 characters and other warnings but fixing those making code look unreadable, so I kept it as it is. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/clk/rockchip/clk_rk3399.c | 68 ++++++++++++++----------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c index aa6a8ad1c9..5d1ad94e85 100644 --- a/drivers/clk/rockchip/clk_rk3399.c +++ b/drivers/clk/rockchip/clk_rk3399.c @@ -38,8 +38,8 @@ struct pll_div { }; #define RATE_TO_DIV(input_rate, output_rate) \ - ((input_rate) / (output_rate) - 1); -#define DIV_TO_RATE(input_rate, div) ((input_rate) / ((div) + 1)) + ((input_rate) / (output_rate) - 1) +#define DIV_TO_RATE(input_rate, div) ((input_rate) / ((div) + 1)) #define PLL_DIVISORS(hz, _refdiv, _postdiv1, _postdiv2) {\ .refdiv = _refdiv,\ @@ -53,15 +53,15 @@ static const struct pll_div cpll_init_cfg = PLL_DIVISORS(CPLL_HZ, 1, 2, 2); static const struct pll_div ppll_init_cfg = PLL_DIVISORS(PPLL_HZ, 2, 2, 1); #endif -static const struct pll_div apll_l_1600_cfg = PLL_DIVISORS(1600*MHz, 3, 1, 1); -static const struct pll_div apll_l_600_cfg = PLL_DIVISORS(600*MHz, 1, 2, 1); +static const struct pll_div apll_l_1600_cfg = PLL_DIVISORS(1600 * MHz, 3, 1, 1); +static const struct pll_div apll_l_600_cfg = PLL_DIVISORS(600 * MHz, 1, 2, 1); static const struct pll_div *apll_l_cfgs[] = { [APLL_L_1600_MHZ] = &apll_l_1600_cfg, [APLL_L_600_MHZ] = &apll_l_600_cfg, }; -static const struct pll_div apll_b_600_cfg = PLL_DIVISORS(600*MHz, 1, 2, 1); +static const struct pll_div apll_b_600_cfg = PLL_DIVISORS(600 * MHz, 1, 2, 1); static const struct pll_div *apll_b_cfgs[] = { [APLL_B_600_MHZ] = &apll_b_600_cfg, }; @@ -393,7 +393,7 @@ static int pll_para_config(u32 freq_hz, struct pll_div *div) fref_khz = ref_khz / refdiv; fbdiv = vco_khz / fref_khz; - if ((fbdiv >= max_fbdiv) || (fbdiv <= min_fbdiv)) + if (fbdiv >= max_fbdiv || fbdiv <= min_fbdiv) continue; diff_khz = vco_khz - fbdiv * fref_khz; if (fbdiv + 1 < max_fbdiv && diff_khz > fref_khz / 2) { @@ -409,7 +409,7 @@ static int pll_para_config(u32 freq_hz, struct pll_div *div) div->fbdiv = fbdiv; } - if (best_diff_khz > 4 * (MHz/KHz)) { + if (best_diff_khz > 4 * (MHz / KHz)) { printf("%s: Failed to match output frequency %u, " "difference is %u Hz,exceed 4MHZ\n", __func__, freq_hz, best_diff_khz * KHz); @@ -489,28 +489,21 @@ void rk3399_configure_cpu_b(struct rk3399_cru *cru, } #define I2C_CLK_REG_MASK(bus) \ - (I2C_DIV_CON_MASK << \ - CLK_I2C ##bus## _DIV_CON_SHIFT | \ - CLK_I2C_PLL_SEL_MASK << \ - CLK_I2C ##bus## _PLL_SEL_SHIFT) + (I2C_DIV_CON_MASK << CLK_I2C ##bus## _DIV_CON_SHIFT | \ + CLK_I2C_PLL_SEL_MASK << CLK_I2C ##bus## _PLL_SEL_SHIFT) #define I2C_CLK_REG_VALUE(bus, clk_div) \ - ((clk_div - 1) << \ - CLK_I2C ##bus## _DIV_CON_SHIFT | \ - CLK_I2C_PLL_SEL_GPLL << \ - CLK_I2C ##bus## _PLL_SEL_SHIFT) + ((clk_div - 1) << CLK_I2C ##bus## _DIV_CON_SHIFT | \ + CLK_I2C_PLL_SEL_GPLL << CLK_I2C ##bus## _PLL_SEL_SHIFT) #define I2C_CLK_DIV_VALUE(con, bus) \ - (con >> CLK_I2C ##bus## _DIV_CON_SHIFT) & \ - I2C_DIV_CON_MASK; + ((con >> CLK_I2C ##bus## _DIV_CON_SHIFT) & I2C_DIV_CON_MASK) #define I2C_PMUCLK_REG_MASK(bus) \ - (I2C_DIV_CON_MASK << \ - CLK_I2C ##bus## _DIV_CON_SHIFT) + (I2C_DIV_CON_MASK << CLK_I2C ##bus## _DIV_CON_SHIFT) #define I2C_PMUCLK_REG_VALUE(bus, clk_div) \ - ((clk_div - 1) << \ - CLK_I2C ##bus## _DIV_CON_SHIFT) + ((clk_div - 1) << CLK_I2C ##bus## _DIV_CON_SHIFT) static ulong rk3399_i2c_get_clk(struct rk3399_cru *cru, ulong clk_id) { @@ -597,9 +590,9 @@ static ulong rk3399_i2c_set_clk(struct rk3399_cru *cru, ulong clk_id, uint hz) */ struct spi_clkreg { - uint8_t reg; /* CLKSEL_CON[reg] register in CRU */ - uint8_t div_shift; - uint8_t sel_shift; + u8 reg; /* CLKSEL_CON[reg] register in CRU */ + u8 div_shift; + u8 sel_shift; }; /* @@ -678,7 +671,7 @@ static ulong rk3399_spi_set_clk(struct rk3399_cru *cru, ulong clk_id, uint hz) static ulong rk3399_vop_set_clk(struct rk3399_cru *cru, ulong clk_id, u32 hz) { struct pll_div vpll_config = {0}; - int aclk_vop = 198*MHz; + int aclk_vop = 198 * MHz; void *aclkreg_addr, *dclkreg_addr; u32 div; @@ -710,7 +703,7 @@ static ulong rk3399_vop_set_clk(struct rk3399_cru *cru, ulong clk_id, u32 hz) rkclk_set_pll(&cru->vpll_con[0], &vpll_config); rk_clrsetreg(dclkreg_addr, - DCLK_VOP_DCLK_SEL_MASK | DCLK_VOP_PLL_SEL_MASK| + DCLK_VOP_DCLK_SEL_MASK | DCLK_VOP_PLL_SEL_MASK | DCLK_VOP_DIV_CON_MASK, DCLK_VOP_DCLK_SEL_DIVOUT << DCLK_VOP_DCLK_SEL_SHIFT | DCLK_VOP_PLL_SEL_VPLL << DCLK_VOP_PLL_SEL_SHIFT | @@ -750,7 +743,7 @@ static ulong rk3399_mmc_set_clk(struct rk3399_cru *cru, ulong clk_id, ulong set_rate) { int src_clk_div; - int aclk_emmc = 198*MHz; + int aclk_emmc = 198 * MHz; switch (clk_id) { case HCLK_SDMMC: @@ -776,7 +769,7 @@ static ulong rk3399_mmc_set_clk(struct rk3399_cru *cru, break; case SCLK_EMMC: /* Select aclk_emmc source from GPLL */ - src_clk_div = DIV_ROUND_UP(GPLL_HZ , aclk_emmc); + src_clk_div = DIV_ROUND_UP(GPLL_HZ, aclk_emmc); assert(src_clk_div - 1 < 32); rk_clrsetreg(&cru->clksel_con[21], @@ -834,23 +827,23 @@ static ulong rk3399_ddr_set_clk(struct rk3399_cru *cru, /* clk_ddrc == DPLL = 24MHz / refdiv * fbdiv / postdiv1 / postdiv2 */ switch (set_rate) { - case 200*MHz: + case 200 * MHz: dpll_cfg = (struct pll_div) {.refdiv = 1, .fbdiv = 50, .postdiv1 = 6, .postdiv2 = 1}; break; - case 300*MHz: + case 300 * MHz: dpll_cfg = (struct pll_div) {.refdiv = 2, .fbdiv = 100, .postdiv1 = 4, .postdiv2 = 1}; break; - case 666*MHz: + case 666 * MHz: dpll_cfg = (struct pll_div) {.refdiv = 2, .fbdiv = 111, .postdiv1 = 2, .postdiv2 = 1}; break; - case 800*MHz: + case 800 * MHz: dpll_cfg = (struct pll_div) {.refdiv = 1, .fbdiv = 100, .postdiv1 = 3, .postdiv2 = 1}; break; - case 933*MHz: + case 933 * MHz: dpll_cfg = (struct pll_div) {.refdiv = 1, .fbdiv = 116, .postdiv1 = 3, .postdiv2 = 1}; break; @@ -916,7 +909,6 @@ static ulong rk3399_clk_get_rate(struct clk *clk) case SCLK_UART2: case SCLK_UART3: return 24000000; - break; case PCLK_HDMI_CTRL: break; case DCLK_VOP0: @@ -1014,7 +1006,8 @@ static ulong rk3399_clk_set_rate(struct clk *clk, ulong rate) return ret; } -static int __maybe_unused rk3399_gmac_set_parent(struct clk *clk, struct clk *parent) +static int __maybe_unused rk3399_gmac_set_parent(struct clk *clk, + struct clk *parent) { struct rk3399_clk_priv *priv = dev_get_priv(clk->dev); const char *clock_output_name; @@ -1024,7 +1017,7 @@ static int __maybe_unused rk3399_gmac_set_parent(struct clk *clk, struct clk *pa * If the requested parent is in the same clock-controller and * the id is SCLK_MAC ("clk_gmac"), switch to the internal clock. */ - if ((parent->dev == clk->dev) && (parent->id == SCLK_MAC)) { + if (parent->dev == clk->dev && parent->id == SCLK_MAC) { debug("%s: switching RGMII to SCLK_MAC\n", __func__); rk_clrreg(&priv->cru->clksel_con[19], BIT(4)); return 0; @@ -1049,7 +1042,8 @@ static int __maybe_unused rk3399_gmac_set_parent(struct clk *clk, struct clk *pa return -EINVAL; } -static int __maybe_unused rk3399_clk_set_parent(struct clk *clk, struct clk *parent) +static int __maybe_unused rk3399_clk_set_parent(struct clk *clk, + struct clk *parent) { switch (clk->id) { case SCLK_RMII_SRC: