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: 10987363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9617114C0 for ; Tue, 11 Jun 2019 14:55:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 834DF1FE8E for ; Tue, 11 Jun 2019 14:55:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76BC6288AD; Tue, 11 Jun 2019 14:55:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BD2A27F97 for ; Tue, 11 Jun 2019 14:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6oAvvj1rRt7/erTpT8uVUVgafUvcnZyXMRNuUnM9P4M=; b=mBtIQNoU/iZZ8p t4nWvDpn9o2R1tsgQFuQbAnNQXKBB3j7h8kF8I2I936+au1W+fruM85X/advrnwdIMK3vekvcor7p TrA6qqWed0Cn+gnuHsIY0GEE+Tom5R+nprFNdwGNC8vXpzP1PBmfCSxDJmtqQrEX9WrwGRGbMYM8a p7H6Vx83g6CQHwaWXKW286LP19LxMyqdAMI2x+SKcw30U1khXpuGk4e8zy/y3KotWyDPmVbXEP0po J0sk8W7DWMmM6f7EQtwTfxkPmZ9lyCJKaMfG5w0EOkYCFVXls01Mb2uPVxvl9wr4i0dCYbBJ4PukZ Lykq8wwjeFzkE5BD/MLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haiBl-0007gM-KD; Tue, 11 Jun 2019 14:55:53 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haiBi-0007dp-P2 for linux-rockchip@lists.infradead.org; Tue, 11 Jun 2019 14:55:52 +0000 Received: by mail-pl1-x641.google.com with SMTP id g21so5254467plq.0 for ; Tue, 11 Jun 2019 07:55:50 -0700 (PDT) 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:content-transfer-encoding; bh=pvtsocxqtDyRVeeeF9ZrknNra8/8DhlqqO3pIq4y19M=; b=ep8QmzA4gQUa1LYC9JcQ+Ds7Okj0F1/BN/tbfgKCzMVlQMwDUaOi28p5TeW9DUmxaE VLkWuV9INsOjKEvlZT9iMJ/hXt+CfYwmj2XTRko4GXs2QfZw/7ndjbWrysXvnc2qQbSF HE/qVoeUFgHU6v0EtrRqluwDN1nF03Ysmp2Bs= 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:content-transfer-encoding; bh=pvtsocxqtDyRVeeeF9ZrknNra8/8DhlqqO3pIq4y19M=; b=rZoAOEWpZn6fwy6V2w9I39fQH9fhMq2AUrIMUMn18ECnNzjtFrb260ZtEGqblZsClo +eocG7xxV7IT7Wvd0He+6/Hkdap8y1YPWvf3SNlaEx2cCBp56wtUBTHpZH/pWvcHjGxK eAt22ndCxLiSfegTTdfeKCCb4r43PH5GgazQrgTpqbsenJV7QiRuOLnayEFU5hHWWYSU 2uu24agQrY1M4RgSi8VU2Eve/YHO+S+Ihti4zyJdGnvw1H/TNDMbuoP2hJ1d6Zcp3ItK CiN7c/JoSE3qM2XKd0ENBLbSJPcL/5pZbyuAGf8r1e/UYaxOP3hbImVgTUfXtvoPGr1d ndEg== X-Gm-Message-State: APjAAAX19tq1kRAivit+Q244YHYX9GWARtgiMcgJ1wqTFZ4AKA/AzhSH 37unfeZtH4pSBccNSV6OUjbTjw== X-Google-Smtp-Source: APXvYqza6DSmp9j2oLS6hjsl/cqWCKxG2VqDpZTIptVPx+s+YQll/kXz+UIMi0Amz+qEszRYTpZxQA== 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_075550_844220_50A15286 X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki , gajjar04akash@gmail.com Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 */