From patchwork Tue Jul 16 11:57:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 790 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 623F73F08F for ; Tue, 16 Jul 2019 14:00:24 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id b18sf12497620pgg.8 for ; Tue, 16 Jul 2019 05:00:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278423; cv=pass; d=google.com; s=arc-20160816; b=rlXpmpe8k9AmnJoHUud93N3B9hTtD79wo9oPgb2UPl82MR/dgQ2lR1XbKuC9EknaEg NAfa1X07hBwn12vewfzIjPZh1nh0lgVYSnFHu3FEtCLlvbGFrQFS5sp6hUr5lLIdyO7W 7SYYovOB7R0Q2tunShZnO7pZPpfpELlO8H9YNHr1p8c637A46qzY2/yoTGFjb+2WSZs9 mGtKv3u7xYACZToKz/jm3KluQYFw46fcpFjZHBzbV/3fbxP76GNCL+Ccip4v7o6sH0+U sNRy9Vza49P8obyE7B49ktIqqxPvQH9A3V493iTLQ4p4YPaH4PUvpWzY0O0QjaKfIOy5 5KNw== 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=SwKOYTRw/Iu7qgJ6NSXAP9k2VZvH/zsX/v34+m67bPc=; b=oqU4oNWZqolpPxXv6qYcJ78S6NicKFd7eFV1y9HjZn81opyQ1nPd5aRp+kHW8JXFAc WxnPaJjS5gr262EbhTtKRmxmXxjlouwV0i7sMWAX08CowbvRqrArJq9h7HxoqcgP3znd 5+xdflv+I0qm+nlZkPNXJ2tu1A1qDGoi52kFLS72DdOFQb/KEdACXbEcp56cc20vwZMv 8gdcZwtnA0M0gsF5g5Es98f3KPFVKT/4z3oIsllkjgSFTLEG3tEzz3a0ZdBqs9xtnJV6 UDhg3kYeMoS5DgU8DTnh7liwWmeLVROMpFl6DPcasL/zydD/+jMAZYbp30SsgMj+7nh0 KwCQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HYCN8itO; 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=SwKOYTRw/Iu7qgJ6NSXAP9k2VZvH/zsX/v34+m67bPc=; b=AndSOvsCDWLS4/jH32bs2Rj6DDx2ANY8Nk/t5YxZLOaQ+M/Mv19zihLloTEzwVFbOM 3VCe1A3NlG5ypju/yP21Gp7Uf+ezoB7xGWgN7bZ/vQJpoR86yDa5moBLtaiir7MFDOto C6PVklJzgu9K5mBGJqAu2CqKnNPis1KxWKpK8= 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=SwKOYTRw/Iu7qgJ6NSXAP9k2VZvH/zsX/v34+m67bPc=; b=FVKXBknGQDY39XYFPwVkedQxch/vmigC8KmM6pj2PTtZwEN+DXgI5yR2cRpXI+lxCH BLrbMCvqycewfQ97AJcT0Igk4ia/DpqoPNI24G2NPlHoHyWuSqmfVUgb+Qmx75cixl/X /todvnq8L+8HDsGPTBXI//4MPEtW8rjWE2bDUxhH40dF2ta0P5z3vYI/QkuIVbm3M9TR idJkada5aUoMboO6bF9Je4s4Z73QOm2fTnKLiNJolpGxg7DCNFOvnJ+AOLxUf3xsTkiS qhVRxAMtFapyLvkqezWrV6Nb2qOT2FOd8zHY0W+PJDElojfDzPnIMtGgk7YLBhF0XMGA GqWQ== X-Gm-Message-State: APjAAAVlSV2g573dgiDb1b0sSet1BGBNNtUfOvwVYB/eYnmDgMwfZAB4 dUlt42Sb/BHcPNHKi8sHGm4rxGnA X-Google-Smtp-Source: APXvYqweMG2LbdDeCp/ECKrV9zmYBCnHmjHUZ5lo+ZHDvX+iV2Kfs1G+L3/iRVF6+RSQwZtxKH2aBg== X-Received: by 2002:a63:204b:: with SMTP id r11mr33090117pgm.121.1563278423154; Tue, 16 Jul 2019 05:00:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9684:: with SMTP id n4ls5475686plp.2.gmail; Tue, 16 Jul 2019 05:00:23 -0700 (PDT) X-Received: by 2002:a17:902:b702:: with SMTP id d2mr35909700pls.259.1563278422878; Tue, 16 Jul 2019 05:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278422; cv=none; d=google.com; s=arc-20160816; b=MQEvwFNXZkLfKr9MiLyuk9/d/m8spoVtaeA0xrVUpvuAy+BOHgTZ1FfiwDRVCVjVJ3 QZ2LYbmWgoD6Yy9z7I9ludXkAGToQZ79A2cH65UCQxSFZZ2iMhYcFzcvfkiNcyr4FUzd pq5vZDfrKwn4FGwFObxM12AMv0BsBn4FGy3HHfby9/pp1Vzbc5Rb0QEsDUKNCJWEBUQc f2nQWd6rbvvqBN67BKB/qAq3HKmmDJ9uPGj2EiY8fyfagAwknX6/vc1Wl70usjyVdZDj sBYlkU2+Q0w+VKhZI5VUUqaj/q4kp6jV9MudCRdWtqqIEsrirpTQSuoPZkRAj0MUWfkQ jRTw== 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=VvWydEF9oVgUS+CUD5vS0LDJwAA7MW8cQAg1qTdiTb4=; b=ZszUYhyY4ocYeFhCuLZoEmRQye9g1RCUz3U9RRWsrlQI5mgU7HFxBAVb7ubb6an1KC o18HNGHjdMKnnfOSwu0KuJI/Pl92/vIggHOev637kym5sRlKpGAVVhM4obxepGh05n20 npsvLKLkyv455gStCPQNq98aDbafCb43G7ItX/JnaBkqJHF7VLPZl7w4f9kl8ZGPsZnX TVm+GwwHnL3rESMeeGlmOcDElM92WOGojqCmg5/KqDu7Z01yfnLUfkNfNAiezKgUlQhM 2MM1KGaolVk1JBbvbd3bUgKncuJBXJ/8LmIywDSekaexvIzoyG5owWtYZa2GnPdnA0pa eZVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=HYCN8itO; 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 70sor24620997ple.41.2019.07.16.05.00.22 for (Google Transport Security); Tue, 16 Jul 2019 05:00:22 -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:f46:: with SMTP id 64mr35065008ply.235.1563278422580; Tue, 16 Jul 2019 05:00:22 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.05.00.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 05:00:21 -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 41/57] ram: rk3399: Simplify data training first argument Date: Tue, 16 Jul 2019 17:27:29 +0530 Message-Id: <20190716115745.12585-42-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190716115745.12585-1-jagan@amarulasolutions.com> References: <20190716115745.12585-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=HYCN8itO; 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: , data training is using chan_info as first argument with channel number as second argument instead of that use dram_info as first argument so-that we can get the chan_info at data training definition. This was the argument handling is meaningful, readable and it would help to add similar data training for lpddr4 in future. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index e3f1abf7e7..1aaaeb5b88 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1286,10 +1286,11 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel, return 0; } -static int data_training(const struct chan_info *chan, u32 channel, +static int data_training(struct dram_info *dram, u32 channel, const struct rk3399_sdram_params *params, u32 training_flag) { + struct chan_info *chan = &dram->chan[channel]; u32 *denali_phy = chan->publ->denali_phy; int ret; @@ -1498,8 +1499,7 @@ static int switch_to_phy_index1(struct dram_info *dram, for (channel = 0; channel < ch_count; channel++) { 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, - params, PI_FULL_TRAINING); + ret = data_training(dram, channel, params, PI_FULL_TRAINING); if (ret < 0) { debug("index1 training failed\n"); return ret; @@ -1662,8 +1662,7 @@ static int sdram_init(struct dram_info *dram, if (params->base.dramtype == LPDDR3) training_flag |= PI_CA_TRAINING; - if (!(data_training(&dram->chan[ch], ch, - params, training_flag))) + if (!(data_training(dram, ch, params, training_flag))) break; } /* Computed rank with associated channel number */