From patchwork Mon Jun 17 07:31:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 585 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 57AEA3F072 for ; Mon, 17 Jun 2019 09:37:09 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id a125sf6554766pfa.13 for ; Mon, 17 Jun 2019 00:37:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757028; cv=pass; d=google.com; s=arc-20160816; b=x+yoG59SkO07JQvKJRDGugOj2WCiQor0VqA74Sr/kkklTDR5ZtKVv7BcyoBj9/g6AN qRO1Vz7h+lMgUY3Qsli8CgyQIf2/uJ6RvanPiakpD8HgPV2gFzqkn0RqY4dDbZy784AK C/6r19pUFMAW+Mk2mIePl5I9V9odKBfhYizhw8WIUbFkHsVg71Jyemsywrolq/qwAiqy LkvHdJaqEY2ims+I5aeLVovrZX0QPDRQnaN4yOi0r6fKWXG2FGhuou2CtwzYLMD/PLwJ HLsdLmzC/SUYpK4H7BK1O8OboJeoLBVxmb1F7DI/u0TrSDHr+ytl8I2c/8kVbt3TSFCN bRcw== 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=WvSY92ePnYM+XFSutn+1nrqkZIVJFp7gWWxHQEFwL48=; b=ZEHxD0bt8xNY1HVWvFrFTwJcWYZjLphVlqdKABbXRjBdESUhkiOQpidcMnUUker5e4 SQLnl2y8KtPnp7ErMS3uDDrgCR1nstII9X++K6CPBVrwvc9G/F4RwhXyuCNAknVV9vJM I4WpwfH91eSgz+RlexOJR9CJNEjNom9nIy/l9QyIm0oyz5YA6+K6M2PC327sHuFYxuNV kjt75x0bCR3Eor4yqTdVtENsFp3aT8EW8APke4t0zU9xT7njPsSnYTRzEaIC/sY+RZij 7CTxMBT5tbeATKlcrJxBDp52Vz4ZQDoHUuAJMVkafMmjdp+Olp5J1jkGmBq74E0piBSt EutQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ge66l99q; 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=WvSY92ePnYM+XFSutn+1nrqkZIVJFp7gWWxHQEFwL48=; b=fwKE2rNeERvNuWY99f4pPbVbnk2lOLrGiNnOzqLcQpzA5q6rwVTTtls9mo+xhbxfJI typKsVpcVgPEPsrQ4LC4Uia6yhptGM0pLi4Dzdt0lMkmW7LvMbQt0S6zDltJ/jaLSO0u EOKQvosbCG2N8C9F+KJwvCiVpeFTLYPQFaDWI= 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=WvSY92ePnYM+XFSutn+1nrqkZIVJFp7gWWxHQEFwL48=; b=pEk2XMQDgh0gHkSJLSPYphQdeMq37T+4kgKQZNZ6MuL/pHfdU5wCOJQ8QuuFhZpZQS T1nXXV3SnboLhumKgztnWDk6K2LXFL90cBjVX6+6I4RF3qISCL06RwGoV95xJhE/+m87 NI0n2pZVBGWELXnMs87XsZUVuAu0fIGWtG3a++B0oWeZvddHHm3EcpNG55jSjTFlzZUI 0TXlU2rN04Qg838B0z9p4k+u/SRcWtXELTG238NGs5W08x0AlT7ExXdzN7J9G/p0Jb1O A8HIf3pI3sv5eSmtevlumCHqiRAF+0Dy3O7SDKNi9IpqHipJ2lxXzBik1r1V3aGQQ2Cd wV+Q== X-Gm-Message-State: APjAAAWlyHoevKKTXhAyuWeULxzdTXX2VQWQBOdNFUk8HJZbgMoNxD7J 5MA+YLdYokxGOLZLdUvSpcgTKJKp X-Google-Smtp-Source: APXvYqyiz/E8EnJ0GZ6YdnGEThg7JgBgxv7hFaGPDyvK1qoT6L+twcNLFnXCqL40tEzv1K/iDY/ZqQ== X-Received: by 2002:a17:90a:9f93:: with SMTP id o19mr25085941pjp.70.1560757028212; Mon, 17 Jun 2019 00:37:08 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:6184:: with SMTP id v126ls1586864pfb.1.gmail; Mon, 17 Jun 2019 00:37:07 -0700 (PDT) X-Received: by 2002:a62:3741:: with SMTP id e62mr113569814pfa.213.1560757027875; Mon, 17 Jun 2019 00:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757027; cv=none; d=google.com; s=arc-20160816; b=rUF+D+PD/VpUmw41Ft+Grez3UEFNXPouPA9KdJzgMAHZarP/1CLds56JSe8fziZ70s Ns9biITrkE3vPbk8aP8YM5sXDFkVfK1f4pnx6eZBZ43mTlmB4OO3Bd+6xmpFB0q18MmZ C7tfbQbSute/dR705iqRGzRCv++YBgJLzn6CiE1AupKnvRVyZG78lp/hTU0srDcCu3Ve 3aReTs0A9DPpRPy+kCVekzJW6d7Jsp9TvpXOxu4QO8GBYRpW2Ur5SnYP9Z22H56nhQUm nXErS++DM1kNeeldlRF8f7E0jna/JRPmENaJh8UJWmK6Q41chFglxpLvz1Fwh8SifE9F EDqw== 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=HDDzgSg1T7ysLRxOk37SCsYqNfotDW81GKuZvXoig7o=; b=PujGk04UIKTsemQlnqomlUIZLC49XVA1tAPoykTbSrIB3CcZaA5SZemilyFhqp3YST xYbmgTjd5DMMNtXC7EnZCyofqe+n3UcHC+d0RcIsPEHPQOecwZKk+818Mv65Pi3zCeCC /lnIlKLoeFwUGrUDJwFUFhAH9c4BMxsz1Z60SwE/1Bsqa32DKO/5zSNChWIU12Gf4s3r p7EfhMNGeSIdntCdgkyypOAXTkrxruKB3OQafb9k7SDWhGMMUWxOf8z810/Tc78lWMwM FA/FDolfmug4mt8oemRKSrX4r9E/l/Qil5wa+cvAM+eNegy3qZ5gk89h6c2mm4J+JCXg QofQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ge66l99q; 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 s10sor12314894pjc.5.2019.06.17.00.37.07 for (Google Transport Security); Mon, 17 Jun 2019 00:37:07 -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:db44:: with SMTP id u4mr24758976pjx.52.1560757027565; Mon, 17 Jun 2019 00:37:07 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.37.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:37:07 -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 14/99] ram: rk3399: Add chipinfo macro Date: Mon, 17 Jun 2019 13:01:27 +0530 Message-Id: <20190617073252.27810-15-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=ge66l99q; 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 chip info. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- 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 edb2ee50f4..d7d44749de 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -35,6 +35,7 @@ #define SYS_REG_ROW_3_4_MASK 1 #define SYS_REG_ENC_ROW_3_4(n, ch) ((n) << (30 + (ch))) #define SYS_REG_CHINFO_SHIFT(ch) (28 + (ch)) +#define SYS_REG_ENC_CHINFO(ch) (1 << SYS_REG_CHINFO_SHIFT(ch)) #define SYS_REG_ENC_DDRTYPE(n) ((n) << SYS_REG_DDRTYPE_SHIFT) #define SYS_REG_ENC_NUM_CH(n) (((n) - SYS_REG_NUM_CH_MASK) << \ SYS_REG_NUM_CH_SHIFT) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 26bbb4208a..7d071f998b 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1021,7 +1021,7 @@ static void dram_all_config(struct dram_info *dram, continue; idx++; sys_reg |= SYS_REG_ENC_ROW_3_4(info->row_3_4, channel); - sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(channel); + sys_reg |= SYS_REG_ENC_CHINFO(channel); sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(channel); sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(channel); sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(channel);