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" }, { }