From patchwork Mon Jun 17 07:31:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 572 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 287793F072 for ; Mon, 17 Jun 2019 09:36:25 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id d2sf5504676pla.18 for ; Mon, 17 Jun 2019 00:36:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560756983; cv=pass; d=google.com; s=arc-20160816; b=cBTxtFtVny+IZPczIMyQgmRkTrj5ukVM6K/5d/V4mwBYWvE1DydZrH6zYNLm7/CJIJ cQM0i0oZ/nmIVXrEx6Y857hbvJD0QkSpy0h1JRVQfC7n1RTbJ/EIOrxPxQi/xiuy4q+J mpZMtyvySnuX+x9Xkbq+GSgeZwyfuLiC+KcPpFx4ru1jRkFo/qZR+L2Srv0G3cMPpQx7 9xrZybAEYlcIXAPI92cN6cCrAdXEnnzC88sFi9uJGftuZfZ2lrCPb6sYkr8tYP+BoXWO YGPky+efvRybQB5sy2Phn1tgSaZM3WQTG/vZHEorxN7RVu4fsxfBfnO5eFSLjwXKS/8e gAOg== 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=NTzXDlsD5RWvIiJzXPneXWr2qF7Hh++hfnEiDZHjD8l1nvwTCkbC0VbQuwaLGMfqJJ mVOfLkrHdU6XNxdbpBXvsErmRHB1mQZY+rrfy9/Gw8qv0oXiW4x8r0vaeldULq8SWK9B 1WprOlgchA/lRVYdMLTilfJBClgtvRl+EoeqzhNxtJtkxAnmFw/KA6gunWhYanRlC808 WocjVqfgiSajLuSjIvypA/CM/HHh5z54P/LOQSWJ92iZeuo3mC9xQz/zES02A7n3a08r x1TglBDsP6P4/Z8UESJQ1OiIuFI8ovpauuSg+IJ3osXfujJmlUZGFW/3L1YItqwD50zp rweA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ECUkRAqL; 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=ip9UhZ5jPKMqTumThOS5RW+f21dXgck5ysK26wMDjzkBWCI/1XLbC1SfhUzh/LEjta TCayecYT/Vil7dDfWRO272j06ymZZ3tdJptegmMqpZ3GMF4FzPnj9kaUygM8mr2cHUNA 7yQGuoVtUbJQ+27gG6JbHGCzBS7pQVjHN+nH0= 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=IHmhy96sHm7HyDyw5LPq6kL6dA40fUhKqQMPg6KyPTBk8HRedtupD+vvnnhl+Zq+Fx rJTvPPtdzcm+UFCgDoGLbw9NklcmxAfXjwQoRLvtjTJD0ABDssSEUGCPo1OCsaxP9bin LO38qjYd20EbGoiGDPLqz4arth9sI27GGYjNcmbBahPccPkmlNDWUVSbaPC4Ciu2IDqE IUFO1zpx6NiNkS3M3Ms1dxhZlfX5IJ6o3x4lxV/yeSIGAc+ch2QbNNH0E+zYzDdwKcMS a+JXecaYYHcKGLKKJQo81zTx2DJJIlIU18CYcm2gYPU0/bW1luikxIE+WJ9JYst6HlKy RjEw== X-Gm-Message-State: APjAAAX7EbbUKrSoCERtyeqjAOurY79Bf3DsL8sXY+NgPYQjd0/uVtro wmT3I1Z9EoVGPTy9QFmA9PrceS1x X-Google-Smtp-Source: APXvYqx6aOGervNXjPKivvBMKcqH1hXwkG4s6ZRoJEUH136S0q0jjYnLLDVbFiSfPe4triyr82c7cA== X-Received: by 2002:a17:90a:32ed:: with SMTP id l100mr24520032pjb.11.1560756983572; Mon, 17 Jun 2019 00:36:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2704:: with SMTP id o4ls3977232pje.4.gmail; Mon, 17 Jun 2019 00:36:23 -0700 (PDT) X-Received: by 2002:a17:90a:35e5:: with SMTP id r92mr23015361pjb.34.1560756983197; Mon, 17 Jun 2019 00:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560756983; cv=none; d=google.com; s=arc-20160816; b=qRmDVN5zQe7weGQBb9gVIl7KEx1VbbosPP/j1VHZn2fhEr8H3dA6XdKEcxZnZff+QU Ij97WGaWKbnSPquHfWFeAdoKT/xaE+7m6Pros+s7fY+CY5t+7h/f0WQGHVl2PqII69wB ag6pWxZ4Ca0G/eBZPtPLRFOlZYcr9lTFGmG1Rl65Pep+VnLYWqh76k7gt3shqagBt/cm IB9TQ/P2sHsdQzevfVanTiD4PYT9Xk9O5u+6Cr1VTQhSzhM8M/6QV1wtlMd8/00f0mhS 9H7cgMKK2BBCjA4D3tMPd7Kcr0PLexLkgP5VrLO8flS4JDN+7L8xW6B5HAR9GLwZRjOe mRfA== 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=Gdfo3frHAFS99lk7ZLi5cz/MtpUf/flmEQQXpcKgsSqNDcmxoEWNeu2O4GP2e59PC3 RwjDIzzyGmkjO3xK+dy0mBKtMUQ9MJbTkODH78MDa4ozsq2Jhd6grpzAljBk1A/AQYGv ZQKCNlJf4KTi4ObfTYDkPlGCVaf17hwHTSEgd3ISyfkUhXcK9seLA7pWDJ8QCKXzmG88 HZ135DVfJ0s455FU0sF9lpfFO8ysXccMiUdP4BRkpBCq6htl4PimTAXFiILq40CCfQKG kwdllRP8X9xNyWi+aJfdsO/DQwtLOH5roBZZHib1DcQdKijYNU72m5mxs2I3xIULPfIv qrkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ECUkRAqL; 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 go5sor12590607plb.37.2019.06.17.00.36.23 for (Google Transport Security); Mon, 17 Jun 2019 00:36:23 -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:24c:: with SMTP id 70mr105866615plc.2.1560756982895; Mon, 17 Jun 2019 00:36:22 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.36.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:36:22 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: Manivannan Sadhasivam , gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 01/99] ram: rk3399: Fix code warnings Date: Mon, 17 Jun 2019 13:01:14 +0530 Message-Id: <20190617073252.27810-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190617073252.27810-1-jagan@amarulasolutions.com> References: <20190617073252.27810-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ECUkRAqL; 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" }, { }