From patchwork Mon Jun 17 07:31: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: 611 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 7AAA93F353 for ; Mon, 17 Jun 2019 09:38:36 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id y9sf5515229plp.12 for ; Mon, 17 Jun 2019 00:38:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757115; cv=pass; d=google.com; s=arc-20160816; b=ztXs7RRntsTnCQCQrZxLh6tzELE8nBqjrqW/WAOSS+H4/tL3qlcFeJbCsTLEPFEMQM 8wZfY4VUtBaJRFp7S7HMccScfDFzvcWA/fIXUdryMZJ6F4SX+GaCZtfE22dXTl4hZnpq whUhjJs6Ddszqk6qstxAplGmZQt7pEluvTZRiFV5mWG15D323Q9c2f/rGv3BaaqHa9VF /9q9zhjoznNO0aMZK4DV7gojU4rydfF7m2CFcuEJIrzUJGJA5wASDz9Cs/iAakSbor/a a3Qq5ri6I2E8jXKIUmt+GFn8/OBw3oqG24bugx2rvXstYc399f2w892OXYTygc0ootL8 aElg== 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=ag3mjcXF4/g/bZ+pXECF/2hoju5/PTcjKtb9bYtqvoM=; b=kRmGQAI1I+VWnPyiCoEYWXyGfIrlNcbf1XngeyGfLsD6DVt78j7YZRpBRhkuiZBos9 3AMiK2DMzx/5uPRpFQ8NE4CUvpksVJdc0V43R7iplcYwLRy0QIXlaOdSM2N0PL2ftQPd XWCrRkwf04UIzp+etGfItHfYOMxCAmHpnffa3/66YflhfKGri+X652ed+ckzW3QmAYIx Fpr+OV9zLhv/gqTMpXICJGUjt27nSWX8R/sx0/Y2zDrunW9Esc8pMAMH459inTpkyhC3 Bc4n+vTIMqa637z5hzVjFrefzF4XjLOvf1Hj5sKeX42fD6p/1it9X2JMIFHSojDmlAop np4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ixJswn5K; 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=ag3mjcXF4/g/bZ+pXECF/2hoju5/PTcjKtb9bYtqvoM=; b=h4JHZs2N84P/3sa9iGKFZDiXPVzoIM5qSATyZJ3tlb7DxJX1p1OAZG8Qtg5Eoozo95 D3qTvlAEgZ2FN4xd0TAMrtR3p0FlwQwtlBmXmtbqPnIuNoN1A+kTReehRAd+4mIfW7V/ y9+rlYdIGWV933Qi85pX8z61i2C+QXzUiTurE= 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=ag3mjcXF4/g/bZ+pXECF/2hoju5/PTcjKtb9bYtqvoM=; b=gKdOnZjgFLUWzgZ5P1Ga56WPoZqGW0K7GTednaWxJKCnHL6PkVOlgu9aH93l/nlb7r BS86xZ4zS5SybJLdGM9rZLT9vKKsyTr6w84Ctz2W4bIHj+WztoB5UhliBQn6IaeDZ3qw d2HiQJYIWSoGuzURVnbUAWnZzcF9O4Kf44oMbikm2pAaMhRXn8oECSutfMugbBbCN+tz pRFl3HdXJT0ltjyvHcBwGVrCYSu/RFlsxBCnoDznfiqcXwGfp92mz0P34+mbsZAtgmEK 80gM1BB/tDe6+cv/ySNrhfSd4LHrGD0Xd5GgC9EewFuc6vJYxk/D/M6LMDd5wAX//u1A 3viA== X-Gm-Message-State: APjAAAUtVr6QSU6nhWqlTKEK1RT7Xkmxcedt/N8qLkaE6ZB5S9TtuRNw Li7ynSy3IOyi/0l5SOQpqo8Q+oSn X-Google-Smtp-Source: APXvYqyQD2rWHDBJqvnNMs1OwBGXyldj+8x1qDQfhobtY/JgYDbXt6dA0HROXcZ32JRjf/X8dlpY9A== X-Received: by 2002:aa7:8108:: with SMTP id b8mr113955959pfi.205.1560757115339; Mon, 17 Jun 2019 00:38:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3227:: with SMTP id k36ls3161192pjb.0.gmail; Mon, 17 Jun 2019 00:38:35 -0700 (PDT) X-Received: by 2002:a17:902:8a87:: with SMTP id p7mr89552607plo.124.1560757115068; Mon, 17 Jun 2019 00:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757115; cv=none; d=google.com; s=arc-20160816; b=KY/vsQNfz9rL19dq18XqvMHsg5/O5G+JYV7H+29dqgMcSZycR2aayuEQamShLcaDyh fJ59aha5HZ17nP8xE7/Ub0ZX2szfiV3tXS1X6FhfwxPNeRDjkS1fjVgpLltyF/pe/3dc 0cK04RKLQjSJFO//QsYebbIhBmOgD14nqUzv3fbt8NWhGT0cd6/9C2ME2CRPP4rQyVTp WJn6A0YNE1g86Y6dEezMXTrlA8LJ2W7GVPO4cKRQIbqQXtFnMZwzyWAYWw3Ah985DMx5 E488I2Ts0YFQ9xaj9OakDX0kfxFcnqKj9d1VkwmYTBEQQjUCH+mtArL5ghVz7l5hY58M cgUQ== 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=4Ewyx091h4mRyHoH8WvRSO8OxAFw/6D2YuRsHsf9WzM=; b=YG0GLyjOnn+gfi7l5vfD3sHk359K35LQNkZW1D8MmSDmy1fz1qaAdWAwbqCq5bIDZA JMV8VxU1GuTSWiSskjqlDg3bnFhIYBEsOp1O6XLj42FkmVRQh+1P2yQJRuQQqnm533fC CeopaAYNmf2oWqTJjOI6fbm1mSipoywmDe5X4ra4EVxWQ4gO6Lzi7T2wcnvg+ry5LXY/ kecqJ2y2PLwjIbVFEAV39n0ol3etONmA583alRAkFQvrSc/1F1RRjmcpgHQaiMVojVpB zPNBFcZYAoYtvp61DnQsV5xkMqNvSm+ub+ivoCMyp5bDDNirjaEn2/yct9cRNpfEkY9c KmKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ixJswn5K; 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 q62sor12243794pjb.10.2019.06.17.00.38.35 for (Google Transport Security); Mon, 17 Jun 2019 00:38: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:a17:90a:bf08:: with SMTP id c8mr24822533pjs.75.1560757114714; Mon, 17 Jun 2019 00:38:34 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.38.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:38:34 -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 40/99] ram: rk3399: Move common sdram structures in common header Date: Mon, 17 Jun 2019 13:01:53 +0530 Message-Id: <20190617073252.27810-41-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=ixJswn5K; 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 0eb068dcc0..6b75de5b6f 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;