From patchwork Wed Sep 20 19:56:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13393398 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0891CC04FF8 for ; Wed, 20 Sep 2023 19:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jat2pWxpX645nt5PZT2rk44GBFBP10YcGf+FMIWZEAs=; b=BXRHSiIfZfCxeo Tfr47bMqJDKQ/sXWqgN0scXDwywAKh0LjZsAFxzlb00h7Th64tUlr4vaKZPFafoxfpEFKY9Awxb/S zgx9tgT2JaFwNnYEt6KL8nHSxXIcyUVrDd4p/B5pqJYbZ760+tf0y6lmJ+61OVO6eOU2MUkQ/mb9l ZBAzXcEzbw29U34wkrNCNwoWsB4mutwPJTWpNyr00CJk2Vyg+Vi4TiAEOmVj2T1e0qe9iDccvr9J8 jJbLhcUgjfn0Thb9ewB8EXwjwsPfwLFnPjnA7CoKKTEOFbT/sXvfuewjXWjbJiRS8tXU2hb2k3153 nQR5yyVNNo1/5myN6pHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qj3LP-00454Q-1Y; Wed, 20 Sep 2023 19:58:43 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qj3LD-0044vB-2z for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2023 19:58:34 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-502b1bbe5c3so414159e87.1 for ; Wed, 20 Sep 2023 12:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695239910; x=1695844710; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5gQNVrm7iIcbZwXELuXpCO4/Kc8sgd3nqGULmM7glBg=; b=Uh9TN5p8dH+Vu58YqK6t7ZyyzO+cIP2rw86Z35qTgowEP1h81dElD2td+K4rDGvi1f yzKid1jAcB6kDlMw40O4kBqZFjuhjza2am06B7gxhY4Yzg6FybDmwFJB6ZJcXjTwEfjS 9rmLsIdRJHK6xn1cLQHI36MZrhfBT4xLsK2s3/u0Wr+gmCprR0FieKHXQ5IjRyglFRbg FTrhsHUAsYRhsaKgZ7R0usJlM5RD5Rbz4TEOHDR+ihIv5dOvIa65zVDPbk5R5/SFlIeB floRGRCk9y8q63IO/G1YcohTj2YvzOxDIvswYUu1eVR0U58Yefofl6p55G4jLnlEVcFh IwnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695239910; x=1695844710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5gQNVrm7iIcbZwXELuXpCO4/Kc8sgd3nqGULmM7glBg=; b=IMpa16cGAXbgQ2Y+TWzJKjaM3qTQt/ROWR4rA+dessJmay/gnt3VOjKBWEAGZFSyCm q7fnnPCmc3JAmIe30VWUKY8g/jZqicpUoPzQUTZ9/zELVi9UqURdRwj8bp8HrRLswzCW Jyxd7LAaxwFqwY0i4dDhCM6HFTrksoNViCmSHjCrKa/FVs8rf8a7Q58MGbY6l7dM3igS lxUKvqghYwONBoVwc08HZlf/y+v1HExkOTou505Mbl8UzhKhYhvAxxzz8vGVRW5U2SBE NC/fO/Pmcm1hopdf65jrBYjDzAAYsiVRZR5+lMG20YNoTH8eGqnfv1GMWCdmfbkdPDeK AVuQ== X-Gm-Message-State: AOJu0YwtkLCbfd3zicLYIkbvbxWxubuwkRjNjvbrgQHfE0/No0XuDbrD fYRouD8jRimtX9pxzsg7PBI= X-Google-Smtp-Source: AGHT+IFTZA+isPECDl01It/LKg4pFSJa6ZcL9RzJNGot72/yXPzDyakTQXl62QQorYr+n6ys1foImw== X-Received: by 2002:ac2:4d08:0:b0:503:525:243b with SMTP id r8-20020ac24d08000000b005030525243bmr2663869lfi.58.1695239909866; Wed, 20 Sep 2023 12:58:29 -0700 (PDT) Received: from localhost ([83.149.21.189]) by smtp.gmail.com with ESMTPSA id d8-20020ac244c8000000b005033891f3c0sm568023lfm.246.2023.09.20.12.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 12:58:29 -0700 (PDT) From: Serge Semin To: Michal Simek , Alexander Stein , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Rob Herring , Krzysztof Kozlowski Cc: Serge Semin , Punnaiah Choudary Kalluri , Dinh Nguyen , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 13/13] EDAC/synopsys: Add BT1 DDRC support Date: Wed, 20 Sep 2023 22:56:44 +0300 Message-ID: <20230920195720.32047-14-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230920195720.32047-1-fancer.lancer@gmail.com> References: <20230920195720.32047-1-fancer.lancer@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230920_125832_627527_05FFF499 X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Baikal-T1 SoC is equipped with the DW uMCTl2 DDRC v2.61a with 32-bit DQ-bus accepting DDR2/DDR3 SDRAMs of up to 2 ranks, 1:2 HIF/SDRAM clocks rate ratio, HIF interface burst length of 8 Full DQ-bus words, 40-bit System/Application address width and 128-bits data width, 3 System address regions with block size 256MB. There is SEC/DED ECC capability with Scrub (RMW) and Scrubber features. Since the Baikal-T1 DDR controller supports Sideband ECC add the controller support to the DW uMCTL2 DDRC EDAC driver. The most of the parameters listed above will be autodetected except HIF burst length and SAR block size, which will be set by means of the Baikal-T1-specific initialization method. The controller compatible string "baikal,bt1-ddrc" will be used to attach the driver to the kernel device. It's chosen in accordance with the just updated DT-bindings. Signed-off-by: Serge Semin --- Changelog v4: - Explicitly set snps_ddrc_info.dq_width for Baikal-T1 DDRC for better maintainability. - Explicitly set sys_app_map.minsize to SZ_256M instead of using a helper macro DDR_MIN_SARSIZE. --- drivers/edac/synopsys_edac.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c index e589aa9f7876..04cde79eb3f6 100644 --- a/drivers/edac/synopsys_edac.c +++ b/drivers/edac/synopsys_edac.c @@ -1349,6 +1349,21 @@ static int zynqmp_init_plat(struct snps_edac_priv *priv) return 0; } +/* + * bt1_init_plat - Baikal-T1-specific platform initialization. + * @priv: DDR memory controller private data. + * + * Return: always zero. + */ +static int bt1_init_plat(struct snps_edac_priv *priv) +{ + priv->info.dq_width = SNPS_DQ_32; + priv->info.hif_burst_len = SNPS_DDR_BL8; + priv->sys_app_map.minsize = SZ_256M; + + return 0; +} + /** * snps_get_dtype - Return the controller memory width. * @mstr: Master CSR value. @@ -2476,6 +2491,7 @@ static int snps_mc_remove(struct platform_device *pdev) static const struct of_device_id snps_edac_match[] = { { .compatible = "xlnx,zynqmp-ddrc-2.40a", .data = zynqmp_init_plat }, + { .compatible = "baikal,bt1-ddrc", .data = bt1_init_plat }, { .compatible = "snps,ddrc-3.80a" }, { } };