From patchwork Mon Jun 17 07:31:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 598 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 6D7CE3F353 for ; Mon, 17 Jun 2019 09:37:53 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id h27sf30523pfq.17 for ; Mon, 17 Jun 2019 00:37:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757072; cv=pass; d=google.com; s=arc-20160816; b=gVrP1qUVk6Y7zmJ6yiO8UvXG14dRiCZSxI8HBOVLe4U0v9PYuYtUU+owZVMqMZDuAY /3uAMmK+ervtGu74gh8yKIBd6w3E6KstR7YJ78XRgWCZJ4RQjWthId/EJgi6FmtqAMtb gev0SnJ6HyLcT3po8eJ/eimdCWYVTBYsN4KRNBfwzy9tH5SdTR0rn7IlxoTDtHvTR+V1 QARG29IsTIkSVMGcC8pobGWd52aUJs5v1m60xHvnSMzYlXfDoC98yGFjVb/9iADXQPmr 1Riylh8SnaVTQb2NpEQXAWKSj5ry4YMB9NHUVVed3P2ya70bOfofSZ9VqX/UTFJvEzlg OL+w== 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=UDrO9DCvVOoBcZltnHb/79ihZI76cgA6V6d8riyx+5c=; b=D4O9DQJWC9EPmsHAAdvBxkrZvvi4TIZB9krKfRUOXHgg7ztQzyeTXbQ9tDqeHR8Ybn w02XC6rkjVJrcINBC52Ba6HZ34Mac9R4ZlPiy5N+WaMc/A/EWT6YrwzddOD/Z3S2yocL BrIxc0QXVSTf0CyEEIkVmKR8ZB/QIry8ULgbVfkLzfNAPYc0YFghyHukqnKpq6imvGiC 5t+yQ4tEK9q/HXAbtD/7sCwTrZnwHuPmi+Zc0UYooRuug9PatVd0wbYJCFH9xR2My1Tl 5nZ1I8xwQUjqSH9wKzXQiMjAfOBRN/3US7wdOFZ5X5h08uKPkPw5Z6j/njYt71yA5E1S ke0A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q6T43oZS; 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=UDrO9DCvVOoBcZltnHb/79ihZI76cgA6V6d8riyx+5c=; b=nvA/S60rF3i96qcTdJUGZc+QCN1+MO5ufK+eyV8yOj6rQPIvl9w+PczJfUehtO1/y6 c0pUck2dlhiMIMvDKtVr2L+PHokAy5/zHQJ7TvyHiBVYDd++YT3GEB+FgWh8gqNFdFes kU8Dn4c7X8c1I5oJIjO1cIuwTLYTyaeYQXxz0= 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=UDrO9DCvVOoBcZltnHb/79ihZI76cgA6V6d8riyx+5c=; b=myXQOnRQ5VLG4r8MUqcsTSPkoCRMAXFIS5B/viBhptfiKE1F/byoUBf3qbX28D9Qoj gW1TOsSt8sOdLeyrLHSQf7R4GJiW+wig6tH7J38aUd7HCVgGhgAY4pf+wlB6MhQ9bdBk 5NgtjgNTEl9zHoWBiLoi66Z5XQWrzePV7EjfSVg3+E8b7LEDvAtWGbokzDgX8TI7GdXm LC3EkZ6O47JsD3IjEqheZFfRtVe0fOrBcwNPcM2IHio0JGZwrbvee7WtSfSWbErp7mBH /GV3oIlOG8dV9AqQsjIAwEh44NDRO/B6SAHaE3/M14vtLuggY6urAjfxQkX0VnOWgEOH qBYA== X-Gm-Message-State: APjAAAVU6ZU4xYIC0TCwT3NUS46jC5xkGgYM1f1VMhATf3jIxu2ZbZSl Q4Kdl7AU6ItH1CjUH0RXYOlCGDRy X-Google-Smtp-Source: APXvYqzKjAJ2eRSAxf8yYI0gbpYQmIlHDzR3muQ5joyjMskTXC+xo2wU1iR3PDdlvIPxBLIrR2axng== X-Received: by 2002:a17:902:24d:: with SMTP id 71mr109582335plc.166.1560757072292; Mon, 17 Jun 2019 00:37:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:b21:: with SMTP id 33ls3590710pgl.1.gmail; Mon, 17 Jun 2019 00:37:52 -0700 (PDT) X-Received: by 2002:a63:dc56:: with SMTP id f22mr32609456pgj.305.1560757071791; Mon, 17 Jun 2019 00:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757071; cv=none; d=google.com; s=arc-20160816; b=YfJ4PPe8qlJWpyOA+c5EBRaw0/D1dtH9mBRXgyhM5+TPwPInGFyjFJdW4fYtTgJVXx /wXIRg0hrmzpQbrqqdNEJX6Jl9ifobOTUW3hcecEleu+lq5eDuiNb1nmhefH5Rye4DSA A8NdYsCDgxdWsFDrc2vK92WdLXMYS5yrFs4bvTVZgEBOUx+a/qUnPELUdvqk63p362u2 Px0RswsLX0DTGWj90AP2HdjLt5JjE10Dbc2khlXexidhvGdg7RoxPjGh+y1eVZuN9T7X 1OuZy/wUMs3KX1hYxI//sbWmXb19IP8hssjhr1TUw7SH5K0jydNSn7MWd4L52IS7naxW IC1Q== 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=CLITkFyBMkFVbsm6FYgyNMLnGtRe8xgq7oEoutVmL8k=; b=WMbUW6YAJqPytvfHAnnuIKoQDFjDylet1j0vpJVmOEjy7R4SQolS+oG+1pe9+K4pEo 9Wm/gOjIcA4rWvpcBGLs28IjLEgGwEaGkjK578qLHXCuSUhu380Od9fiEBk/j/1vJePK pemtklO9doIO5fifVp29S1Bcg8lhXfNQLhQruy6fp1H0kSbzuHOpk+K9up71kfw2Q1ZE uTfrLYPrJ6sNxVspUzsJyOxEEPkmGfb9WWnbRvSEkCAWBK0YtrE/yEqsb3SjKs+ym+kW fpvopzJUzyJakbg9eDggOHHAsNRukyTU8lEtQidP8YCXIQtcHAyrrArHiSS0y0+a5Qhg Bp7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q6T43oZS; 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 v75sor12341757pjb.26.2019.06.17.00.37.51 for (Google Transport Security); Mon, 17 Jun 2019 00:37:51 -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:90a:d151:: with SMTP id t17mr24704204pjw.60.1560757071490; Mon, 17 Jun 2019 00:37:51 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.37.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:37:51 -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 27/99] ram: rk3399: Add ddrtimingC0 Date: Mon, 17 Jun 2019 13:01:40 +0530 Message-Id: <20190617073252.27810-28-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=q6T43oZS; 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 DdrTimingC0 structure with associated bit fields. These would help to reconfigure sdram capabilities during lpddr4 setup related configs. Signed-off-by: Jagan Teki --- arch/arm/include/asm/arch-rockchip/sdram_rk3399.h | 12 +++++++++++- drivers/ram/rockchip/sdram_rk3399.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index c6a260bad8..924eeb3bac 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -26,6 +26,16 @@ struct rk3399_ddr_pi_regs { u32 denali_pi[200]; }; +union noc_ddrtimingc0 { + u32 d32; + struct { + unsigned burstpenalty : 4; + unsigned reserved0 : 4; + unsigned wrtomwr : 6; + unsigned reserved1 : 18; + } b; +}; + struct rk3399_msch_regs { u32 coreid; u32 revisionid; @@ -44,7 +54,7 @@ struct rk3399_msch_regs { struct rk3399_msch_timings { u32 ddrtiminga0; u32 ddrtimingb0; - u32 ddrtimingc0; + union noc_ddrtimingc0 ddrtimingc0; u32 devtodev0; u32 ddrmode; u32 agingx0; diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index a8100749b0..787cdc6b52 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1042,7 +1042,7 @@ static void dram_all_config(struct dram_info *dram, &ddr_msch_regs->ddrtiminga0); writel(noc_timing->ddrtimingb0, &ddr_msch_regs->ddrtimingb0); - writel(noc_timing->ddrtimingc0, + writel(noc_timing->ddrtimingc0.d32, &ddr_msch_regs->ddrtimingc0); writel(noc_timing->devtodev0, &ddr_msch_regs->devtodev0);