Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757215AbcCUP76 (ORCPT ); Mon, 21 Mar 2016 11:59:58 -0400 Received: from mail-bl2on0062.outbound.protection.outlook.com ([65.55.169.62]:1440 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756754AbcCUP6e (ORCPT ); Mon, 21 Mar 2016 11:58:34 -0400 Authentication-Results: spf=fail (sender IP is 66.35.236.236) smtp.mailfrom=opensource.altera.com; vger.kernel.org; dkim=pass (signature was verified) header.d=altera.onmicrosoft.com;vger.kernel.org; dmarc=none action=none header.from=opensource.altera.com; Authentication-Results: alien8.de; dkim=none (message not signed) header.d=none;alien8.de; dmarc=none action=none header.from=opensource.altera.com; From: To: , , , , , , , , , , CC: , , , , , , Subject: [PATCHv3 7/9] EDAC, altera: Addition of Arria10 L2 Cache ECC Date: Mon, 21 Mar 2016 11:01:44 -0500 Message-ID: <1458576106-24505-8-git-send-email-tthayer@opensource.altera.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1458576106-24505-1-git-send-email-tthayer@opensource.altera.com> References: <1458576106-24505-1-git-send-email-tthayer@opensource.altera.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [64.129.157.38] X-ClientProxiedBy: CY1PR0601CA0028.namprd06.prod.outlook.com (25.160.162.38) To BY1PR03MB1481.namprd03.prod.outlook.com (25.162.210.14) X-MS-Office365-Filtering-Correlation-Id: 4f306574-b1ab-4762-2393-08d351a1a566 X-Microsoft-Exchange-Diagnostics-untrusted: 1;BY1PR03MB1481;2:Nrfh8odSLKkIAQz9n8LryPoLrNn9nDAmUXuoyGWlPJBpVQjBRd7jbrAder1K7o7PizJzGzLn6EPRa2I7v3tWcEyKDbmD/gfKLvKhVc+6y2Xr8mwXJnRsfACYg+jjdTSchPxPbdMxQglwigQEhgoyBnilS0y5J8vuv2Mdou26czCnQcVsOFq/6wSslEJMXKYN;3:mO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2zVdl/lY6xoi/Ge1L5p9OFrdEmoZDk4TEELQ9Pj0uH/B3E+hL4USVUZ4yI3VAfQABePqdmT9V+VwQMAWkjUkPGeh2dGQJijuIAUufgeDV0LECNd4/Af0cc8kJnXSZC0USqoKc9eTMNHHFbChJFXHkB/KW/yQObVjtkt5nsvkZbev3pj8oDAyQ5JpFI4PtkoPrZwWtZyUfpPXKwublRBC7wtMbuLDVEm12h2AeL/PVotbznEnLB99Q4dE/v7mLwg6tksVyWRW906UrfRVy8i2DQB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:;UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:BY1PR03MB1481;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1481;BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13024025)(13017025)(13015025)(13023025)(13018025)(8121501046)(10201501046)(3002001);SRVR:SN1PR0301MB2032;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0301MB2032; X-Forefront-PRVS: 0888B1D284 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4630300001)(6049001)(6009001)(47776003)(575784001)(66066001)(86362001)(50466002)(2201001)(86152002)(81166005)(92566002)(50986999)(76176999)(42186005)(5001770100001)(19580395003)(19580405001)(189998001)(5004730100002)(107886002)(229853001)(5003940100001)(50226001)(1096002)(3846002)(586003)(2950100001)(4326007)(2906002)(6116002)(4001430100002)(77096005)(5008740100001)(2876002)(33646002)(48376002)(921003)(4720700001)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR03MB1481;H:tthayer-HP-Z620-Ubuntu.137.57.187.33;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics-untrusted: =?us-ascii?Q?1;BY1PR03MB1481;23:AHwkTchrNiKz6M6O7+8D8vHR8pShVGDvISY6/1QGw?= =?us-ascii?Q?K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cZvNgUBjFq1LZV0z?= =?us-ascii?Q?Xu9eucJfla6no3vE4VqSIxT22Itrowt13Tw4dvmZzquZnXjMolM2Kc1URsjX?= =?us-ascii?Q?GbYY9MQxTtT6nKZx8pp01R688jNVxlaFOgjQyGicumtJ0NB0Mocv1KklNi8c?= =?us-ascii?Q?PRRYwhmB1v69matkiLPa8egWDpp?= X-Microsoft-Exchange-Diagnostics-untrusted: 1;BY1PR03MB1481;5:2KugigxeWp+PaxRYib0U3K/o5TILSe3gQgtZCY60GJuUWOCEoFFLskH82MdGhOP1xxy9x7QoGerl0Po1kS3fFK9cbxsuYJnQwrPCJNLb+mD/2JG16zQKxxtIkDW/XUtraly2KOhU4ZoSZ0c9lVTrqA==;24:9ENnvGAPFBILBF9TseS+9WYxYUlzIo2+yqEPBwUrgayxgP1kGcqjyFoC6hJx8jWvZQK6gFXEhz38vHoFEwqZar0AF6UFcJGUy2FyhPgcF1I=;20:TxLFlUlQq6Eb5XBJJ6ihcYsmD43c2q9ZCfy9b4BUuZDjJbHhkgXEgRJZ4ihp4WutIkdIDhaE4kCaUYdUYCpDx9QDELOjLu0kcIINzFoqZ2ueMnmUza//YIlNS4R9qiyvIZYotp3p/3/XuZaQ2ee57HzxTKO067tqNA0lNdq61eU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1481 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: BN1AFFO11FD054.protection.gbl X-Forefront-Antispam-Report: CIP:66.35.236.236;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(77096005)(11100500001)(6806005)(66066001)(47776003)(5004730100002)(4001430100002)(229853001)(105606002)(21840400001)(5003940100001)(2950100001)(106466001)(2201001)(86152002)(85426001)(107886002)(86362001)(575784001)(87936001)(33646002)(3720700001)(16796002)(1220700001)(1096002)(956001)(2906002)(4326007)(50986999)(2876002)(76176999)(3846002)(19580405001)(19580395003)(586003)(6116002)(48376002)(5008740100001)(50226001)(50466002)(81166005)(189998001)(92566002)(5001770100001)(7099028)(921003)(1121003)(4720700001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0301MB2032;H:sj-itexedge04.altera.priv.altera.com;FPR:;SPF:Fail;MLV:sfv;A:0;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD054;1:K7CoODV1LoJ/f0PV/dCKwWbDHuUXThML4G9k0WD6wtJmLvZasBKH52zQZ3m+j9+5+VhV9fjBoD2HrO4az/XY6RJ+bnFk2ynO6oFPrhdIl7DxrRgUkrtf9syfr+fnn6lXl0XFO6K9nDtDCPlcd1YdquPbOyWpuajxeQXwGPMEczglnXYC//zoGoH05cRQwZT94UsGEiu+h50vBnVLKuui6yo8Ju46UvbGbXavZMPtt2pchOUEhvIOWIBKrIvVXD+FMtSOcEX5vC6Vjud7xHn8nSH6R8lBmPm4JF9iYU3bQMOezN5bIyiExdeeRx7MSM7h2yCbd1lIMv9LoU8+3uJ+T/WhpWKP7oY2aEH0IT0PZsgUjld+/vfwrh7ATXJiiECD9oqIeKP/VgcDfrI8EJVt+esU06FqVjOC4SMS/Rxt7DsbOHgKo4vERCX0sqoGGSj0RTpWOTpHup8ure5FwKY+AfTZUqCQwkmoG0e7V5KkwfzlOaM5xo3r/ErkvGkJulxu X-Microsoft-Exchange-Diagnostics: 1;SN1PR0301MB2032;2:s2uD4F5WP+kKmD8uo2Oipnwi0/HihtLo7yFvfk0Kdd28rjYzXva2C10k2Hinq40cUyF3+pMVhZqNwbvnMhI9qah2rud6bSZQ0biAmv4k86JsOPL7EXy5Qjcu0gb+xvpG75h0ZW5fNplZtfYX3pXxyhVKwGHesWAvFAX6yy84bKKm5bGbRYaDM0fnG++rfuNN;3:EffGRXXLcG2qq5jWfRIGTiLVONiDr96DU19jH8nUe8zveLSFu2SJFjkYR76UcgneR0Skg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PR0301MB2032;4:rE3dJ7p0uhJmefFAisbW3Et6fymchn3e8uS8T9g86KU6z/cwTSsGvUfVxZZDmSLadvSrnsNuGu54z+AvYKLANa2+4inEWyJwd1vb2C1sHeU8JASxIZ2x4mFqQOJUy5r/lidbqA/BTMdVidYhxNuPHN6Ei04VzjBJ5RNX++2cVg1g02p8bdgxoNw9XRAEke++VVFF8+e6wBAnRy5oRGQZF95g6oMVEY03vwqNuiK3ZH/4hOctz5tAFlOkxjtu3fafZ3MyD2HVnqSCkjZ82YynEwkJhygP92FqXE3RjNt17XdwMtvE50N2iRtxG3gQ39/UqYs1z16ASe/1oQHFNN66yf2LUQKSWmom1ot7bxgncCrnKQQXbf2hIMqGwpNpvQg22ZbDPpoE2507Apmuy6KEUQi8GsYrm2og8HQbTBPgTh+ifsuZ/1IWRAoH51mfLiiEwNi+eOrmuz8vVCqIypDT1g== X-Forefront-PRVS: 0888B1D284 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0301MB2032;23:dX0ksoBtgpxnua3LKD/WAhaef7MepQFcdtC3NMa?= =?us-ascii?Q?B1CAQY2p69POGbP5zsG46skPHlVlUlFnnnH3ctk+n+Zy77+Yue2ksgrjtczB?= =?us-ascii?Q?Fduf9ermmRla9m19KvBw6FDnhqZmGlZ8K4D+eWM1gTh8BR0lUxrQVYKnPyAw?= =?us-ascii?Q?ltP/EKc6cSJ5XNh9yGbZ36R6fx/A82DrKvmTwNW2dGJ3615ws2wkvRCn36Hg?= =?us-ascii?Q?vYhUMEl5pu4d3W40uhmcabx4/KeErj1RK8317B45dM2q/Tb7lSlsLzc1D6H0?= =?us-ascii?Q?i8fFs3qj5Uj5KV70ATtkKF8xuZ2F7145yGGTFOS30iuXDdy/8M/a+vWdcATr?= =?us-ascii?Q?7/T5jPrpxnlClDOaAMOOVmtlJwb7gcF48d8NclgN4Z+XQO6VmMMPlH3qt17Q?= =?us-ascii?Q?GRmCx68ZDjs/N9FeyBQ66QmyjhZtSlhXnm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?TdUno8XK3lE39QdtHmnmLD8RUu2vo7anRjzUpMvg4EG3Aq9ZSe9Xix1E8WAr?= =?us-ascii?Q?l0zEcYUX8kATcZWNnzWDtzMWumDy0UR+hkETzTLrDAOeHRJ6H?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR0301MB2032;5:b+vUmNnAqRVVss/CXaGwerL17qa8AR6ruQL28gA50Ri7Ijj8YgVC9u5kwH5ip2M9gSl8ccu0HOpbQAog/5Vs7VaXlWBTzuM5xc70D9HzG3nLfmdvnMF53VRDMhdh7qfAy4c6AqqKN99ro9lzB6Jorg==;24:1sujARkRJ7Y15AN7VNyO7FbflO1a1SrHrlXQTxGeSmzS+De+r/K/rsva66VogUzZ6ZqNAeVEHzsisWbZEmfQUO+oAO2c2Jcug5dPBT13ahQ=;20:XPwQvYUX0UoXlh+66crqq5/QclbgHkOTYo6s9VLpihMTY3GitfXKeUM0TvgZQFRpekMLjriRD8R0xzoaSl7/9JR9nY3Rxzra9W5kpTaetLhnSAxFGmiID14RPmfjqL+qCKINhmGNt4VwtlkmD4dS898+Mm5u5ek7G0JP7h/xjOA= X-OriginatorOrg: opensource.altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2016 15:58:29.2302 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.236];Helo=[sj-itexedge04.altera.priv.altera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB2032 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 11316 Lines: 371 From: Thor Thayer Addition of the Arria10 L2 Cache ECC handling. Addition of private data structure for Arria10 L2 cache ECC and the probe function for it. The Arria10 ECC device IRQs are in a shared register so the ECC Manager parent/child relationship requires a different probe function. Signed-off-by: Thor Thayer --- v2: Split large patch into smaller patches. Addition of Arria10 L2 cache dependency check and private data. v3: Use new probe function to maintain parental/child relationship for shared IRQ in ECC manager and individual ECC module probes. --- drivers/edac/altera_edac.c | 231 ++++++++++++++++++++++++++++++++++++++++++++ drivers/edac/altera_edac.h | 42 ++++++++ 2 files changed, 273 insertions(+) diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c index 502bf1f..0afdc58 100644 --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -549,6 +550,7 @@ module_platform_driver(altr_edac_driver); const struct edac_device_prv_data ocramecc_data; const struct edac_device_prv_data l2ecc_data; +const struct edac_device_prv_data a10_l2ecc_data; static irqreturn_t altr_edac_device_handler(int irq, void *dev_id) { @@ -673,6 +675,8 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci, static const struct of_device_id altr_edac_device_of_match[] = { #ifdef CONFIG_EDAC_ALTERA_L2C { .compatible = "altr,socfpga-l2-ecc", .data = (void *)&l2ecc_data }, + { .compatible = "altr,socfpga-a10-l2-ecc", + .data = (void *)&a10_l2ecc_data }, #endif #ifdef CONFIG_EDAC_ALTERA_OCRAM { .compatible = "altr,socfpga-ocram-ecc", @@ -941,6 +945,24 @@ static int altr_l2_check_deps(struct altr_edac_device_dev *device) return -ENODEV; } +static irqreturn_t altr_edac_a10_l2_irq(struct altr_edac_device_dev *dci, + bool sberr) +{ + if (sberr) { + regmap_write(dci->edac->ecc_mgr_map, + A10_SYSGMR_MPU_CLEAR_L2_ECC_OFST, + A10_SYSGMR_MPU_CLEAR_L2_ECC_SB); + edac_device_handle_ce(dci->edac_dev, 0, 0, dci->edac_dev_name); + } else { + regmap_write(dci->edac->ecc_mgr_map, + A10_SYSGMR_MPU_CLEAR_L2_ECC_OFST, + A10_SYSGMR_MPU_CLEAR_L2_ECC_MB); + edac_device_handle_ue(dci->edac_dev, 0, 0, dci->edac_dev_name); + panic("\nEDAC:ECC_DEVICE[Uncorrectable errors]\n"); + } + return IRQ_HANDLED; +} + const struct edac_device_prv_data l2ecc_data = { .setup = altr_l2_check_deps, .ce_clear_mask = 0, @@ -955,8 +977,217 @@ const struct edac_device_prv_data l2ecc_data = { .trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE, }; +const struct edac_device_prv_data a10_l2ecc_data = { + .setup = altr_l2_check_deps, + .ce_clear_mask = ALTR_A10_L2_ECC_SERR_CLR, + .ue_clear_mask = ALTR_A10_L2_ECC_MERR_CLR, + .irq_status_mask = A10_SYSMGR_ECC_INTSTAT_L2, + .dbgfs_name = "altr_l2_trigger", + .alloc_mem = l2_alloc_mem, + .free_mem = l2_free_mem, + .ecc_enable_mask = ALTR_A10_L2_ECC_EN_CTL, + .ce_set_mask = ALTR_A10_L2_ECC_CE_INJ_MASK, + .ue_set_mask = ALTR_A10_L2_ECC_UE_INJ_MASK, + .set_err_ofst = ALTR_A10_L2_ECC_INJ_OFST, + .ecc_irq_handler = altr_edac_a10_l2_irq, + .trig_alloc_sz = ALTR_TRIG_L2C_BYTE_SIZE, +}; + #endif /* CONFIG_EDAC_ALTERA_L2C */ +/********************* Arria10 EDAC Device Functions *************************/ + +/* + * The Arria10 EDAC Device Functions differ from the Cyclone5/Arria5 + * because 2 IRQs are shared among the all ECC peripherals. The ECC + * manager manages the IRQs and the children. + * Based on xgene_edac.c peripheral code. + */ + +static irqreturn_t altr_edac_a10_irq_handler(int irq, void *dev_id) +{ + irqreturn_t rc = IRQ_NONE; + struct altr_arria10_edac *edac = dev_id; + struct altr_edac_device_dev *dci; + int irq_status; + bool sberr = (irq == edac->sb_irq) ? 1 : 0; + int sm_offset = sberr ? A10_SYSMGR_ECC_INTSTAT_SERR_OFST : + A10_SYSMGR_ECC_INTSTAT_DERR_OFST; + + regmap_read(edac->ecc_mgr_map, sm_offset, &irq_status); + + if ((irq != edac->sb_irq) && (irq != edac->db_irq)) { + WARN_ON(1); + } else { + list_for_each_entry(dci, &edac->a10_ecc_devices, next) { + if (irq_status & dci->data->irq_status_mask) + rc = dci->data->ecc_irq_handler(dci, sberr); + } + } + + return rc; +} + +static int altr_edac_a10_device_add(struct altr_arria10_edac *edac, + struct device_node *np) +{ + struct edac_device_ctl_info *dci; + struct altr_edac_device_dev *altdev; + char *ecc_name = (char *)np->name; + struct resource res; + int edac_idx; + int rc = 0; + const struct edac_device_prv_data *prv; + /* Get matching node and check for valid result */ + const struct of_device_id *pdev_id = + of_match_node(altr_edac_device_of_match, np); + if (IS_ERR_OR_NULL(pdev_id)) + return -ENODEV; + + /* Get driver specific data for this EDAC device */ + prv = pdev_id->data; + if (IS_ERR_OR_NULL(prv)) + return -ENODEV; + + if (!devres_open_group(edac->dev, altr_edac_a10_device_add, GFP_KERNEL)) + return -ENOMEM; + + rc = of_address_to_resource(np, 0, &res); + if (rc < 0) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "%s: no resource address\n", ecc_name); + goto err_release_group; + } + + edac_idx = edac_device_alloc_index(); + dci = edac_device_alloc_ctl_info(sizeof(*altdev), ecc_name, + 1, ecc_name, 1, 0, NULL, 0, + edac_idx); + + if (!dci) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "%s: Unable to allocate EDAC device\n", ecc_name); + rc = -ENOMEM; + goto err_release_group; + } + + altdev = dci->pvt_info; + dci->dev = edac->dev; + altdev->edac_dev_name = ecc_name; + altdev->edac_idx = edac_idx; + altdev->edac = edac; + altdev->edac_dev = dci; + altdev->data = prv; + altdev->ddev = *edac->dev; + dci->dev = &altdev->ddev; + dci->ctl_name = "Altera ECC Manager"; + dci->mod_name = ecc_name; + dci->dev_name = ecc_name; + + altdev->base = devm_ioremap_resource(edac->dev, &res); + if (IS_ERR(altdev->base)) { + rc = PTR_ERR(altdev->base); + goto err_release_group1; + } + + /* Check specific dependencies for the module */ + if (altdev->data->setup) { + rc = altdev->data->setup(altdev); + if (rc) + goto err_release_group1; + } + + rc = edac_device_add_device(dci); + if (rc) { + dev_err(edac->dev, "edac_device_add_device failed\n"); + rc = -ENOMEM; + goto err_release_group1; + } + + altr_create_edacdev_dbgfs(dci, prv); + + list_add(&altdev->next, &edac->a10_ecc_devices); + + devres_remove_group(edac->dev, altr_edac_a10_device_add); + + return 0; + +err_release_group1: + edac_device_free_ctl_info(dci); +err_release_group: + edac_printk(KERN_ALERT, EDAC_DEVICE, "%s: %d\n", __func__, __LINE__); + devres_release_group(edac->dev, NULL); + edac_printk(KERN_ERR, EDAC_DEVICE, + "%s:Error setting up EDAC device: %d\n", ecc_name, rc); + + return rc; +} + +static int altr_edac_a10_probe(struct platform_device *pdev) +{ + struct altr_arria10_edac *edac; + struct device_node *child; + int rc; + + edac = devm_kzalloc(&pdev->dev, sizeof(*edac), GFP_KERNEL); + if (!edac) + return -ENOMEM; + + edac->dev = &pdev->dev; + platform_set_drvdata(pdev, edac); + INIT_LIST_HEAD(&edac->a10_ecc_devices); + + edac->ecc_mgr_map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, + "altr,sysmgr-syscon"); + if (IS_ERR(edac->ecc_mgr_map)) { + edac_printk(KERN_ERR, EDAC_DEVICE, + "Unable to get syscon altr,sysmgr-syscon\n"); + return PTR_ERR(edac->ecc_mgr_map); + } + + edac->sb_irq = platform_get_irq(pdev, 0); + rc = devm_request_irq(&pdev->dev, edac->sb_irq, + altr_edac_a10_irq_handler, + IRQF_SHARED, dev_name(&pdev->dev), edac); + if (rc) { + edac_printk(KERN_ERR, EDAC_DEVICE, "No SBERR IRQ resource\n"); + return rc; + } + + edac->db_irq = platform_get_irq(pdev, 1); + rc = devm_request_irq(&pdev->dev, edac->db_irq, + altr_edac_a10_irq_handler, + IRQF_SHARED, dev_name(&pdev->dev), edac); + if (rc) { + edac_printk(KERN_ERR, EDAC_DEVICE, "No DBERR IRQ resource\n"); + return rc; + } + + for_each_child_of_node(pdev->dev.of_node, child) { + if (!of_device_is_available(child)) + continue; + if (of_device_is_compatible(child, "altr,socfpga-a10-l2-ecc")) + altr_edac_a10_device_add(edac, child); + } + + return 0; +} + +static const struct of_device_id altr_edac_a10_of_match[] = { + { .compatible = "altr,socfpga-a10-ecc-manager" }, + {}, +}; +MODULE_DEVICE_TABLE(of, altr_edac_a10_of_match); + +static struct platform_driver altr_edac_a10_driver = { + .probe = altr_edac_a10_probe, + .driver = { + .name = "socfpga_a10_ecc_manager", + .of_match_table = altr_edac_a10_of_match, + }, +}; +module_platform_driver(altr_edac_a10_driver); + MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Thor Thayer"); MODULE_DESCRIPTION("EDAC Driver for Altera Memories"); diff --git a/drivers/edac/altera_edac.h b/drivers/edac/altera_edac.h index d7ef94c..b0a17d0 100644 --- a/drivers/edac/altera_edac.h +++ b/drivers/edac/altera_edac.h @@ -219,12 +219,39 @@ struct altr_sdram_mc_data { #define ALTR_L2_ECC_INJS BIT(1) #define ALTR_L2_ECC_INJD BIT(2) +/* Arria10 General ECC Block Module Defines */ +#define A10_SYSMGR_ECC_INTSTAT_SERR_OFST 0x9C +#define A10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0 +#define A10_SYSMGR_ECC_INTSTAT_L2 BIT(0) + +#define A10_SYSGMR_MPU_CLEAR_L2_ECC_OFST 0xA8 +#define A10_SYSGMR_MPU_CLEAR_L2_ECC_SB BIT(15) +#define A10_SYSGMR_MPU_CLEAR_L2_ECC_MB BIT(31) + +/* Arria 10 L2 ECC Management Group Defines */ +#define ALTR_A10_L2_ECC_CTL_OFST 0x0 +#define ALTR_A10_L2_ECC_EN_CTL BIT(0) + +#define ALTR_A10_L2_ECC_STATUS 0xFFD060A4 +#define ALTR_A10_L2_ECC_STAT_OFST 0xA4 +#define ALTR_A10_L2_ECC_SERR_PEND BIT(0) +#define ALTR_A10_L2_ECC_MERR_PEND BIT(0) + +#define ALTR_A10_L2_ECC_CLR_OFST 0x4 +#define ALTR_A10_L2_ECC_SERR_CLR BIT(15) +#define ALTR_A10_L2_ECC_MERR_CLR BIT(31) + +#define ALTR_A10_L2_ECC_INJ_OFST ALTR_A10_L2_ECC_CTL_OFST +#define ALTR_A10_L2_ECC_CE_INJ_MASK 0x00000101 +#define ALTR_A10_L2_ECC_UE_INJ_MASK 0x00010101 + struct altr_edac_device_dev; struct edac_device_prv_data { int (*setup)(struct altr_edac_device_dev *device); int ce_clear_mask; int ue_clear_mask; + int irq_status_mask; char dbgfs_name[20]; void * (*alloc_mem)(size_t size, void **other); void (*free_mem)(void *p, size_t size, void *other); @@ -232,16 +259,31 @@ struct edac_device_prv_data { int ce_set_mask; int ue_set_mask; int set_err_ofst; + irqreturn_t (*ecc_irq_handler)(struct altr_edac_device_dev *dci, + bool sb); int trig_alloc_sz; }; struct altr_edac_device_dev { + struct list_head next; void __iomem *base; int sb_irq; int db_irq; const struct edac_device_prv_data *data; struct dentry *debugfs_dir; char *edac_dev_name; + struct altr_arria10_edac *edac; + struct edac_device_ctl_info *edac_dev; + struct device ddev; + int edac_idx; +}; + +struct altr_arria10_edac { + struct device *dev; + struct regmap *ecc_mgr_map; + int sb_irq; + int db_irq; + struct list_head a10_ecc_devices; }; #endif /* #ifndef _ALTERA_EDAC_H */ -- 1.7.9.5