From patchwork Mon Jul 15 18:21:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 726 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3E9003F0E1 for ; Mon, 15 Jul 2019 20:22:04 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id 6sf10718435pfz.10 for ; Mon, 15 Jul 2019 11:22:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563214923; cv=pass; d=google.com; s=arc-20160816; b=XHgBV/DaNElLpyHq/0BcIO3+NhWPUKiXZr+FYY2iZgKDmfj9zD46QOc84AWRLhbB/o pLXfiWqVevwPAh649VbZMaIWKBeapJHnwrGoWVQGosH/+b7zbsV4vvoDee0BhMKzuAkX Tb4b5aY+6BnAgo57Q3waf9i1hyuxoXN97zLAR2De+nh2NZgGKRp4EpHRH0m6d5ulNnhX ++NeG4n+dwRhNSKsOy4M0SrMx1pNuKtpdkIjARXWMixJoE6V73j/pYv1L+J71IxGd+Zy MjbHsUABrC95IZrdMz0ipfyuTiCON5fgXxta/5VBY1ZENARtSYUUphHpYocJ9OM7Rrev IdjQ== 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=wKjIodNveQmbgHhcWLojl8Isiz+15KLp58753K6lsxM=; b=UVHioWTj0saWcRgghL4A9J5xTOKnYextdNKkr+ms+tPxzE0WgSltux+S+bStAju94C iCgreVDINlOGCAAwPHExmTKkbZzx5dwQVKJxsp3ZP0fQhsMtrywjYqJ1jDE9XSGVAaWg 1iCBszDoxsCh8xfx/+Bw3PnEZTozTSmg28CfSUSdSDntb9Y9g3QjQkcMOUGaWbhb60G/ FgitJVYfeBVbsLh9zddBu1zQOMvTHe9xd92azP/YXBuUqQVWhqcuMbGpYgsg9CfQiXkd gRKlrh3F1djg4CIXC0shkhbdAd5pjsCRm+uydhFLBLS9Za7GyEhII+zRg5eu5Z5zCnmQ a1OA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=C9ix2b+u; 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=wKjIodNveQmbgHhcWLojl8Isiz+15KLp58753K6lsxM=; b=gj12Wdf7yl1/+AbRMbC5TzCzVz/+Quf+XP52i5iKkZd8ySWkDSsb1Ej2ku3gDOxi6l CjHCFnAx9/EUf0a20G3CoXFSgSwYBCm0svApCamJ+80nxeSfXY8yKTwCzmPdQbK/dMl2 a7lBX5okfpsjpIaRR+IDKceP5WhkSUsNQfMc0= 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=wKjIodNveQmbgHhcWLojl8Isiz+15KLp58753K6lsxM=; b=ey2a9MAMfCPFxMzJ+MoizvswsPnJDCmIqXbLDqbQudliy3HUOl3wjJUYE3Wc40oX0t osBip2Uu8+ooVWbRq0cje/W+q24zzJvyci/Voj4w+sF91f3UJofY086vMjWugaBtWoCj B4Zd1Prq27qPjBIZwpeY6hDWW5WjXhJt520108ShVDoAD7Xf/lIufhq0yWYbUCpirC47 /dmUERv8ViyNfLjL5jlBPk30oE9vqcdVXWK5QoCeusS1Cy98eFiJSUspOqPLePO5JkBp 8tPrFwm6npC6rTpDtI7hD6Y3DXGOgxvTWnnG/wddJ6G5MR7U9GYLRizu5FpZz4Wm78Ic cgFw== X-Gm-Message-State: APjAAAUbvb4P86qnYMB86NXCtSBbkYMiATjGKGBN/VqaBZjTlOUzhpcV zV4mpceP4Gg5BlgMNWG/xzIjbuvm X-Google-Smtp-Source: APXvYqzPkfNy1kdBwyUPNjW4btKV/nOFQWxE70KgcnOt0mON1ZHtgAOge8/BXqj7gIwhOHpmYynYpQ== X-Received: by 2002:a65:690e:: with SMTP id s14mr14167560pgq.47.1563214922998; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:a9:: with SMTP id a38ls4714084pla.5.gmail; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) X-Received: by 2002:a17:902:a5c7:: with SMTP id t7mr30328041plq.288.1563214922671; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563214922; cv=none; d=google.com; s=arc-20160816; b=Fb5OKwZQQcxdrHaxvB5rXUaa99CNVwbgAoslOzBFYm0Uz08QbN6f4F5gfHo+xaofl9 bUYzIC035/5Q63uP53yjcCsulwldKe1+sqQTeaDGLkwYFHnlni52vR4KctAI1HI372i7 tQRTs46+pTuGL8o2kuXPOo1cAd0MLqZv5wjzGAtubNoqF9bw0AU89yfyhESE/538bwf/ PwO4KMvyVr3gw+OgS28TNxhNU5nWva1XtnHdU9CGHb3w6z83zMi0Ge29xlhREcWntw5D pkuurNgRRhI9/s1uG+6SkYNSbXegnyCo1woTfNyJx0FNUMwbzbpy0uuH3UPsLypWBIlW kc+Q== 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=GhyKwnagao9aNVYww6EAzysFAFTMSOWzSUv3cqsoz+w=; b=S/8DnjjRfD+vdh94iqLx117JgeRG/hDsNIeM8i4mO6YvD2And/JBEuz9ahwBSbbASM z4AArpr+iRBzlq9Xst+FBa95VeBIxQdoSisEPEXFL/uL8YjUXcCpaiuw9SCae2GW+31f uVE+Eo5gQFVr33Vlnbrxe0f6RnSBcQ1AO6UlOnQKPIBXboi3Z5azoK7KjYcwFbzbdc0D gM+VdKdQRysu++7ShzJ1PvTaI8H+t7P27Y7ACqUdms5jLpMdfsM3ycSMIBoA2Dtf4MLA 2tm/zQXZ15GzudgnfA6Q+amVeYIsf4anr/2Aw4UaTCM+5P3GHM4dzUzb+e6YwsfiU9vI j0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=C9ix2b+u; 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 m33sor21878201pjb.4.2019.07.15.11.22.02 for (Google Transport Security); Mon, 15 Jul 2019 11:22:02 -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:db42:: with SMTP id u2mr30907608pjx.48.1563214922319; Mon, 15 Jul 2019 11:22:02 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id l15sm18152405pgf.5.2019.07.15.11.21.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:22:01 -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 v3 12/15] ram: rk3399: Move common sdram structures in common header Date: Mon, 15 Jul 2019 23:51:07 +0530 Message-Id: <20190715182110.21336-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182110.21336-1-jagan@amarulasolutions.com> References: <20190715182110.21336-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=C9ix2b+u; 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 Reviewed-by: Kever Yang --- .../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 671c318d50..82ce3d3fc9 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 5614b94ecb..65c92cf744 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -71,39 +71,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;