From patchwork Tue Jul 16 11:56:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 750 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C3FE63F08F for ; Tue, 16 Jul 2019 13:58:02 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id a5sf10070539pla.3 for ; Tue, 16 Jul 2019 04:58:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278281; cv=pass; d=google.com; s=arc-20160816; b=Lq2pDXTOKdueK9KA9G7kHD1XWzl9duYgV5EskmTzLh548K5uRg+tIh5+UxplPT2bLZ tjs0c4csCbco4FsFF9WV1Hzgp3o4/gy8siegvgp2+KdGZlKszKoJryp47apetRZXxvQA QrhihDhIT52GB3DzHX4waJ1tP96bZmVrAfCd1UBQotp2xiN0AF1yYoz/8mm0YXAwG2bc y1sJRsYT+CL2DNKo4kTk5dGvEM1idDX0DRLRz4XsltuQxri8Iipj2Vx26eNaIwrSUi8o KlZn6VOo/SI0UPH9O/ECbvpvHN/lUW2aoJDvcZuyPhIMpKXRtnpU8HupweTUT5Ny/v0O 2BBQ== 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=AsrwrAPeico+fuEb0O6zuw+w5D1PTveQKj49KbvgOX4=; b=mjiq8ZDFbAr1Fmfz1yVm/jQuTcXYjzmdb1Kn8sD8IkBjlCB3osBve2YpoaPKGkPZZD KrN+ZvudNIvMFqjviAWghSShDZO2AUraU4KdWHAjt4vEgcFgHkFXmjwJrZWF0QKnwmWB x/0mmFgbvj3aZK3wR7mI800nBGUZaZKi562xDjTTHVRGN2vQpjT4JteVyewcJOcDb1Xf mBirsOJnDtOmTGwPg2Fcm4NR5brbtF2CwjY4Qk1Vqo/BiMBHfUXBNQ0wZx4dQjT9+11i t9kCl3u3xRHc+Zv+YS/NWGoe0n2fnyCO6VnQwXoOpFBMWwiMO/YksfhyxZGTjp0eU4c6 +aFw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="iVIx/jB2"; 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=AsrwrAPeico+fuEb0O6zuw+w5D1PTveQKj49KbvgOX4=; b=mURdwTbXvz9BtELSU6C/a/6CFyqLMRFoxliLEIBiSTca3izKhcIUuzCm84/ggG6KmS tp3upjVAwMw8bhrC1usgEU6jsYAR86VvN5huknSAA4AVF2JkVxLlz/ddwFJVisAcsAnA +V+EEpbYBezXyWmmGjjU5bRiC+Os205jtHU2Q= 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=AsrwrAPeico+fuEb0O6zuw+w5D1PTveQKj49KbvgOX4=; b=Hg2wCa71wfihAZep9gRv8nYH3rTVqZFPmosra7OcY7g8deX2a3rYf1G3/4AtPoybf3 XnCxTv0EjJkQWi0hWsxN69IRZGSpz/eWuTlTu4Zt0x80SbUIE1kLY40EqVEJ8qdLqCn6 rhc3J0m1gltnXEbFa98XT4Fkp7SzB5pMUwmgXh9om47RxDymQfnGgU9Bmq1Vt+CwB0Pp flJXsOegTLYm6waVfnVXGZ1IyueENwcVrRLWYxD8MeVkIB2uk0scPHzF4vBPNnl0Xe2i SkVOKFvK3yodxaP3i9Hk4ZmuZj5BSNhYbdqE9cSQTWCbkuWrw+DLuxnVs7FkvBkXAMDh idlg== X-Gm-Message-State: APjAAAVwQL5Nd86Vh+/Uy/7CJLDXSEvx4wTtd6/sQjM/LDd0FuBFUAQe rUT3VU9GMdW7JMX52xac4hWGNeeo X-Google-Smtp-Source: APXvYqzipbzV/MpwG/nmIPOGCKRVQKJHW1IXx97rI/eGFnV3fex9i2FeRcmZCV5qRVeLVR9R90PfZQ== X-Received: by 2002:a17:902:2a6b:: with SMTP id i98mr32947054plb.75.1563278281080; Tue, 16 Jul 2019 04:58:01 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:a60b:: with SMTP id u11ls5463229plq.8.gmail; Tue, 16 Jul 2019 04:58:00 -0700 (PDT) X-Received: by 2002:a17:90a:384d:: with SMTP id l13mr36247649pjf.86.1563278280763; Tue, 16 Jul 2019 04:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278280; cv=none; d=google.com; s=arc-20160816; b=PN0Zozqq7SJDiIiKQtAliflDZ14ZfuF1mZWuLDXZyGi2awNtmVSbkNsf08ppCn7VZp tIEqZ12WROuI0A7IptVlD0nOE4KeEP4jHFo+ZzzZD1DYQQO5f1AkJW0wOdegikCeagQD ESKYEabOzTG/6d3HcGD3hS5xX2fUmEPSjzTi34yELRcM9/aGr1XCHS/ZMGISaRaDYUtX 4Eb0horzgskv1+Ur20nbpPpXaxj2Q+aIvFwSwoc9vk4AZEbaQQg7ngOds3rtna85hs+i xaDZA144fbiPXAFV/5RzVGQfqwWTBsdA8SsjpHBsJR30H2vhbKrcRw2kmeL7ekUdGqU2 tWWQ== 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=O5x4OMbaIqox/kteHap0vjhkRYIdbYmgiXXORgFTXCM=; b=Vmwz6B1qgmkA/EFAXy9EPogH3goWH/xHLZqXB+hYOv2WP9guBDjBPi0dw8eq4tDGLG IA3KF6W/5oMOd+Jtdka+izRXKK3RveqwIC3oHdEUUTv8d0bqg8MvNiKtS/kGOmvxwN3e iKG8H1kDpkD0O7Q5HJ4qnfJk01Phvve3BkGaugE3AHp14pANFdM/rF2K4R+q3LOeOJQ4 V65hKd8E4azivRZrjPVkGGufNi5S89EVVYhRWHTR2COz58/nr6vigWKLVRxnaA1SySr7 3GNiApBnq3H58fO8bgOzYI9AzFOyz4H5eWMvxPrsHjZadfRg6nV/CEbGJ1fIlbNqERDi mlJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="iVIx/jB2"; 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 j39sor24711593plb.22.2019.07.16.04.58.00 for (Google Transport Security); Tue, 16 Jul 2019 04:58:00 -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:902:bd94:: with SMTP id q20mr23824951pls.307.1563278280217; Tue, 16 Jul 2019 04:58:00 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.57.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:57:59 -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 01/57] ram: rk3399: Add ddrtype enc macro Date: Tue, 16 Jul 2019 17:26:49 +0530 Message-Id: <20190716115745.12585-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190716115745.12585-1-jagan@amarulasolutions.com> References: <20190716115745.12585-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="iVIx/jB2"; 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 simplified and meaningful macro for ddrtype macro. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 1 + drivers/ram/rockchip/sdram_rk3399.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index b7549f5d8a..92a4c485c2 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -72,6 +72,7 @@ struct sdram_base_params { #define SYS_REG_ROW_3_4_SHIFT(ch) (30 + (ch)) #define SYS_REG_ROW_3_4_MASK 1 #define SYS_REG_CHINFO_SHIFT(ch) (28 + (ch)) +#define SYS_REG_ENC_DDRTYPE(n) ((n) << SYS_REG_DDRTYPE_SHIFT) #define SYS_REG_RANK_SHIFT(ch) (11 + (ch) * 16) #define SYS_REG_RANK_MASK 1 #define SYS_REG_COL_SHIFT(ch) (9 + (ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 9a60c24135..f58836c037 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1076,7 +1076,7 @@ static void dram_all_config(struct dram_info *dram, u32 sys_reg = 0; unsigned int channel, idx; - sys_reg |= params->base.dramtype << SYS_REG_DDRTYPE_SHIFT; + sys_reg |= SYS_REG_ENC_DDRTYPE(params->base.dramtype); sys_reg |= (params->base.num_channels - 1) << SYS_REG_NUM_CH_SHIFT; for (channel = 0, idx = 0;