From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20AC0606A32C for ; Mon, 30 Nov 2026 07:25:12 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4jdFsf5cyZz2yKn; Mon, 30 Nov 2026 18:25:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=211.20.114.72 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796023510; cv=none; b=QG8/7MHvjyLnkk4vgxjaFOCBXPnzxHhHL5KeLr/WCtSR882wc+DbiE+RGLFMrEl/AUfb2iIocNdesBgHs0Ze/3Jr5F4XeP08V5SE8EfkvHt9y44ik/SHV0EgpPc6yp8JIy6m2ljLlQksftdKSMVpcc89boGlBQj0aDySH+b/z6jylb2KDP42dvp3/CerhBaObzWc8OaVGBPkTkrmHFozjgx+0iCZ7Vy8rJzSIGpYCZgvqezwA57GkugPmCwYUxFgoryjwrIU6ovJ/JITsa646wnhSBFMcKpssgT9U1tHm7brPGqut1C8rB+DFD6qmUj3nNMB4SbUM5JHFtiyUL3RbQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796023510; c=relaxed/relaxed; bh=iWxIB0LERMn4pWn9WRP5f63kBJLy0NdAJkoAaKz25eE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=QP4u5Aj9hJu61h32ZizEr1FdPhzYqOcRRsbK/RgoT1oR/BdDROzqDYiXip7flzCN+y1ZD5xi00gUGMy1pICCV11OfWyO2Qo9BySSIOE+gVErK0QbU0leYaelTKFKGu2RtM0NT3IIxZfqmH3S8KleCWCSFu/ZAHcLBXB+LE0y7wzMO9D+ju8lMTtbjHqQLcAMaZrA7+dViEvgih+8u246NWEIN5Flfo9z18Tdzs1Rhgdhtkg1lHrAUnHZn3CrJlBjeV7yiCpJEjqTX6IvgPjBvBFfYqZGS5o0BZQCVWBxNoMyJ6kaOgFJoRtsTH63M180mYH5sIQfO72AhtUCDr1Ulw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com; spf=pass (client-ip=211.20.114.72; helo=twmbx01.aspeedtech.com; envelope-from=ryan_chen@aspeedtech.com; receiver=lists.ozlabs.org) smtp.mailfrom=aspeedtech.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aspeedtech.com (client-ip=211.20.114.72; helo=twmbx01.aspeedtech.com; envelope-from=ryan_chen@aspeedtech.com; receiver=lists.ozlabs.org) Received: from twmbx01.aspeedtech.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4jdFsf00bMz2xNT for ; Mon, 30 Nov 2026 18:25:09 +1100 (AEDT) Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Mon, 30 Nov 2026 15:24:47 +0800 Received: from [127.0.1.1] (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Mon, 30 Nov 2026 15:24:47 +0800 From: Ryan Chen Date: Mon, 30 Nov 2026 15:24:31 +0800 Subject: [PATCH v7 04/10] EDAC/aspeed: Don't unlock the interrupt control register on AST2600 X-Mailing-List: linux-aspeed@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , Precedence: list X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-ID: <20261130-edac-v7-4-3aaf6d243f07@aspeedtech.com> References: <20261130-edac-v7-0-3aaf6d243f07@aspeedtech.com> In-Reply-To: <20261130-edac-v7-0-3aaf6d243f07@aspeedtech.com> To: Stefan Schaeckeler , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Joel Stanley , Andrew Jeffery , Borislav Petkov , Tony Luck , Billy Tsai CC: , , , , , Ryan Chen X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796023486; l=2664; i=ryan_chen@aspeedtech.com; s=20251126; h=from:subject:message-id; bh=0DEL/ryGq2Jul/1uvpGXMvsqDUAO5tSVVt+t2Awm4Cw=; b=p37/KNug6wzddzj/JATncyujrTR5In7FAP2INkyBqXIctaYLDTKaAMSuUP1YtyOgy2N08iLNh WaEktcOSdVuAPWztIZAgcazWAjh+a+hb+3dUr3dGakFonW+LhjkKA00 X-Developer-Key: i=ryan_chen@aspeedtech.com; a=ed25519; pk=Xe73xY6tcnkuRjjbVAB/oU30KdB3FvG4nuJuILj7ZVc= X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On the AST2600 the interrupt control register can be written without the unlock key. Unlocking also makes the rest of the memory controller settings writable, so skip it where it isn't needed. Signed-off-by: Ryan Chen --- Tested on an AST2600 by injecting a correctable error with the memory controller's error injection: # mw 1e6e0000 fc600309; mw 1e6e00b0 81 EDAC MC0: 1 CE address(es) not available on mc#0csrow#0channel#0 (csrow:0 channel:0 page:0x0 offset:0x0 grain:16 syndrome:0x0) EDAC MC0: 1 CE on mc#0csrow#0channel#0 (csrow:0 channel:0 page:0xb2b2f offset:0x180 grain:16 syndrome:0x0) --- drivers/edac/aspeed_edac.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c index f4ef9430258a..e3158265dde8 100644 --- a/drivers/edac/aspeed_edac.c +++ b/drivers/edac/aspeed_edac.c @@ -36,6 +36,7 @@ struct aspeed_edac_chip { u32 conf_dram_type; enum mem_type dram_type[2]; unsigned long mtype_cap; + bool intr_ctrl_locked; }; struct aspeed_edac { @@ -58,12 +59,14 @@ static void mcr_update_bits(struct aspeed_edac *priv, u32 reg, u32 mask, tmp = (tmp & ~mask) | (val & mask); /* enable write to MCR register set */ - writel(ASPEED_MCR_PROT_PASSWD, priv->regs + ASPEED_MCR_PROT); + if (priv->chip->intr_ctrl_locked) + writel(ASPEED_MCR_PROT_PASSWD, priv->regs + ASPEED_MCR_PROT); writel(tmp, priv->regs + reg); /* disable write to MCR register set */ - writel(~ASPEED_MCR_PROT_PASSWD, priv->regs + ASPEED_MCR_PROT); + if (priv->chip->intr_ctrl_locked) + writel(~ASPEED_MCR_PROT_PASSWD, priv->regs + ASPEED_MCR_PROT); spin_unlock_irqrestore(&priv->lock, flags); } @@ -360,12 +363,21 @@ static const struct aspeed_edac_chip ast2400_edac = { .conf_dram_type = ASPEED_MCR_CONF_DRAM_TYPE, .dram_type = { MEM_DDR3, MEM_DDR4 }, .mtype_cap = MEM_FLAG_DDR3 | MEM_FLAG_DDR4, + .intr_ctrl_locked = true, +}; + +static const struct aspeed_edac_chip ast2600_edac = { + .conf_reg = ASPEED_MCR_CONF, + .conf_ecc = ASPEED_MCR_CONF_ECC, + .conf_dram_type = ASPEED_MCR_CONF_DRAM_TYPE, + .dram_type = { MEM_DDR3, MEM_DDR4 }, + .mtype_cap = MEM_FLAG_DDR3 | MEM_FLAG_DDR4, }; static const struct of_device_id aspeed_of_match[] = { { .compatible = "aspeed,ast2400-sdram-edac", .data = &ast2400_edac }, { .compatible = "aspeed,ast2500-sdram-edac", .data = &ast2400_edac }, - { .compatible = "aspeed,ast2600-sdram-edac", .data = &ast2400_edac }, + { .compatible = "aspeed,ast2600-sdram-edac", .data = &ast2600_edac }, {}, }; -- 2.34.1