From patchwork Tue Jun 11 14:51: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: 511 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 1D5173F08A for ; Tue, 11 Jun 2019 16:55:52 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id d125sf9786054pfd.3 for ; Tue, 11 Jun 2019 07:55:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264951; cv=pass; d=google.com; s=arc-20160816; b=M1o9G0ixGmyWgDgO+P/qF1OqKX7fduOAYIKKE9Sqcbf4eVS/WimyrMICf7NYY2S85q 8PU+X7UMDQ3UtlUqWYmyKcGK2xfjkJWxNeuCdV3nWO7ptOuBqKPMZ+4kNGliUt61QeRe AqhcyA5ae5a60FzEBeTAFB1SUjcayy4vajZYWFLQ0/+pagzGpKOR4MW6Y+j2TUvjafQe g8mugZ7WaiRvAFuGEe4bUr9Hm0kGJWnwW2xMETFrut4vWrE+eoKNPM5rl70IDhRyRB/8 q6Nlg68bTP7gPgRa9o3STZhDfxZ09OGalLyiylInIP21MGNqPVljKLRgbqtpm2ef6B97 IlgA== 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=hBeEhiCEhJd0uv3jN+VhK5US3HPd4aKz+zpcyK1ZcrY=; b=yzj0OPzbQJ2PBAuS7tRMUqk2v33EjVlLQoSUynDQ5pTYkvopBqogu/aq0m9HJs/OcL +pZsCV0Cysa2v7ir9n+H9mbsx98+SpalV3ZeZ90f9YVWhAFRzjA6KeLuBEBzUaDocs9s cItQsyV0JkubfMmj0gG9wC8MHCy+GPjpVWNKUYjjMqkbv1O2FCuVqPMiKaKaWbtvTaHu 26Dldtd9tD6Ep+78/2pb/sYr7SRcCXC8fblMQ1LD/iH7atvPJBvi8TESTcTyar0opY8q 38rO3eI7EgJ6pYFUm0l63D4+H9D5bPiITKRTJ9daz8Pgv8rbK4wMBB5441tQLW32uGZo jsng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ep8QmzA4; 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=hBeEhiCEhJd0uv3jN+VhK5US3HPd4aKz+zpcyK1ZcrY=; b=dLpFWfXyW9vmzVID/zMVUQg721ZALmSEbfSGe6MLZiMxurpPELLwZanzLt/bikGvdL mDH9lIF/uSb87Z8gAebaX9qIyP1e1DTJxAMirryDxXoT0/x/SSLeJSjX1HB+MWJwcFiw u8ya11lf0XolYMhQ7HgTVuX058FUz9841Jnso= 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=hBeEhiCEhJd0uv3jN+VhK5US3HPd4aKz+zpcyK1ZcrY=; b=G73qlCeB2RjEHiB0Uhph7C687YZcIjrxx1z/fEPAmBEtI1nNO2pQfOuY5hIbzlCxj4 asDdJRcn18LhssW/H43A9DR3hxzlCRu61UlwtE6F+4Fu//nHNNMGBwNkMx94AfKt90XU 08FEdmuqtX12r1iZbGrB40khnuXgvboH0xjyTcmusxYTNigX1ciR9INUVo1IbY0twtBQ D7+vUz2owDmwO8O+Cf6G1n58553hIYxSjvr5kjOokFGw4Adg4+gn4JC+zsVWfHJyj1B2 3KlhQfO1qnCuqLnGbIEA+9rmWHNfY8odUtyr4mfceicIlkvJPzu2jU2Z4h/+nZ7kIjkf j5Dg== X-Gm-Message-State: APjAAAU8iNp04CiRFtbqEzfOhBL34iTPB9DhmIcKE65ZQVB82dOwqtz5 TNpaXegVIUvsdjscU9RnVdNchvtd X-Google-Smtp-Source: APXvYqyQ0tp3CZBjFwI/IMyAAiCzTVJVMSKhwWX724OtzthuMKWF+iqw8ueHXVERM5TKLhRd43N/bg== X-Received: by 2002:a63:1650:: with SMTP id 16mr20779764pgw.164.1560264950851; Tue, 11 Jun 2019 07:55:50 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:2670:: with SMTP id l103ls859422pje.5.canary-gmail; Tue, 11 Jun 2019 07:55:50 -0700 (PDT) X-Received: by 2002:a17:902:8f87:: with SMTP id z7mr49766780plo.65.1560264950564; Tue, 11 Jun 2019 07:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264950; cv=none; d=google.com; s=arc-20160816; b=w0yMeRP1x68GUsOawt7cuCFQl/A92WvqdPiHPIVikh3zJMKa6YdABEqKPnhCVM24Dq nOUAmcpR3M10kI7WM1lY/Ufn7TI7w1MMsua0SyrWI9iOSDYQAbbtrWKSlmXqqYGvVShm w0Iqn2yP4tK6ZS+xXqyopxVgf0CWwOGGImGcqlhDm5SXGRLRKztGbmpJWcu3iCJe0UPY zwVbevJIMHgtj6FrIjgD6WfniqhokPHyfzUos0uAu3ALBkyYAA62eWHwJ4jHUoIUm0CJ yb+RPjvJpp6GuDQTSxqBOrs6k0njyZqwU5GkqxdoSsCoWC/x+8EPQF+of1y2YnhON99w YTMw== 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=pvtsocxqtDyRVeeeF9ZrknNra8/8DhlqqO3pIq4y19M=; b=UwA8nzGtIa/xLCuAJtIbeM/TmHgueScAh5opTlASeT1FfMfwH8w36fbmtTCqxHSR+i ZDXBlhLIcf+oh4q7ds9ztGZhi2fT+A+nfWcc8ZsKIjoW+05dPp8KAQwDqmFiIm1TTqzj N2urWBNBQFYeSt0rMv4Y03lIeswtz7kLoj8hpXxhwQiV2LY9A25tWBkLPLACWmImQhiU V4RcAvrNyuAUNfBHDczgIiVbWbpskVvghriIQafkaQy+DwyP9l+vmyXb3tvPfXWYeljY W6PHOP2bG0P+rhLKx524JL7VZNRHP/b2LFjA+1ChHvdrRj+dITkGXWGtvJiT9aiY4r+S H7Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ep8QmzA4; 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 b2sor15753478pls.45.2019.06.11.07.55.50 for (Google Transport Security); Tue, 11 Jun 2019 07:55:50 -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:70cb:: with SMTP id l11mr15504710plt.343.1560264950254; Tue, 11 Jun 2019 07:55:50 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.55.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:55:49 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 60/92] ram: rk3399: Move mode_sel assignment Date: Tue, 11 Jun 2019 20:21:03 +0530 Message-Id: <20190611145135.21399-61-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190611145135.21399-1-jagan@amarulasolutions.com> References: <20190611145135.21399-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ep8QmzA4; 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: , mode_sel assignment is based on dram type. In phy_io_config, already have vref setting based on the dram type, so move this mode_sel assignment on vref setting area. No functionality change. Signed-off-by: Jagan Teki --- drivers/ram/rockchip/sdram_rk3399.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index f80c8a424c..d399ec8e38 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -206,6 +206,7 @@ static int phy_io_config(const struct chan_info *chan, vref_value_dq = 0x1f; vref_mode_ac = 0x6; vref_value_ac = 0x1f; + mode_sel = 0x6; } else if (sdram_params->base.dramtype == LPDDR3) { if (sdram_params->base.odt == 1) { vref_mode_dq = 0x5; /* LPDDR3 ODT */ @@ -266,12 +267,14 @@ static int phy_io_config(const struct chan_info *chan, } vref_mode_ac = 0x2; vref_value_ac = 0x1f; + mode_sel = 0x0; } else if (sdram_params->base.dramtype == DDR3) { /* DDR3L */ vref_mode_dq = 0x1; vref_value_dq = 0x1f; vref_mode_ac = 0x1; vref_value_ac = 0x1f; + mode_sel = 0x1; } else { debug("Unknown DRAM type.\n"); return -EINVAL; @@ -293,15 +296,6 @@ 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) - mode_sel = 0x6; - else if (sdram_params->base.dramtype == LPDDR3) - mode_sel = 0x0; - else if (sdram_params->base.dramtype == DDR3) - mode_sel = 0x1; - else - return -EINVAL; - /* PHY_924 PHY_PAD_FDBK_DRIVE */ clrsetbits_le32(&denali_phy[924], 0x7 << 15, mode_sel << 15); /* PHY_926 PHY_PAD_DATA_DRIVE */