From patchwork Tue Jun 11 14:50:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1113951 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="mncECj6C"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45NYc45b02z9s6w for ; Wed, 12 Jun 2019 01:20:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 58326C2215D; Tue, 11 Jun 2019 14:55:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5470AC21E0F; Tue, 11 Jun 2019 14:55:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4C622C220CF; Tue, 11 Jun 2019 14:52:45 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id 1B48FC21EA8 for ; Tue, 11 Jun 2019 14:52:41 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id i189so7580709pfg.10 for ; Tue, 11 Jun 2019 07:52:41 -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=lRP180Ipi3gVE2/vJfC3zMZ5wLFrHYhOkBITeXZ444Y=; b=mncECj6CeShZlpIKsJAWj8d/7ZKJOZ6lOAxH/mMg2SUM8wze5sxqHg5hCk4WSAqwIt jbSGlYA6Mh8ck9qr9gOfUwTQ+B3Ln21ksbM6e3fER3X8Bi0g5kv1QACxUYsC7wDqAK82 N31XoeeDxv6cn8QIn3rNcrayzqpvCRmqHAK5E= 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=lRP180Ipi3gVE2/vJfC3zMZ5wLFrHYhOkBITeXZ444Y=; b=Toto7UXDGWO4eyJhSEbCpeMi6gY8E+rWpog5VVaXocrNI+xos7/UJrZm4sy69VNJDH 59cxCqTwsrgwI5wKHR5dbZsCTZbJsN54bj8fC75R3nAPnrJBP67cTw3+Nu1rOOiwNmQV 3xeXNAOfsJnbyfFl/uLKv3GaCI3pKkjZMbQPpdDwxHuHnYdhSvjxKy0qTbhPzsLVoySF DsYVO5V+aVH/6Cpu9K5NLGVoftVUZ2+V4J5bKKSZovlUOARJg6MiNC4lgzskltz2dKcE +ecSXuCXGnJLuhdX9k7PISdUGsjVA7IxvbeNzs//GsxFHgW7MRRUYbamHnAN1TteLunY jOhQ== X-Gm-Message-State: APjAAAWI54OJdIdbA6h/Cnv9AOvM/OiHXe6IqOCBNwfR7zswvnJpBYc+ kZhsg6FV7VlyuYgrz2S+jK5BIw== X-Google-Smtp-Source: APXvYqx+/rGrJ+0oxzQP0Xc+kMIpp/Y9BP/dTnI+9ATJW+5l+bCyh/XPgsQJ11DRRCFCcAUNcmfaHQ== X-Received: by 2002:a17:90a:bc08:: with SMTP id w8mr27864299pjr.45.1560264759657; Tue, 11 Jun 2019 07:52:39 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.52.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:52:38 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Date: Tue, 11 Jun 2019 20:20:15 +0530 Message-Id: <20190611145135.21399-13-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 Cc: linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, gajjar04akash@gmail.com Subject: [U-Boot] [PATCH 12/92] ram: rk3399: Add row_3_4 enc macro X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add simplified and meaningful macro for row_3_4. 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 38a8bb8642..49a5d14821 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -33,6 +33,7 @@ #define SYS_REG_NUM_CH_MASK 1 #define SYS_REG_ROW_3_4_SHIFT(ch) (30 + (ch)) #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_DDRTYPE(n) ((n) << 13) #define SYS_REG_ENC_NUM_CH(n) (((n) - 1) << 12) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 3d2447a24e..0a7137784e 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, if (sdram_params->ch[channel].col == 0) continue; idx++; - sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(channel); + sys_reg |= SYS_REG_ENC_ROW_3_4(info->row_3_4, channel); sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(channel); sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(channel); sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(channel);