From patchwork Tue Jun 11 14:50:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10987249 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 E8220924 for ; Tue, 11 Jun 2019 14:52:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D836B288A0 for ; Tue, 11 Jun 2019 14:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCBBE288AD; Tue, 11 Jun 2019 14:52:49 +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 8077A288A0 for ; Tue, 11 Jun 2019 14:52:49 +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=++EWR4XDbvxrxmhzy4tG5zsXOF3peMDCT+z3/hri+lc=; b=ctUgf2TY9BNXvG rUYU+KuGxLBkZoQFnDVb5+is1gx0EqYSX2vhy+AbOLyqhy3y/6wAkcGvmvx6w3DDRsmBgjku4iIu7 Q98bN7FzIGSYUo1WXER71JHxGKJhhXYIZgGORsLn8ft+27yXvdB9IMhj6UYa9PzFJ1q+3PUf3iVqc h250CDk3K8jY/pUrsQPpr+9UbFZaS6Z8PaMjSvAB4PrdTByOrVwfdgkmRC6W1slRI6AOYwBWataTc lGBcYkBJkJSYjE6/GzSXoIuepymdbP6YVEeoPPuHX73z1mqEiqPKXatm1acsqVW/W+NSDaUq9Ia+u DIUjPhCPZsHHdqTGyplw==; 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 1hai8l-0004G2-Dp; Tue, 11 Jun 2019 14:52:47 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hai8i-0004Dj-HK for linux-rockchip@lists.infradead.org; Tue, 11 Jun 2019 14:52:45 +0000 Received: by mail-pl1-x641.google.com with SMTP id g21so5250998plq.0 for ; Tue, 11 Jun 2019 07:52:44 -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=IHluQoWa4h42xR+txLhRcp64NWWrhw7tiyZPWbXNKb0=; b=ASLb+1BID8e84GcSywgvStVbS4ZmhzRghhW8aqhU5cLgX0xJN7cdlc0b/g+WY4XRSe H1LDXB7ohSukEupcI0h0QfL2bMjapblxU2vDdawXd2IMnVx9BZLmZUTuO7TFG65TJ0tD WTyfINhPWV1NoTXV7bE4aI5rCdJHe2sqYD+rM= 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=IHluQoWa4h42xR+txLhRcp64NWWrhw7tiyZPWbXNKb0=; b=VJITxbhj3rUywniAG5fjKXKkUuidV0wR664jkd+SEK9a7gDL/CEaYI1IF05v/y75ou Mtiiq7GqtIPLBB2TIoZLEID+P/xQzuF/tqHK8poujIIi+KM+40Py54927X34SUiTNpXA XBI0muqNIC0crmPDkWpClAHitPeb2tZl9v+LHrdzfGCoBjVaNE7BSlb0nOB/ILisBhnp 47mJDSEH235lhEjj3mqS7UVXWvoYuliTPX/qe0vztNrxyHFZgIhMVYWO3nCTFadhDjMU GwEEWNEwaX2mJ7RaOZ6R6nSUrnC+H/Xrt142WdBjaOAPpYt6CXJzKwAA8B1Wzd15d82V bzjg== X-Gm-Message-State: APjAAAXOl5hAjt3tKtc1DfrwXq0ojIOMPZlyMb/y1OFUzMk2ldr+JKSy Qgj5t5lsPGTW/fkfb/4MLT/ZPQ== X-Google-Smtp-Source: APXvYqzwWmpqmPkC8h8aSBr4Hu66vuYxmAW3sNZZ+znBno1odVrEAGa615/DUR26haOrxlY4sosUCA== X-Received: by 2002:a17:902:a98b:: with SMTP id bh11mr50050749plb.8.1560264763691; Tue, 11 Jun 2019 07:52:43 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.52.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:52:43 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Subject: [PATCH 13/92] ram: rk3399: Add chipinfo macro Date: Tue, 11 Jun 2019 20:20:16 +0530 Message-Id: <20190611145135.21399-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190611145135.21399-1-jagan@amarulasolutions.com> References: <20190611145135.21399-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190611_075244_693377_1D2393C4 X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. 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, linux-amarula@amarulasolutions.com, Jagan Teki , gajjar04akash@gmail.com 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 49a5d14821..68ae8e8371 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) << 13) #define SYS_REG_ENC_NUM_CH(n) (((n) - 1) << 12) #define SYS_REG_RANK_SHIFT(ch) (11 + (ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 0a7137784e..0feb5d1e10 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1022,7 +1022,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);