From patchwork Mon Jul 15 18:28:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 745 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 BE47A3F08F for ; Mon, 15 Jul 2019 20:30:02 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id 145sf10729341pfv.18 for ; Mon, 15 Jul 2019 11:30:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563215401; cv=pass; d=google.com; s=arc-20160816; b=B/LPsebEPi1yPvn4v5n9qHqhCUEJQLc6l38HogidlkgWyZj+SJZ62+wVmexWQPKRcM v3Vgl5fj4jRWlX6/cXvR8ntohap9z9jg0ML16YCIEatR5iHSxKDvWMGRR1bvodzBCkET aer8d7IZxEs8khlFYEErpihDzDtmGqRLSnEAKE8iNnQQamK1PNRkfDRoZ75E6mTnnvRC ILzxvFfRZ2ZzLSqALm36ijP+TlpmBY/H+R4sX6wgkurlmDzOVMR1dlBBfxUApCfUwlHo uNwmxfTgQS7Fe5rIr6ZsbU/xu60EZ5/RdgLr4pZWbGWXi1UUWW4idO8N3pSX1QOVOpQp LbTg== 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=gpVpFo0JwmRu76lAD0v0v0Uvv3JqbuY0C6IUwn50awI=; b=JcTSJXbt01cxPNhFpjdYum/xHpilrPczEl25NeOhoQHdOpXfx66Y/yVFOw6BR962xK L5f/IyFxC5DWS/hpcBBQYRFQkO+LOh+twChIUAZ5uiJbzQtvZQWXzHr9lG/dcnghlmGa AC69f9W63fjaQxERACEvEktLao4gYsyNL7yKkfIXcIUgDZh4Fp5F44kkZrWJTlb7ADN2 dSrPgxE7Vam6d4o5xw6EJegwFJLOXudv1MsGjH9cS5mRQ8CtN5dBa5UufGCqTl777YNf L8X9dbspg+6x9GTgeHzbOjDMS0PcvMMDqOCAbuohTeVuGHQj2iuuB+uHqOkQtX4KlksU PW2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kFVq7vbr; 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=gpVpFo0JwmRu76lAD0v0v0Uvv3JqbuY0C6IUwn50awI=; b=DKV4XVFat3MLdnchxItuXJW+XunUQch7cbKQb5JIIvns32Zw2d1vdgvJqKUuN6JRfV 4T0Zt1oHLXrtXztlvIYx/CdKKArXxGWWXF5DBNxSmkydr18wiiO00g8KgjVMaV5TToUl SBcNhwnGLM88COqJ2nbALgxWTc7LsjJcdBcqM= 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=gpVpFo0JwmRu76lAD0v0v0Uvv3JqbuY0C6IUwn50awI=; b=ZVkcdeKj4jrXwMImIHYQlleEwjRBemSS/B0op/gOo8SqUw3UUe6TplscZQOl/B2VZJ bVhj2OYak8Qdw59daCNIQ8srSUOVJfEVZNjL5iu0cv0OYIYg6ZOWxdH/31J/zFZU/MBT VAbcKH25RYGha1t5wiWYsKMJaZs4rQCdVNID55R0KwONK+FO9gMQxMRrQp54YiyYVFQc 0IvIIsmvdtiPXYyIEcSpZB3sPRUMxS2FpI06PlzCOXvaeZ6T6rbnyb89GtMmrWczg6lA rdvMKAFKEmPThW/UlBL0AomYG+eEe0agmkFHFC3ZwFcSVDw2mib3tTFmFwaGSUvf53qy rytw== X-Gm-Message-State: APjAAAV0cgkWJbxy2v68qFkPRHUxxen1/7WNCw5kY5qPP5iNKQ2Frivb c41iXNmJnM+EwVWXEzNwbpVp3+Qt X-Google-Smtp-Source: APXvYqy5uxZ0TokqXxwZY3AQFOS+Hr4giM3ObYnbwHzZ2FBDPA+ly+tkXPwVWlnT/28P31VBhPBklw== X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr29695112plt.152.1563215401582; Mon, 15 Jul 2019 11:30:01 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:ca05:: with SMTP id x5ls6192860pjt.3.canary-gmail; Mon, 15 Jul 2019 11:30:01 -0700 (PDT) X-Received: by 2002:a17:902:8207:: with SMTP id x7mr29978073pln.63.1563215401311; Mon, 15 Jul 2019 11:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563215401; cv=none; d=google.com; s=arc-20160816; b=bP4LPzmJXUylSOpnj8i+cR8yjGIT/4mK7B5goDAq2VmDENgSn4YRAdfdzbT/3tzd70 RIjzkeoh4hHeV6Vr6Tkzcg+KYMPHeh7cFIuRTcbB3xAAOEuJ285t3/1zrXmsFWlbKd6E +WN8vEuf9UmxxY0+KASQXIZ0Pm8hIbAnCqb2Ht3OesdCNDKMKWEoSX4du6pBSJxc7U0x GjOV83PB5ZwI/rlrt1t3L/u31uAh9F6wQ7l4+8iixy0M+w69H4dUe/tACMK9vPTt1VvA NvrSt3+QdIBI0w4zNNpKZ71bVQwBpayB2J1Je65m58d7UZKJqxrjcaOBg1mqSIHzFRYa AsLg== 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=RByc4KuNwswp3759wv/08UvlM/GeZhHFfJFldIHINB0=; b=tJrg+JyZA7MGH+kN5nV41TGvuHZvpPkBPwBmx0ic1MmJpyyu/vdysMgo9uDGWCNGr5 dBvcQZoP2ggDYRVNn+S69MrvPBLSqBBXsEE6pXc8hT6cjPlIoBmOBBCKuktE48Nfy531 BPT3q/k+SPA8rAZslpv8xvL1y7JavaKg+LWvw2f9+OKzRcPHahad79M8yujZ9P451oRI WMbBrQpzw1qICmsho9X65IyXbgPIzaakt/rkJYWdADAkQcNxENuH9MpmiOLKL+3PV2of 3l/4WQnTd+zJMQrI89+JwQXmAnGk3Y0moqgdEWczoW9HTwBiua2od5yFVx5Oxnlr4+V+ tlMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=kFVq7vbr; 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 x16sor22043516plm.61.2019.07.15.11.30.01 for (Google Transport Security); Mon, 15 Jul 2019 11:30:01 -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:be0a:: with SMTP id r10mr28259146pls.51.1563215401031; Mon, 15 Jul 2019 11:30:01 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id y133sm20250075pfb.28.2019.07.15.11.29.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:30:00 -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 15/18] ram: rk3399: Compute stride for 1 channel a Date: Mon, 15 Jul 2019 23:58:53 +0530 Message-Id: <20190715182856.21688-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182856.21688-1-jagan@amarulasolutions.com> References: <20190715182856.21688-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=kFVq7vbr; 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: , Add stride computation for the sdram which support single channel a This configuration available in NanoPi NEO4 and the same can work with existing rk3399-sdram-ddr3-1866.dtsi Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index c626ef602c..8bbacb5275 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1211,6 +1211,10 @@ static unsigned char calculate_stride(struct rk3399_sdram_params *params) chinfo |= 1 << channel; } + /* stride calculation for 1 channel */ + if (params->base.num_channels == 1 && chinfo & 1) + return 0x17; /* channel a */ + /* stride calculation for 2 channels, default gstride type is 256B */ if (ch_cap[0] == ch_cap[1]) { cap = ch_cap[0] + ch_cap[1];