From patchwork Tue Jun 11 14:50: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: 477 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5FDC33F08F for ; Tue, 11 Jun 2019 16:53:37 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id q2sf7900194plr.19 for ; Tue, 11 Jun 2019 07:53:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264816; cv=pass; d=google.com; s=arc-20160816; b=qu1Q6SbNEL6/pbwoET1Wyj+iVUkBpdsyS+MCkBw/Jhf8CZfjHBkGPFX+msEAl9w4kM yZTEJe8+7yQ1r1H6wMG+ogswAg/VHY+yxifVenPyxLrCid6gEoOA+jId5V46GAze2ye+ PID8KmJ9deFe3b5Lq46N3AWmz75NlqUnPwCP+qBqdzJ9cwaI3J0O/Dvifk2ZdTD/hq68 ZAmP7/JlEXLi0yCIg3TKXfz4Kub5q4MjP7V/UagboGYwtS8FcNsMP8F3S8bLKN3BkNGQ WjgAhzpGmhXLjXmjyI12O4Fkq2a+a6zphdLJ0JkAYEreTF2GcQGKrxc2Bg5Bl9AMrVvt xRog== 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=mKDMBhxFrNrEY7/6HddOTUVwSIwHM3EUjaclz3Skijo=; b=UQAVWx61E4BQRBXB50grNN8mRMN9FA6h4vz72xb7c1Z/LJGUScRQWtCNlvPGnq5DqI yifRs9BHw5SXiQlNjm48xk5l2u2TKxnb4wVUOJsH/SYrR0ds2C+eY0kg0OWU3/BTKpX3 A/ZeIxqkELSDtNgMxM4pdZ8Xx0bnVOJNZMbVM7uZtr7LcceDK5uST2ZCktGW2WfrOrww ZMGrDZCti1Hxm14YXGFSUzinxSRUpSFIAPGJC/viohcV2m/qkbM6xd+fwPRxdTrnT1O9 H9dQLZPqynkQFxlsKC56hcGYbFiIIv5DGWnPa15d0kvDW5wqEKeHrp6FP/kqMmb7g6Fs mGeQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KjaGpcd1; 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=mKDMBhxFrNrEY7/6HddOTUVwSIwHM3EUjaclz3Skijo=; b=hs7bmttu7XY6P9pXOcykNb3avwv3u1WtccNQEVV6GzeTCykE/pFVnNbgcC5at82u5E sQhJyto+HBcy3H+xHDq+2xurfd6VozGhC1WAhVZwDtZv7dmEGMJJze0jxhTC8tV6EXEl KH5VO0Z/dS6JbAPB3YD35iIWtatskyFxj1SaY= 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=mKDMBhxFrNrEY7/6HddOTUVwSIwHM3EUjaclz3Skijo=; b=lsI6Mv4BS+BgCJXNY14yZlUNHPnLSrzipNhAdsGWDIirQ8lPbbHS9HSTMWvWNzsgUr /7Kk8qxgfadH8eXeqR/clh8PekAgQGBdUz39yNCNnqb5s/jeFWQHgIAwfQPfzug4umEf DgjyuUuHCiIJ2hPeAtnO7WmEj2mu/AhV8VdWoGh9Eia8va+CR2s7luon9FJVI/FBTICc lLl7HsfPHGVeUjUec8YORSy5M3LJPqx1nP3q6SusQJ1FZ0uUuut8CM37BYUaWNwU4yRi wodGW0zYKWuVK4MIKFnkeOdV+ClBE4o4KZY8z5aybdDeQdLFyAcmMlQCAzTGGIZZPRPv +vPQ== X-Gm-Message-State: APjAAAXdNQ1/Aj559OI7NSdGvuK8P6P4thjv2bcUUtX9PQy09rQOn7be 7r1GbZlAWycWAlJvPe0ksH9N83mT X-Google-Smtp-Source: APXvYqzX0OVswqc3jhBg4Ap6ClvdJytDKztyYwwSxXyg3qWFNr6Q3PVG01vuokTRozp0alPH4qeioA== X-Received: by 2002:a63:6c83:: with SMTP id h125mr19884395pgc.86.1560264816136; Tue, 11 Jun 2019 07:53:36 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:5f87:: with SMTP id t129ls1382714pfb.8.gmail; Tue, 11 Jun 2019 07:53:35 -0700 (PDT) X-Received: by 2002:a63:1c4:: with SMTP id 187mr20995421pgb.317.1560264815729; Tue, 11 Jun 2019 07:53:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264815; cv=none; d=google.com; s=arc-20160816; b=CBS0z4SKUiZlFiI+e+dyirtZHW4RHjx4uO6MsXNTu1A8ZBrDhN8eBGGuPyWaVqfeJ+ HOU6aNZ19keiWqsxgUaeJqyVOeeFu1lsDX6E013BmVicvUjfm/e1KXjNi3N1qthj64S/ MmRk7lPg4bTHoC93JdCVAeSkUxJNTduXz5xQ22H88pJtrXsB4WyOkVXk2W4fJlDU+MtC 88QirBLLAk3Bpt0zgJ+VEVReXp6tjU/7jFi5PAvZnaVL8xFHs69+Fjjm94C6plNWvbxW txPPYBb5uA00vwXLNdHQK8v/9Nf3dlUBCn3Dqufi6Xxqgl/PkaChroKa5TtxqEtnOW3O DUSA== 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=rl7D8VxB/uajjmKlPKunXR7uqNow8tYaqhy8wy5znxA=; b=TddmXUvpwq4w3TNfLw5eMKGGwIcF9Pvq4UYoc1+jShilQBs8epzok8hRPe+qP40k+/ 4XD7b1mDEH9lu1CktOi9mYOCazNS6HI8wZ442/E0hprE2gElf1OdsHyXPGrbhXXprkXI uj300T27jbBV2Ff0+bfP6CW5KV4KvkAqKVK99Y6J6LGRQDGhl66GHbB1pAu2XMhQYcBi 1NheR3EsCp8dqcxGxBUqCBlvGxgrbcr/iA43u6DrFu1kL14C0O4mTsIZwSfIBqnKgoCt SW23I+PBuenY361XkOa/fSl5Q/XjoNAkBZwL3qzMhmEqOv8OZblSnSn8XL7AhEAoVyPk r7zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=KjaGpcd1; 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 y6sor2172939pgy.37.2019.06.11.07.53.35 for (Google Transport Security); Tue, 11 Jun 2019 07:53:35 -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:a63:db4e:: with SMTP id x14mr21418185pgi.119.1560264815340; Tue, 11 Jun 2019 07:53:35 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.53.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:53:34 -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 26/92] ram: rk3399: Add ddrtimingC0 Date: Tue, 11 Jun 2019 20:20:29 +0530 Message-Id: <20190611145135.21399-27-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=KjaGpcd1; 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 5b87524b7c..f9fec14758 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1043,7 +1043,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);