From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796066286; b=NRq5RP1V5sNNYk5fPlIKr9eBmp+FY1A/JEsJe/Adla+t00nOxl2NRZRfRVY8u9xLR00/ DT1/qConrhQi9FuCjktArNtb7LIKZC5jI1J2DU46md6ihjNhErkCKug9oDcDahQqmHTer ArEK7C4YVQPSyhFk7eU9RhvTAM7GbpLkRfxnqJzCqxenxtRD9iJkxCgOwel0NegUUkIbt KlzkWn/RepvfEwkwLK04X+VrMdvflkDZVB3gG76etjSVdr5qhfB17vJi6pHRZIETOyk/I lGioNtGVKV/u6G0SzX6sNYALo/ZtoMC5jDDKTxavqBIwYrxy9HSPtBE/NEiV9FfyUFg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796066286; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=+uuSsCM/i/bbvoWpw2S/2ANWoDdEzD1w0ee9BZBy2f4=; b=Kb/sSm8o7M2uPjdRDZ38aaa9IuxsWikla3xADWXGKKQRSArWqqp+8Dt6and9r1G6pUlt ugBvZnWSZJy8Dvq1gMB1s9WrPUXDrTYa1zWw8IazSjNSfyqMORT4IQIZ4gk4s94DItgCY tLdFrBv0SJu/UULgIOyi67I/dOfMSwlBc7jgSPYrWukOosW6KkgJB7nOrb688V3e/seCs Ee4aJMnd0vk44cpKvR4MFJBlf4eOSp7TrU5fbFha5BXhbzALQP6bWlEmW9r+Cg3lDuv+q 3A1CSsulROWRggRO76sorP4Vhyjm8u5508013PmG6TCaH5SxEFdgtIPV7oQFyzCvbtQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dzKrdl9Z; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (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 467E7606A32C; Mon, 30 Nov 2026 19:18:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dzKrdl9Z Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A1951F0089B; Mon, 30 Nov 2026 19:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796066286; bh=+uuSsCM/i/bbvoWpw2S/2ANWoDdEzD1w0ee9BZBy2f4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dzKrdl9ZxxzsLPiEcK9aumMYKOWiwIyF2Annfb4CEh47KuYriNMtx0u7e5xxq+MAq pfL8ym/QN6cHlu7nXvBlicaL7JS0vxL1K35C90Ka19Z+OUrnQ+upxtn2Ha4sGi9NkL 8nBbmcigTzakBUBoV0Q9gwRtTlAz5HoouuEOVNYL/20cQje1uD5/EM6MMqmFPe5WIt eg0hqEKGfny7oeAmE+rKMtMJQAhNwd/sC5VRiJuH96nRwR75saRPTkhGmS7iUXs/5s GdOYT6uKMefWl2ixh8Z8kdnD6vLkXcrzUbJxGLi8MCR0IN5JwqW69p6OsPReccYJlw E21WW8WJRfOCA== From: Dinh Nguyen To: bp@alien8.de, tony.luck@intel.com, yazen.ghannam@amd.com Cc: dinguyen@kernel.org, rounakdas2025@gmail.com, niravkumar.l.rabara@altera.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCHv5 2/4] EDAC/altera: use flag to differentiate 64-bit platforms Date: Mon, 30 Nov 2026 13:17:52 -0600 Message-ID: <20261130191754.3570042-3-dinguyen@kernel.org> X-Mailer: git-send-email 2.42.0.411.g813d9a9188 In-Reply-To: <20261130191754.3570042-1-dinguyen@kernel.org> References: <20261130191754.3570042-1-dinguyen@kernel.org> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In commit (d4486fc3098e "EDAC/altera: Use ECC manager compatible to select A10/S10 IRQ layout"), it added a way to only differentiate Stratix10 from a 32-bit platform. In preparation to add support for Agilex5, it needs a way to make a further differentiation. Make use of the driver match data to hold a flag for different platforms, specifically Stratix10 and Agilex5. Signed-off-by: Dinh Nguyen --- v5: remove SOCFPGA_AGILEX5 rename altr_platform_idx to altr_platform change flag variable to platform remove unnecessary cast v4: no changes v3: no changes v2: use enum for altr_platform_idx use SOCFPGA_A10 for A10 platforms --- drivers/edac/altera_edac.c | 20 +++++++++++--------- drivers/edac/altera_edac.h | 8 +++++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 12175d0cbc43c..5074ff9b5bbdb 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1489,7 +1489,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device) int edac_idx, rc; struct device_node *np; const struct edac_device_prv_data *prv = &a10_sdmmceccb_data; - bool is_s10 = device->edac->is_s10; + unsigned long platform = device->edac->platform; rc = altr_check_ecc_deps(device); if (rc) @@ -1538,7 +1538,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device) */ /* Using compatibles to determine the IRQ Index */ - if (is_s10) + if (platform == SOCFPGA_S10) altdev->sb_irq = irq_of_parse_and_map(np, 1); else altdev->sb_irq = irq_of_parse_and_map(np, 2); @@ -1556,7 +1556,7 @@ static int altr_portb_setup(struct altr_edac_device_dev *device) goto err_release_group_1; } - if (is_s10) { + if (platform == SOCFPGA_S10) { /* Use IRQ to determine SError origin instead of assigning IRQ */ rc = of_property_read_u32_index(np, "interrupts", 1, &altdev->db_irq); if (rc) { @@ -1967,7 +1967,7 @@ static int altr_edac_a10_device_add(struct altr_arria10_edac *edac, goto err_release_group1; } - if (edac->is_s10) { + if (edac->platform == SOCFPGA_S10) { /* Use IRQ to determine SError origin instead of assigning IRQ */ rc = of_property_read_u32_index(np, "interrupts", 0, &altdev->db_irq); if (rc) { @@ -2121,7 +2121,7 @@ static int altr_edac_a10_probe(struct platform_device *pdev) platform_set_drvdata(pdev, edac); INIT_LIST_HEAD(&edac->a10_ecc_devices); - edac->is_s10 = !!device_get_match_data(&pdev->dev); + edac->platform = (unsigned long)device_get_match_data(&pdev->dev); edac->ecc_mgr_map = altr_sysmgr_regmap_lookup_by_phandle(pdev->dev.of_node, @@ -2154,8 +2154,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev) irq_set_chained_handler_and_data(edac->sb_irq, altr_edac_a10_irq_handler, edac); - if (edac->is_s10) - { + + if (edac->platform == SOCFPGA_S10) { int dberror, err_addr; edac->panic_notifier.notifier_call = s10_edac_dberr_handler; @@ -2205,8 +2205,10 @@ static int altr_edac_a10_probe(struct platform_device *pdev) } static const struct of_device_id altr_edac_a10_of_match[] = { - { .compatible = "altr,socfpga-a10-ecc-manager" }, - { .compatible = "altr,socfpga-s10-ecc-manager", .data = (void *)1 }, + { .compatible = "altr,socfpga-a10-ecc-manager", + .data = (void *)SOCFPGA_A10 }, + { .compatible = "altr,socfpga-s10-ecc-manager", + .data = (void *)SOCFPGA_S10 }, {}, }; MODULE_DEVICE_TABLE(of, altr_edac_a10_of_match); diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h index 9387056fd65e3..32392685641ea 100644 --- a/drivers/edac/altera_edac.h +++ b/drivers/edac/altera_edac.h @@ -351,6 +351,11 @@ struct altr_sdram_mc_data { #define ECC_READ_EOVR 0x2 #define ECC_READ_EDOVR 0x3 +enum altr_platform { + SOCFPGA_A10, + SOCFPGA_S10, +}; + struct altr_edac_device_dev; struct edac_device_prv_data { @@ -394,7 +399,8 @@ struct altr_arria10_edac { struct irq_chip irq_chip; struct list_head a10_ecc_devices; struct notifier_block panic_notifier; - bool is_s10; + + enum altr_platform platform; }; #endif /* #ifndef _ALTERA_EDAC_H */ -- 2.42.0.411.g813d9a9188