From patchwork Mon Jun 17 07:31:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 599 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8F15D3F353 for ; Mon, 17 Jun 2019 09:37:56 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id d3sf7212416pgc.9 for ; Mon, 17 Jun 2019 00:37:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757075; cv=pass; d=google.com; s=arc-20160816; b=YT2oyIhVljfjSu5LVpSBD5qfNRXt5Kf7RvYX6WxhDSb7E3gFWnUDhzUx+LqpjA0LSV TPvjHBOIBA7+frvfHeiT+9xzwXn3VvJ6bK18unKYZrFz/hxwu65nKHaw6UyXFFlv8PSd svWeS7zHCNs0JduDiT5M9RPNvSmC0TDYb8Dw5oyIfpHfkpflyLmjv7IQs2X+rCAsZNHD Y6sVwHIHRFDtHcoRHGF+up7J2kTvcycASLxaw6AI58Il1bXa/f1w8yweNwqU+FBQUnGH WucJbNJUCQSwcg6BcUPXxJuXu07HSIqfT31UK5rFWhi/Cpu3EZAWdNsIhWyJcKzNI+Og nf6A== 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=PoCXBRFY8WXiptN/1r0RHONmgMV/wSKc8OiZGJsdztg=; b=VT7jcDvLemmsHCrzJUMLHQOBdUKcrKBNoUFrx8VWyNQDmsiVSdCueZvaJ7e6GroEMp 62lbkXJl4sFN6Pdlvf4qSzklTsG9BhpDgXglTj8SC2F+AOOxsuIt7B70fcvUqFVHlZvB Xtg839Hnw7BpQxghobNoBGrC+86fiHQYPIzXgww5AGlAG+lkZco4YHrZXcFTwVIpDu/u J6Z7Y3HoiycKxKvROVAZRUei6lPr0u54P7WEOEZYDcrMUQlwx/3GvPXtna2p2Y+IdV/b eG+cj9Iu3hJHe/38DPkvd4oV+swkMb2QALBFIN2AyiaImOosb6ScaMH3vM0eF6GtfM+Q M26w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHhwxvms; 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=PoCXBRFY8WXiptN/1r0RHONmgMV/wSKc8OiZGJsdztg=; b=OKk4ntaQ0UXMoR87+LH0gbxLZkbN131pHWo6CrGNhUnizRkEAJ7vUDDPT4wHTZN6ax HTD41PPyqxgExaI0z9o70/Bn6COkQlcs+kNWn8LUpuCKpa1Zi8Dcdh10r98XrYJohPhD X2CqMb64l6yOEuhARXf3fI4vNKirZf+r/ESuM= 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=PoCXBRFY8WXiptN/1r0RHONmgMV/wSKc8OiZGJsdztg=; b=Wzl96uN+b0RxEULxFejQHE5vMzSvLnVLdJDNwaP9J4ROuoNwz/3OV2fMiO+T+cDHnI Nlc7dOdf4ElGuXesg4oxwEpWCVcTR59tjciBpqOIeMNWklTUwBfNBUFeDrhHPy0lKzAm TrF6m3xWcYofRqP/xzlRwQKcgOlxweZVTCLejH3YkaF4cQggpnytXspr6xR1onCQVUYS VpdEN9pXAktF2QwKJQl73B30Y9bowvx3btqGNid1IWKgHLfwkcoF7twgfHbX7IEojFP7 ng5WNU4WEPOiiMjvfIL+v+IXnP/OP5YNOHQQawyQgMC+25xpKfMp7kFNVTeK4ERyD140 wFAg== X-Gm-Message-State: APjAAAVzeJAo4QOiqOKhH6j7MDandm592mcfvK6ELho6LiTejSbSeC3/ RSg54u9aSnbLQFTcoQ2qkG1mrNB7 X-Google-Smtp-Source: APXvYqwqc9AqWsNMKwZNIEbHnX6pO0+uWrXHKA9ldl8lzTEPV189aP7g5v8Q55PaciV5ayDDTHK2wg== X-Received: by 2002:a17:902:6903:: with SMTP id j3mr31188598plk.247.1560757075418; Mon, 17 Jun 2019 00:37:55 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:8115:: with SMTP id b21ls3367564pfi.12.gmail; Mon, 17 Jun 2019 00:37:55 -0700 (PDT) X-Received: by 2002:a65:508b:: with SMTP id r11mr16854115pgp.387.1560757075073; Mon, 17 Jun 2019 00:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757075; cv=none; d=google.com; s=arc-20160816; b=xUlQtEHSmo1Z1dKXKY4X0sEm6Zfz1mXf2p8UMOhC1kSdhRpzhxJj8k585OTaMhD7pD xsOr3xVWIFE2mC720/4hVxBpcqJSpb75ORPPq1EoFMas7liKzXwr5c85YY+O1JcAksY2 MXRowHzM6g05vKRjeijP+H0lJt72k21hrSCCTMrDRxaUWIptVu10vDRSk7fSI6IWSwF6 Vwqqv5maQozCFVm5UZUUrmMvt1MvZilFlKyZbtlPuafyDjyLKHhCAe3PnBcMsuAVlRCI niMu7hMKDArz24ZEPvyuWRU2b6saofdsYe2YXYnvloBNcctlQnAiCFI+jYVfMEP6Km19 1QwQ== 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=iwH0VhI5YwIZ3wm3UnVwDRiky+H+TDOZNsRsXz2tQ1Q=; b=gxVZT5+BXypwdAlbWXjOta489aT79gRZcdCKZEM3uJR7p4s0wgV4x8r4hW29VuRqTp 2qkfgl9hYF73E3BBrbXPIWLvIkSGMG0v88YxlCYwI93Avotyw08DWetfgiSKJqTfsjLs eeM0Eqc4ZgqqLQ8pgMHbwAgOJ3Z+C4mVwFVv8+0Ji1M7wwKLHZ4SpitophQy+YnuyKDl kaH6FCOjriEUuLb/iulGMtSXpSMD2+CL2PStvrzrWIpH6+8/6uylo0iiS2bp3moxuSTV TfPJJGiRhbuamlAoMCQwKVh02x7bDpHdWjuKqMafJhir5t3pJ/fGFGZkmH4F0A4y5vg6 QySA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=IHhwxvms; 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 d3sor10244721pgv.29.2019.06.17.00.37.55 for (Google Transport Security); Mon, 17 Jun 2019 00:37:55 -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:a65:5004:: with SMTP id f4mr49146036pgo.268.1560757074731; Mon, 17 Jun 2019 00:37:54 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.37.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:37:54 -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 28/99] ram: rk3399: Add DdrMode Date: Mon, 17 Jun 2019 13:01:41 +0530 Message-Id: <20190617073252.27810-29-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=IHhwxvms; 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 DdrMode structure with associated bit fields. These would help to reconfigure sdram capabilities during lpddr4 setup related configs. Signed-off-by: Jagan Teki --- .../include/asm/arch-rockchip/sdram_rk3399.h | 17 ++++++++++++++++- drivers/ram/rockchip/sdram_rk3399.c | 2 +- 2 files changed, 17 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 924eeb3bac..a191d242f8 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -36,6 +36,21 @@ union noc_ddrtimingc0 { } b; }; +union noc_ddrmode { + u32 d32; + struct { + unsigned autoprecharge : 1; + unsigned bypassfiltering : 1; + unsigned fawbank : 1; + unsigned burstsize : 2; + unsigned mwrsize : 2; + unsigned reserved2 : 1; + unsigned forceorder : 8; + unsigned forceorderstate : 8; + unsigned reserved3 : 8; + } b; +}; + struct rk3399_msch_regs { u32 coreid; u32 revisionid; @@ -56,7 +71,7 @@ struct rk3399_msch_timings { u32 ddrtimingb0; union noc_ddrtimingc0 ddrtimingc0; u32 devtodev0; - u32 ddrmode; + union noc_ddrmode ddrmode; u32 agingx0; }; diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 787cdc6b52..dc9229ddf3 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1046,7 +1046,7 @@ static void dram_all_config(struct dram_info *dram, &ddr_msch_regs->ddrtimingc0); writel(noc_timing->devtodev0, &ddr_msch_regs->devtodev0); - writel(noc_timing->ddrmode, + writel(noc_timing->ddrmode.d32, &ddr_msch_regs->ddrmode); /* rank 1 memory clock disable (dfi_dram_clk_disable = 1) */