From patchwork Tue Jul 16 11:57:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1132718 X-Patchwork-Delegate: ykai007@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="BB5+fUg/"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45nzyz2Qk9z9s3l for ; Tue, 16 Jul 2019 22:21:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0561DC21DA6; Tue, 16 Jul 2019 12:10:19 +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 27829C21DCA; Tue, 16 Jul 2019 12:07:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D96BAC21D8A; Tue, 16 Jul 2019 11:58:58 +0000 (UTC) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by lists.denx.de (Postfix) with ESMTPS id C8617C21E1D for ; Tue, 16 Jul 2019 11:58:54 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id b3so10006743plr.4 for ; Tue, 16 Jul 2019 04:58:54 -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=I1cEsNh4mNq3M6cYDF3QUJY54q+jdm52RlOVjMiFP8k=; b=BB5+fUg/xMzIEnFcn+fFx7vl91GtrKLYRf2160hl9fuOcsYxeKRDfvaN3lQODvxiy3 Ei1rDJbO0HMqfhPuxF6UJ7kaxdCxpqKEzOo446gnnc0ipXBwymfKi2Gm8f/cBYxP5pxL v8LF2XFS13RkIvM1Orn7FRs5GhEeJnJxvGssY= 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=I1cEsNh4mNq3M6cYDF3QUJY54q+jdm52RlOVjMiFP8k=; b=dyw9chkIDoqEB4i1MYu16kNdHAnVaatX6iaSdzSnTMXfJZ7Q9D0GUjgjbnwb5c5nOf GaExyBAsYMyz5+76jkWCz6o68mN+ZDCIrkQocCx2N5/wDZsaGG8UJ0NhWoM7o9LAwB6n xUx1EvuPDUA0kENeYSoI/SzmMpbn8iJbmyrUSASELgi2Rkzcql0VtBVDeI5/mg6T+D9h EV5QlWekjMtIWZUpP8hFgZyJ1tqc+8Dom09gevCPtR6ZhDU3holvQQPT5rqxRoVaYE04 4c1N7NcDjdA12LqkNZsM0djevOjpSFpOHiMUtM74fgL+b1nR3wH3SWNlD7p+23Fe37yn TIjA== X-Gm-Message-State: APjAAAUct5Z/YoFk+8BYOIEqk/oJ0TxuHnLfZSuvqFcXynWbpzDCcSPV ihJvormEmgBiEQCXYfsip8M+WCnEY2Lrpg== X-Google-Smtp-Source: APXvYqy8VC6ryniOUYDbtaqRlzU0QicXVmZO+RMSxktAqyV4dukh+zpy81lxMPWRiPNzzVATqDB/Tg== X-Received: by 2002:a17:902:b109:: with SMTP id q9mr24807859plr.176.1563278333388; Tue, 16 Jul 2019 04:58:53 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:52 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Date: Tue, 16 Jul 2019 17:27:04 +0530 Message-Id: <20190716115745.12585-17-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 Cc: linux-rockchip@lists.infradead.org, gajjar04akash@gmail.com, linux-amarula@amarulasolutions.com, Manivannan Sadhasivam Subject: [U-Boot] [PATCH v3 16/57] ram: rk3399: Add ddr version 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 dram config macro for handling ddr version number. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 2 ++ drivers/ram/rockchip/sdram_rk3399.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index f5c99fea8b..8027b53636 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -66,6 +66,7 @@ struct sdram_base_params { * [1:0] dbw_ch0 */ #define SYS_REG_DDRTYPE_SHIFT 13 +#define DDR_SYS_REG_VERSION 2 #define SYS_REG_DDRTYPE_MASK 7 #define SYS_REG_NUM_CH_SHIFT 12 #define SYS_REG_NUM_CH_MASK 1 @@ -99,6 +100,7 @@ struct sdram_base_params { #define SYS_REG_DBW_MASK 3 #define SYS_REG_ENC_DBW(n, ch) ((2 >> (n)) << SYS_REG_DBW_SHIFT(ch)) +#define SYS_REG_ENC_VERSION(n) ((n) << 28) #define SYS_REG_ENC_CS0_ROW(n, os_reg2, os_reg3, ch) do { \ (os_reg2) |= (((n) - 13) & 0x3) << (6 + 16 * (ch)); \ (os_reg3) |= ((((n) - 13) & 0x4) >> 2) << \ diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 0f28163d6e..7f6f7d8a9a 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1102,6 +1102,7 @@ static void dram_all_config(struct dram_info *dram, SYS_REG_ENC_CS1_ROW(info->cap_info.cs1_row, sys_reg2, sys_reg3, channel); sys_reg3 |= SYS_REG_ENC_CS1_COL(info->cap_info.col, channel); + sys_reg3 |= SYS_REG_ENC_VERSION(DDR_SYS_REG_VERSION); ddr_msch_regs = dram->chan[channel].msch; noc_timing = ¶ms->ch[channel].noc_timings;