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: 10998083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13F8676 for ; Mon, 17 Jun 2019 07:37:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0091A284B3 for ; Mon, 17 Jun 2019 07:37:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6CB928861; Mon, 17 Jun 2019 07:37:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8448A284B3 for ; Mon, 17 Jun 2019 07:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xg8f/z7fZk6f/m+vKy4rHlXAWx/+mwKKKAJ3Apwlr8s=; b=ZYckoDs4z7b8fL htIvBhPNxYPnrZTa0WANxxoqogXJbCI3t9tjqLnGp9fUW/24RtfzCLX1EI6lAKTphYz4BCI4qFzRX Oy2s2Ir3Euhh8QVz2buSoLn3CMCHZ6CsuD2L4ipj8xYsSoj9wr3G0cUvDDbs04XL1doOL5gjkIvP4 oJDkjehQwKwiHMFX2jzZF6HNwd4H7jwWLvDea8j3Tp/HuGwSAvll8NGFanF3UPX5l8f0tSPN2MNbf /hqjk+eZ1jY47s5DqXoBENmP0KqVC0NL31C9kMkcVOT02Dv54HSThwSasMsdzSai+g3GbymFco9Jl VZmQnAFvnrYxFb63r+mQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hcmCb-0005gr-T6; Mon, 17 Jun 2019 07:37:17 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hcmCS-0005aO-6n for linux-rockchip@lists.infradead.org; Mon, 17 Jun 2019 07:37:09 +0000 Received: by mail-pf1-x442.google.com with SMTP id p184so5183418pfp.7 for ; Mon, 17 Jun 2019 00:37:08 -0700 (PDT) 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:content-transfer-encoding; bh=HDDzgSg1T7ysLRxOk37SCsYqNfotDW81GKuZvXoig7o=; b=ge66l99qAyy5sqtpqiwI2j8DzvtcWDX7be0CfQFNiqFE+RwLFOgUkJDQDaJ1uWTIHJ VM9lzuRk34zWJAVmR0VGUK2xe8hqtZoVUqvfgY1Vzdy3RdKXiFVhGY6ZuMkLSf4MLLD/ +jaY0z5WVor4uIE+/1z7UbTraVAgWMIbVZCLc= 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:content-transfer-encoding; bh=HDDzgSg1T7ysLRxOk37SCsYqNfotDW81GKuZvXoig7o=; b=pEVJw6j8Ph5Ew6ByhqgFunu4XacKPZmFFVPdJI986dlq1V/bYQoO9GCwHqfcCRLZy9 dc4FfBWUwsdbr2wEbjk3GBaCyUT4hPT7x9gfOd9CtCe8ZBeZmmuWl6IPUkbE9kwyMQNV k2l8eCVnpHn9rGdOCvD38HRvjt/j8vRlkPe02+KZKyYPONgJkE9JI46WJWImqN2ImxOX /LgpvADXYI4sR/lANNZj8DKLBtQir7DSEeAXo/N8p4KBiQhbdV4Bsj9WuY4EOBk33Ug7 Cx//ttgPNWyJcpIakzsj9/gtDDTNAo9Ah61+lnqU5fQxVRGz9YK3o/MGhLbckJZDswtW qPRA== X-Gm-Message-State: APjAAAU3WqlVG1SO1Kj/4gfWlurzjeILhLJjLgbHPDBtwbG0LSK6wUxM A9wSazVrRDzicnptBpl2f+DZEg== X-Google-Smtp-Source: APXvYqzjOq6K+jE8qJvIYxjLYs5V2zweS931uKTWZGE6LMqNZQuMySqchQ4dWkW5tqE++NQYfLD7Lg== 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190617_003708_269746_B46510B1 X-CRM114-Status: GOOD ( 10.11 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, gajjar04akash@gmail.com, linux-amarula@amarulasolutions.com, Jagan Teki , Manivannan Sadhasivam Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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);