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: 765 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 376193F08F for ; Tue, 16 Jul 2019 13:58:55 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id i33sf10059921pld.15 for ; Tue, 16 Jul 2019 04:58:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278334; cv=pass; d=google.com; s=arc-20160816; b=QrXgUtIYSlQ6gjPHWPlFJRzKl3iVDTdeBXdIp21Yb9ytmqlvvq5ABBoZDJYsm3mC6m anqM0Vx20yd38gkhxpSOjxZXtHAeSSOShxeTTwADuyoVmT4YyPJyDQPsbijCfSp4uCG8 /6E/hc+knhF+eXFDu2pCpRiczwYrYSqM59RmPlkH9kpmgTtwA5YQPnaxVR/i3ErZEPsF xws6tWh1mnD/b6MwXom8B10z7ss0yxVTjbzgJaYMopQzzBp/QNSB1p3BmR6JizjLsNIW kTYZmGTnEMcc9P7I5df1ZsWBuZCPB/CvJx4S8lRL9shZZTqLYCBGEiPmRq5MLTuSGsfr MzIw== 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=shzlnvB1tKsUDm4TWvvahaie8SzBefWqp/KYlBiBN88=; b=D+q66u5K/37nFiO9/gCaJjAHy0KxwesJa7+A4bLQ9T8jzsv7mis9iwQ/nz0Ehx05TH 5VbUYGXZ7f2JWd1DSmwOZ5BVV3coYYEa5IWCoUc5fDSyMV95Q97aKXG9ypNLP25vKCpN VhWaiVpCsZ/Sp7ADIuhGJSB1Qj/2wZpfModZPbWXa9Z9t+Se6Ct9ZYiNc+nyRgLhmxm9 xQ/VhC01v+M0iCIGyUpXHrC73zPlrm/gIj8zHlTkZLXLZjupbT6kqdqlguo0amS+KHsb wT/q22hAK+ZIwdAcvlGLF5Z2eypHbMCHIAY9+v+t+XRO7V/rLnS9jtofIFbl28lTiGfi 8oHw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="BB5+fUg/"; 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=shzlnvB1tKsUDm4TWvvahaie8SzBefWqp/KYlBiBN88=; b=iVa9ZocsDBUaHB+syqpgAMzs9Doqj1vIbgvNvjIvLLHJqGsqJWvMyO8jfroa3L7YSZ EDwY9LqpDE4YpLS/kDwybGwToJzs0yvVZnyXhHjoBRkEgMzCZfGgljKilIhwYISKar4u I/AlsVOUMkGw1KUH8GKbp93OSQzJfXeXO2NLA= 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=shzlnvB1tKsUDm4TWvvahaie8SzBefWqp/KYlBiBN88=; b=BbW+ZjQzMnbxhbc5cdBuBt8aIWNeezRcZE607jnF0Cz/bX0QZm4kDkz9GNyHnj0By0 89nII/u94gHGCm1T9Wvki0nM1n9y+MrB4U++etUxKt+pU8UShFCju592uk+SLktwWAx0 Y6EWPyIZDUZr4NjpLbFji0XjO0HjPhj/DThI9GMfBRGCOi58FHDQZMZPFub0V/otMlBg gDtNBygen6ITfGlMyVOUdH9rQjGeIGgwA8hiiYu3DjxTUv1Y2uLFraXWuTrHDJnYUC+5 BL9gofu1yn0BE9FQREvBiI8Gr3C8319/HEtH3PEy0BpYNGHNj3sZOBaeLotHznKlTzsj wXXA== X-Gm-Message-State: APjAAAXdNzqd8EUQIess0c0oh8TcHvlAXshQg7G2lRZTxJArqISDMtnS fhErpcKMhaAmhSwFnvwYtYVx8kBZ X-Google-Smtp-Source: APXvYqzn8KkE+MRQ7grKjfBuGVDyhIX/K7iBtnmF2+nAUQSEN+aQc0cljdl0FXUaGiW2oRGrRTzK6w== X-Received: by 2002:a17:902:5a2:: with SMTP id f31mr34354652plf.72.1563278334012; Tue, 16 Jul 2019 04:58:54 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3227:: with SMTP id k36ls7085753pjb.0.gmail; Tue, 16 Jul 2019 04:58:53 -0700 (PDT) X-Received: by 2002:a17:902:a9ca:: with SMTP id b10mr33839744plr.69.1563278333714; Tue, 16 Jul 2019 04:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278333; cv=none; d=google.com; s=arc-20160816; b=C3klN3mbQsf4N4bQvtTAORL/rZdUQTjfuRNCX9RZ/6J9GnoAWn8yUPtYELoXl7EnLv i+uUM29QbT/OFNQaPF1P7zi1m3Nqrf1Uc7nWxIDvJDGSJXFIY/O/wjdIn6thhYlpeULr MfZtLr5afUgGIbN0JttTke6hGAEm7gPYmDfq9wzjznzn0kyBlhySJ9L9kuNIElATYNwc JEcfI5pg8QN9fEH88qzsuB5xVAlqTJ/ue1ODYJGM4CJAQOU4QbmHS5g4+Ma8f1gRm1Q2 olQSrnT950PWlQ4lz9HzvmKIlW3C54OK9meGmbm+ZgfvE7nsB6NsusXFgcf+NqIXbrPr uxeg== 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=I1cEsNh4mNq3M6cYDF3QUJY54q+jdm52RlOVjMiFP8k=; b=ZVFIJfeOYPGL5z6mOJr2srPi2UE5mB4vxrc9Tdq/CXEMFtZdHpt595QCahY0h9Dgiy Qo/IxLZ3hi82C/Pwe+Yfuq2bDrTyE94giIsePNRbjOb5bsjmv6Nf9jBuW/f/jotSISQP /UbecwvpSaiV07aTo4/mleJP7cNvd9cHpGqoklbCdNyGoeXM2oe6PdAfdkmLbW9jM1LN mZbnbH51MRY0Xt/rtXLoIb8yYXPlOYW1PkVJk2XdjWMOcUong2dkrFOzBQU5fAoR25Yk 6fqBpU7gCUlcudI5Va9Tiv6rLg87Sik8NJhSSrODjl4cHUGrZsLlVejsIylwj2qgdOPy 4Ovg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="BB5+fUg/"; 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 o21sor24660583pll.8.2019.07.16.04.58.53 for (Google Transport Security); Tue, 16 Jul 2019 04:58:53 -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: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 Cc: Manivannan Sadhasivam , gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 16/57] ram: rk3399: Add ddr version enc macro 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 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="BB5+fUg/"; 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 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;