From patchwork Tue Jun 11 14:50:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 490 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 8258E3F08F for ; Tue, 11 Jun 2019 16:54:29 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id l184sf9253015pgd.18 for ; Tue, 11 Jun 2019 07:54:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264868; cv=pass; d=google.com; s=arc-20160816; b=Znf1JULjGlH1AP58Pkiyl8MfywPdGXSKhvZlVZwMqyBw9b9A37K9JG5eYmKrvAmegX TPthTTvGa4YKo3PSHbz0mPOu93e+RDpOSXM/lrOc9xWeA2TMHuMIHSzm7kur18vLIf02 Pg528tkJEDsaW7tUayt30z7IsdFsr/bbg3wUq6bgsf4oUQF6q/36rgp86oXEXW9rpyyN djgZ6WpHQOBcA4rMLC0tJ5PjMisvMv1P4XiouSdBPp88Axi/AJ/y7mLR/LYroFTmLFuu L5GRviYYIfauE19LjgMkokBsDBzs67jjm3fo7tElKFT1atYDGWtEeUkeBm8HFtFyfH0n 9wlA== 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=XdRM+RBD1t9/oFLF9fImS+uZxFNWBBcyOjKdettzT2c=; b=JxNlYcxdcukxyfn6zF2NxZoeoNVm3Q3f41GxdBYGEv8VLDY5ZXasiw0m5XOtZDAyJw 6Zjw38sK/ZKfZjLUcZIfVYX3O5P8+PRNJoJzeLdrFLHO1rdTYLJjWf1+uuguySBKXiYT QFyruiYVYzC6nDf6hBmhYyfwS+luOFaU3Yh8I3r85Uq5zahOPeJvoygSMr2bKpF+3pB2 JPNw0a+rbTgOjhTM3pNkgrNx5h8tFn/A51PVjMKkLFF6G55vECAhhgcgJHJazSUOAw2G OH2B+4DTIYtx4kjk/SglnpPyxgD4RXaqBDiMX+TVcbZZ6av3YOPIzgJXReHV/KCEiUts dFaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eGgTxMis; 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=XdRM+RBD1t9/oFLF9fImS+uZxFNWBBcyOjKdettzT2c=; b=nCsXM6RVydkiUo1jehSCmxcpZVuOW4xg92R7XTSImIw/sg7ltHKue7jL8OWimVaGi7 o8Lzt5adfzv6OlWQiWYBBHY48WH7FJfMf8zFIdz6EvETJcdvra1MBu61cYtFD9EkbZZB h4a82QAPG6Gkp4TTMar5M16NsHrr07g53IXI4= 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=XdRM+RBD1t9/oFLF9fImS+uZxFNWBBcyOjKdettzT2c=; b=q/LBlvMN4XEYKoo3qxyN3zJmgVwN81tsOzuNwlMcPbxEu19NesIU0ZR4Qztbkc8fkh EO+48R0XNZ71MVJgjVbqom6N3wi/1vlVA3BuCTOzXwq/CwY57HnpJRT8PmeBcNv4HDK1 E58L7hZ93XQefMTx40bST50tTzB4jvT6ioWVZB7yolDD3ivKDesd/vt2yC08dzkzJV+D EavAcLRk+ux3aWbX2D5k+J1uciV2xGXs7uW+9rLYBLHTaJsfMczrECfh9GH14qqdkzdM e1eLGGw9rkvsQFzl5hKFVxYOD5r3ZuE2ZM6k4WKcksx55Eeoegm2V50cum6yzI2y3uBr sbjw== X-Gm-Message-State: APjAAAVpDU9yxPvY26yxm5llE4WXukYQy5Sa7uQWo9YApDYNb2AhVJAy OUraMBygM/9D2GdXG3jaMjOLSC/O X-Google-Smtp-Source: APXvYqzXKTdFglemErG7c+DDoC1m1DsR1TrOppf/Zz9IqA5KKlR1i8cOXSiB14CRKYrbfNOfioFBRg== X-Received: by 2002:a17:902:8209:: with SMTP id x9mr76908970pln.327.1560264868331; Tue, 11 Jun 2019 07:54:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b605:: with SMTP id b5ls4895159pls.12.gmail; Tue, 11 Jun 2019 07:54:28 -0700 (PDT) X-Received: by 2002:a17:90a:8a84:: with SMTP id x4mr19973199pjn.105.1560264867984; Tue, 11 Jun 2019 07:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264867; cv=none; d=google.com; s=arc-20160816; b=y2CmPPs8YmfQYbgCXLoX3zOxJ/1mBYbXLmCwjGdriDvO5dwbVtfL7dRS4NemsKLces IlTTvBPnEnZbgBUE104ZRUJyYBzWcXw4cu2dH++WolNx1QnqJQrb74E18qjz8MFmyQt0 zkRxWFGCXYTQ9f0/whvM+avokFc9eI3J2bO5/jy4aMbzc98eVgvLe0xU5PLXL69Z3Hop odoiO5LTVm/tX+Za3xGaID4CLtWsps0cWwPWmvhJNU1/0kapr4+GNekv2pKVeZVGYo2o km9cXsfhMDDzJenaLR9LQG3GrIfW8tzHJfUq/6pIKbuhNsYZEYyaPT3ibsSBPwHapmk0 n89g== 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=P2YhP5cKxP/vT8AS5LQrl5DB+8q87pvOExCb2ibCXd8=; b=n2Mqc09Yaap1zJSIwQgutKlGkrakJl28vdFlm2idzYNfITAbQFNrOEJVRSVKpvHpbm YbIyyH3MwXiSP00rGHEDuJaU/7Likna40ydnh47BTZ6U2ZPK02Wf6Fh4pS13zccyRSi9 +z8KIQarlsWF8l+Qc2po3zelDfJbqjmutQcJTM1Qkxew2pRnaGDPWgKTuL3MCo5XCt04 KDjJAO/ztHfdpSVGCZdkFfeab6rx9X2hCxDeEYolQ8iTw/fy1Ji6U3111RKAEv2jKZK4 fLZho7aea0NF56inRkRft6ZDNf12aWxqQzNuJfe7yhFfJMEpJyr1L+Qm535SdxeRdX0Q 28Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eGgTxMis; 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 a2sor13153691pfb.68.2019.06.11.07.54.27 for (Google Transport Security); Tue, 11 Jun 2019 07:54:27 -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:aa7:97bb:: with SMTP id d27mr13325678pfq.93.1560264867696; Tue, 11 Jun 2019 07:54:27 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.54.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:54:27 -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 39/92] ram: rk3399: Move common sdram structures in common header Date: Tue, 11 Jun 2019 20:20:42 +0530 Message-Id: <20190611145135.21399-40-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=eGgTxMis; 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: , Move common sdram structures like sdram_cap_info, sdram_base_params into sdram_common header, this would help to reuse the same from another controllers like px30. Signed-off-by: Jagan Teki --- .../include/asm/arch-rockchip/sdram_common.h | 29 +++++++++++++++++++ .../include/asm/arch-rockchip/sdram_rk3399.h | 28 ------------------ 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 8021ca21ed..200551fac5 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -5,6 +5,35 @@ #ifndef _ASM_ARCH_SDRAM_COMMON_H #define _ASM_ARCH_SDRAM_COMMON_H + +struct sdram_cap_info { + unsigned int rank; + /* dram column number, 0 means this channel is invalid */ + unsigned int col; + /* dram bank number, 3:8bank, 2:4bank */ + unsigned int bk; + /* channel buswidth, 2:32bit, 1:16bit, 0:8bit */ + unsigned int bw; + /* die buswidth, 2:32bit, 1:16bit, 0:8bit */ + unsigned int dbw; + /* + * row_3_4 = 1: 6Gb or 12Gb die + * row_3_4 = 0: normal die, power of 2 + */ + unsigned int row_3_4; + unsigned int cs0_row; + unsigned int cs1_row; + unsigned int ddrconfig; +}; + +struct sdram_base_params { + unsigned int ddr_freq; + unsigned int dramtype; + unsigned int num_channels; + unsigned int stride; + unsigned int odt; +}; + /* * sys_reg bitfield struct * [31] row_3_4_ch1 diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index fe25446cab..6258c811f5 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -96,39 +96,11 @@ struct rk3399_ddr_cic_regs { /* DENALI_CTL_274 */ #define MEM_RST_VALID 1 -struct sdram_cap_info { - unsigned int rank; - /* dram column number, 0 means this channel is invalid */ - unsigned int col; - /* dram bank number, 3:8bank, 2:4bank */ - unsigned int bk; - /* channel buswidth, 2:32bit, 1:16bit, 0:8bit */ - unsigned int bw; - /* die buswidth, 2:32bit, 1:16bit, 0:8bit */ - unsigned int dbw; - /* - * row_3_4 = 1: 6Gb or 12Gb die - * row_3_4 = 0: normal die, power of 2 - */ - unsigned int row_3_4; - unsigned int cs0_row; - unsigned int cs1_row; - unsigned int ddrconfig; -}; - struct rk3399_sdram_channel { struct sdram_cap_info cap_info; struct rk3399_msch_timings noc_timings; }; -struct sdram_base_params { - unsigned int ddr_freq; - unsigned int dramtype; - unsigned int num_channels; - unsigned int stride; - unsigned int odt; -}; - struct rk3399_sdram_params { struct rk3399_sdram_channel ch[2]; struct sdram_base_params base;