From nobody Wed Nov 27 07:29:45 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2079.outbound.protection.outlook.com [40.107.20.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BBBE1957E2; Fri, 11 Oct 2024 15:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660719; cv=fail; b=kDJecrP0nG60lIePhz4k2Y7cDq8jmWkBqaopt+XDqiG8i2bslsvht03Ugf+HtlLsxq0bTJEavJhTFxAP8XeuliUH3jS1Qm+FDnp5y2MqgUEgncDev0PrlG0OWzWglDYZRM2rkJm3FcR8jFX79qbYASeUX8xdwqKg3AhmVgrpLuk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660719; c=relaxed/simple; bh=tWA2t7dYpkCGQPCP1WcAIC7H3OdUmQUbtGujuyE7dVw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=pB41+O57mhj62TFg4nWG7phJ/ncsNxIagKU96e4sEpUVovppr4bgt3jQcuHd60OZWDX9r6YfGMNf6y6q2uPs0BLHXP7OWOd7yFiS2nBTb7c3y7SxY3nHCdNdDtG/BwYbTLItxgoDLA18UUta+P0q88QLlA72Nh4/iTkc+2LgGOg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=MztvPEz5; arc=fail smtp.client-ip=40.107.20.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="MztvPEz5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JMlW8/s+aa0AZBC4bo7Vf0lW1J5HZ1ItCqylPjcRhvTSMI+yU9qrzP+sgAqizo4Kj/i7ANOQsUCj03PfHWd6am/X8G/XTTS5Y8z4mbC/1C+bwhzuBFhbJQKMccaJcOMi9gB7/gZAxQ3bUeJUW4cWuf/mqqfMchZVVVPGh3eCVCISvlJj6dWb9rDVoDsz2peRcQPRSKZiqxcAz7uFATtu6ZnlbQMMSnF6NP0E/CjoBw3NKrYntcEnBY9orVtPyRCsSVi+NfXOJmDtjl/ZvieQNXlIbpanGXAuOU1aE57VbBOZlW69xObLQu8vrcneoRvwH+/uPZBJsC+XOfaOI6jNJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oWWIgflstIVDXTjDGLYnl7metuS73gQMf9j95c82+E0=; b=AfNKGjJk70sjxjWT1u6INCtYyWeunol4tjK7CD0o5pIXg5uzuRDX58jKRjQWnzp1SpXsDli1nM1iWaw6CfUJ+2REzLx0KuB2C3vf1Rc4UNT+JVfr5U2eip8mVsJFQJJ65TLVQCfTHBeA3jHlXIut8LsWqvfOLUgMxr+0S3LjNIrgaEnNeDElJJ6yv0mUDG9nE9frdrmKvuaUbEICXoLUdG/1ILwaMmwwsEtjEtUtip28f5S5eBAVjLjIO34wQEZJTCjwAxAnZuXCaQ8XvVmw5hdGA7OdpKr96LVzv7UU38VPQLMHRuZHbzCfSQocvXh9eBde5wX4TBmE4BVtVjDVow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oWWIgflstIVDXTjDGLYnl7metuS73gQMf9j95c82+E0=; b=MztvPEz5iIrSku1WFfgIbQg4/N0lxtiEPtvNrB181SUNfcwKFhHzpVfmf535C8EGeUSSGeib1uiWSvAL6tNg/jx16wdDjzMkDFIS5XxJY58Hcow/iFb8XVjlN3HYBWIuG6UVsono+65yWvEsasuPRKqJkEsxYKobmDo4Deyv4VlRubZCG9mX1AhS9F/5XTVonaEtJ5M7JUPTQ6MCH327Yi1Ig5I5bdrWXRSQlPp5Tgu4Rw6iFHK/NJvo1ogGYvprjc/LvHG5xQQE/1uJOzh9BZcdHD6ktDFnzz9MqQNq4QIzIdYiTMdYKTaPlY2flFUOM2vi+iuXRYc5URr/dSxBuw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AM7PR04MB7064.eurprd04.prod.outlook.com (2603:10a6:20b:118::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.20; Fri, 11 Oct 2024 15:31:54 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 15:31:54 +0000 From: Frank Li Date: Fri, 11 Oct 2024 11:31:29 -0400 Subject: [PATCH v2 1/6] EDAC/fsl_ddr: Pass down fsl_mc_pdata in ddr_in32() and ddr_out32() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241011-imx95_edac-v2-1-011b68290951@nxp.com> References: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> In-Reply-To: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> To: York Sun , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728660703; l=8457; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=tWA2t7dYpkCGQPCP1WcAIC7H3OdUmQUbtGujuyE7dVw=; b=I229zlgU2anPbvLij1cNUj64GMxTUvyazyq5Wyp0/AqlTYU5gx71QGZhHN0QgziCfhpJ2cJaz mfGEa/rp+ayCugzBn75mIiqFgDJHPfRIfhA7xTSpJBbwG5Sx89aN3Xa X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:217::19) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM7PR04MB7064:EE_ X-MS-Office365-Filtering-Correlation-Id: 65113d73-0a4c-47ca-49f0-08dcea09d609 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-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1pnZkNYakZQSkZZV3RJT1F4c3k1eVhPQUVJ?= =?utf-8?Q?NEbBOJMdpeyKDLCCIwRLdUnNzThcCx2O65too=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N1A1cVh4YXhkcHllalgxM3VveEhseXpySmdJVWNYWlgzZUczRVpuN3libm1K?= =?utf-8?B?NFFIckIzbjJKTVE2U1pKWlhIa0FUY3FWNmpQSnl6c2t5dE5qTjF4d2xscTBx?= =?utf-8?B?R2NiK0w3NHM4T2R0M29lVHl2RmJhQ0VEUG51NGUwcmxuTU1kTmIxT0cwTFlL?= =?utf-8?B?QkJSZXpZRWt4NG5kUkxDY1ZiWUlDWjQwWHdXMHdnV00xMXBsM0dGRlB5VFpT?= =?utf-8?B?bnZvanFuU2tySzhEMmdUUkRlNHpYN2JzL3RkeE54S2FPNXR4ZFZJTW1EVEM3?= =?utf-8?B?QVFOSDQzSWFiaTdWVUxSM3ZGR3o2M0labHVGNG9aUnZtdzBGUTBQQzBqSnZt?= =?utf-8?B?emxqcVIzc3RKR245Vlo4N3dYNllFS1ArclZIZ3ZBM1hFT09WUXRFT0ppamRr?= =?utf-8?B?OCtSMFBQUzU2VWJQa1hHUEptMDAydUdiS1lka015eGVZZGttbHk3d1VncVpM?= =?utf-8?B?MEgzeVUyVTJjUFNYdXFRYmdabkxvOUtQcS9wN2lrb2Rta1FkUVhkZUtoSmRY?= =?utf-8?B?bVJPWFFwZTlYS0pKNnBHbzJMTkdLQjRRUTN3M3RHUEZZNVZkNUI5MjdiaHBM?= =?utf-8?B?eXFiMkp4NElGc3cxdkxpMklOTF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Vc3RjloajNiNHJZakF6SGhLcGhKNmcrdkxrcERJeWR1dmtoS2RtbTlndXFM?= =?utf-8?B?Qm5TQjZUeWxOYWpMSi9ZN3IyTzZmQ21pVkJSc2U3NGJCMDdsMG1qWEpTZ1pC?= =?utf-8?B?b0gzR09GOVR3amRvaXZMRjZzK3NnUFlURXBVck53SWp5RUxyR05ScmVoeDdr?= =?utf-8?B?dDBXWndFcVZKSDZTMUUvTnhrblhBVEplT0FQUWE4bExiSzQzSUZiWWtKQ240?= =?utf-8?B?LzhxMVBvZlcrTDB5ZHVZM3EvUWdhRkdPK1BHdU95QjVWQ3RtYzdGdjNueElG?= =?utf-8?B?b3BHQUdZVmE2RkEwWlAyMTZsSTVkZU51NUVtWVcyMUhmaVhNZStNaCtiSnIx?= =?utf-8?B?VXhJdGRKMjhQTVlnZ2UvZllSMHJqZk5IaW9oTDdrbjZaQ1ZvWmV0WmVKOWlR?= =?utf-8?B?dDJYOGFRNU9YUG1Wd1AzUDF5eVhaeXFXQWwzdHkwYmYvSEtTY1Y5OEg4cGlq?= =?utf-8?B?L0tibmQ2WjFzbWx3ODB5NkpQY1k4aFRaQnVJYUZrWk43SXJueFR5NXRyZktV?= =?utf-8?B?NGdNbi9vM3ZLelFSZ1ZjaU1SeVFXejVmc3dCdEx0T3draVcwM3d0L0pMSW5n?= =?utf-8?Q?2WEd49SjoZn7+i8/kKCAzzN4a?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65113d73-0a4c-47ca-49f0-08dcea09d609 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 15:31:54.7271 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ShSsbeseJKCZ+yntuCUGoY1kVabxTWaIshAzKovM4mZ+tfN91p3aUrZPysq9ukvlCnIcE7uTeaiV+KUX5xvrdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7064 Pass down `fsl_mc_pdata` in helper functions `ddr_in32()` and `ddr_out32()` to prepare for adding iMX9 support. The iMX9 has a slightly different register layout. No functional change. Signed-off-by: Frank Li --- Change from v1 to v2 - update commit message. - fix a build error. --- drivers/edac/fsl_ddr_edac.c | 64 ++++++++++++++++++++++++-----------------= ---- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index d148d262d0d4d..9924c6b816648 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -35,13 +35,17 @@ static u32 orig_ddr_err_disable; static u32 orig_ddr_err_sbe; static bool little_endian; =20 -static inline u32 ddr_in32(void __iomem *addr) +static inline u32 ddr_in32(struct fsl_mc_pdata *pdata, unsigned int off) { + void __iomem *addr =3D pdata->mc_vbase + off; + return little_endian ? ioread32(addr) : ioread32be(addr); } =20 -static inline void ddr_out32(void __iomem *addr, u32 value) +static inline void ddr_out32(struct fsl_mc_pdata *pdata, unsigned int off,= u32 value) { + void __iomem *addr =3D pdata->mc_vbase + off; + if (little_endian) iowrite32(value, addr); else @@ -60,7 +64,7 @@ static ssize_t fsl_mc_inject_data_hi_show(struct device *= dev, struct mem_ctl_info *mci =3D to_mci(dev); struct fsl_mc_pdata *pdata =3D mci->pvt_info; return sprintf(data, "0x%08x", - ddr_in32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_HI)); + ddr_in32(pdata, FSL_MC_DATA_ERR_INJECT_HI)); } =20 static ssize_t fsl_mc_inject_data_lo_show(struct device *dev, @@ -70,7 +74,7 @@ static ssize_t fsl_mc_inject_data_lo_show(struct device *= dev, struct mem_ctl_info *mci =3D to_mci(dev); struct fsl_mc_pdata *pdata =3D mci->pvt_info; return sprintf(data, "0x%08x", - ddr_in32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_LO)); + ddr_in32(pdata, FSL_MC_DATA_ERR_INJECT_LO)); } =20 static ssize_t fsl_mc_inject_ctrl_show(struct device *dev, @@ -80,7 +84,7 @@ static ssize_t fsl_mc_inject_ctrl_show(struct device *dev, struct mem_ctl_info *mci =3D to_mci(dev); struct fsl_mc_pdata *pdata =3D mci->pvt_info; return sprintf(data, "0x%08x", - ddr_in32(pdata->mc_vbase + FSL_MC_ECC_ERR_INJECT)); + ddr_in32(pdata, FSL_MC_ECC_ERR_INJECT)); } =20 static ssize_t fsl_mc_inject_data_hi_store(struct device *dev, @@ -97,7 +101,7 @@ static ssize_t fsl_mc_inject_data_hi_store(struct device= *dev, if (rc) return rc; =20 - ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_HI, val); + ddr_out32(pdata, FSL_MC_DATA_ERR_INJECT_HI, val); return count; } return 0; @@ -117,7 +121,7 @@ static ssize_t fsl_mc_inject_data_lo_store(struct devic= e *dev, if (rc) return rc; =20 - ddr_out32(pdata->mc_vbase + FSL_MC_DATA_ERR_INJECT_LO, val); + ddr_out32(pdata, FSL_MC_DATA_ERR_INJECT_LO, val); return count; } return 0; @@ -137,7 +141,7 @@ static ssize_t fsl_mc_inject_ctrl_store(struct device *= dev, if (rc) return rc; =20 - ddr_out32(pdata->mc_vbase + FSL_MC_ECC_ERR_INJECT, val); + ddr_out32(pdata, FSL_MC_ECC_ERR_INJECT, val); return count; } return 0; @@ -286,7 +290,7 @@ static void fsl_mc_check(struct mem_ctl_info *mci) int bad_data_bit; int bad_ecc_bit; =20 - err_detect =3D ddr_in32(pdata->mc_vbase + FSL_MC_ERR_DETECT); + err_detect =3D ddr_in32(pdata, FSL_MC_ERR_DETECT); if (!err_detect) return; =20 @@ -295,14 +299,14 @@ static void fsl_mc_check(struct mem_ctl_info *mci) =20 /* no more processing if not ECC bit errors */ if (!(err_detect & (DDR_EDE_SBE | DDR_EDE_MBE))) { - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_DETECT, err_detect); + ddr_out32(pdata, FSL_MC_ERR_DETECT, err_detect); return; } =20 - syndrome =3D ddr_in32(pdata->mc_vbase + FSL_MC_CAPTURE_ECC); + syndrome =3D ddr_in32(pdata, FSL_MC_CAPTURE_ECC); =20 /* Mask off appropriate bits of syndrome based on bus width */ - bus_width =3D (ddr_in32(pdata->mc_vbase + FSL_MC_DDR_SDRAM_CFG) & + bus_width =3D (ddr_in32(pdata, FSL_MC_DDR_SDRAM_CFG) & DSC_DBW_MASK) ? 32 : 64; if (bus_width =3D=3D 64) syndrome &=3D 0xff; @@ -310,8 +314,8 @@ static void fsl_mc_check(struct mem_ctl_info *mci) syndrome &=3D 0xffff; =20 err_addr =3D make64( - ddr_in32(pdata->mc_vbase + FSL_MC_CAPTURE_EXT_ADDRESS), - ddr_in32(pdata->mc_vbase + FSL_MC_CAPTURE_ADDRESS)); + ddr_in32(pdata, FSL_MC_CAPTURE_EXT_ADDRESS), + ddr_in32(pdata, FSL_MC_CAPTURE_ADDRESS)); pfn =3D err_addr >> PAGE_SHIFT; =20 for (row_index =3D 0; row_index < mci->nr_csrows; row_index++) { @@ -320,8 +324,8 @@ static void fsl_mc_check(struct mem_ctl_info *mci) break; } =20 - cap_high =3D ddr_in32(pdata->mc_vbase + FSL_MC_CAPTURE_DATA_HI); - cap_low =3D ddr_in32(pdata->mc_vbase + FSL_MC_CAPTURE_DATA_LO); + cap_high =3D ddr_in32(pdata, FSL_MC_CAPTURE_DATA_HI); + cap_low =3D ddr_in32(pdata, FSL_MC_CAPTURE_DATA_LO); =20 /* * Analyze single-bit errors on 64-bit wide buses @@ -367,7 +371,7 @@ static void fsl_mc_check(struct mem_ctl_info *mci) row_index, 0, -1, mci->ctl_name, ""); =20 - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_DETECT, err_detect); + ddr_out32(pdata, FSL_MC_ERR_DETECT, err_detect); } =20 static irqreturn_t fsl_mc_isr(int irq, void *dev_id) @@ -376,7 +380,7 @@ static irqreturn_t fsl_mc_isr(int irq, void *dev_id) struct fsl_mc_pdata *pdata =3D mci->pvt_info; u32 err_detect; =20 - err_detect =3D ddr_in32(pdata->mc_vbase + FSL_MC_ERR_DETECT); + err_detect =3D ddr_in32(pdata, FSL_MC_ERR_DETECT); if (!err_detect) return IRQ_NONE; =20 @@ -396,7 +400,7 @@ static void fsl_ddr_init_csrows(struct mem_ctl_info *mc= i) u32 cs_bnds; int index; =20 - sdram_ctl =3D ddr_in32(pdata->mc_vbase + FSL_MC_DDR_SDRAM_CFG); + sdram_ctl =3D ddr_in32(pdata, FSL_MC_DDR_SDRAM_CFG); =20 sdtype =3D sdram_ctl & DSC_SDTYPE_MASK; if (sdram_ctl & DSC_RD_EN) { @@ -444,7 +448,7 @@ static void fsl_ddr_init_csrows(struct mem_ctl_info *mc= i) csrow =3D mci->csrows[index]; dimm =3D csrow->channels[0]->dimm; =20 - cs_bnds =3D ddr_in32(pdata->mc_vbase + FSL_MC_CS_BNDS_0 + + cs_bnds =3D ddr_in32(pdata, FSL_MC_CS_BNDS_0 + (index * FSL_MC_CS_BNDS_OFS)); =20 start =3D (cs_bnds & 0xffff0000) >> 16; @@ -531,7 +535,7 @@ int fsl_mc_err_probe(struct platform_device *op) goto err; } =20 - sdram_ctl =3D ddr_in32(pdata->mc_vbase + FSL_MC_DDR_SDRAM_CFG); + sdram_ctl =3D ddr_in32(pdata, FSL_MC_DDR_SDRAM_CFG); if (!(sdram_ctl & DSC_ECC_EN)) { /* no ECC */ pr_warn("%s: No ECC DIMMs discovered\n", __func__); @@ -558,11 +562,11 @@ int fsl_mc_err_probe(struct platform_device *op) fsl_ddr_init_csrows(mci); =20 /* store the original error disable bits */ - orig_ddr_err_disable =3D ddr_in32(pdata->mc_vbase + FSL_MC_ERR_DISABLE); - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_DISABLE, 0); + orig_ddr_err_disable =3D ddr_in32(pdata, FSL_MC_ERR_DISABLE); + ddr_out32(pdata, FSL_MC_ERR_DISABLE, 0); =20 /* clear all error bits */ - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_DETECT, ~0); + ddr_out32(pdata, FSL_MC_ERR_DETECT, ~0); =20 res =3D edac_mc_add_mc_with_groups(mci, fsl_ddr_dev_groups); if (res) { @@ -571,15 +575,15 @@ int fsl_mc_err_probe(struct platform_device *op) } =20 if (edac_op_state =3D=3D EDAC_OPSTATE_INT) { - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_INT_EN, + ddr_out32(pdata, FSL_MC_ERR_INT_EN, DDR_EIE_MBEE | DDR_EIE_SBEE); =20 /* store the original error management threshold */ - orig_ddr_err_sbe =3D ddr_in32(pdata->mc_vbase + + orig_ddr_err_sbe =3D ddr_in32(pdata, FSL_MC_ERR_SBE) & 0xff0000; =20 /* set threshold to 1 error per interrupt */ - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_SBE, 0x10000); + ddr_out32(pdata, FSL_MC_ERR_SBE, 0x10000); =20 /* register interrupts */ pdata->irq =3D platform_get_irq(op, 0); @@ -620,12 +624,12 @@ void fsl_mc_err_remove(struct platform_device *op) edac_dbg(0, "\n"); =20 if (edac_op_state =3D=3D EDAC_OPSTATE_INT) { - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_INT_EN, 0); + ddr_out32(pdata, FSL_MC_ERR_INT_EN, 0); } =20 - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_DISABLE, + ddr_out32(pdata, FSL_MC_ERR_DISABLE, orig_ddr_err_disable); - ddr_out32(pdata->mc_vbase + FSL_MC_ERR_SBE, orig_ddr_err_sbe); + ddr_out32(pdata, FSL_MC_ERR_SBE, orig_ddr_err_sbe); =20 edac_mc_del_mc(&op->dev); edac_mc_free(mci); --=20 2.34.1 From nobody Wed Nov 27 07:29:45 2024 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2070.outbound.protection.outlook.com [40.107.105.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18306197A68; Fri, 11 Oct 2024 15:32:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660726; cv=fail; b=Xq/e5CojxKX9vr9twpROMOUyHZeV1LA5AMz+kkRS3pDYniS29+AMyxa/LJ6OzzlZt48VW9y9yf4yr+T56VCI0oY8T/qZy59TF5yAnyimi6mjdWulIh8yRMbvHbpILmcASjjcF2RSh4yMfgXEwobif97SJHWyY0E5HUuZ7Pai7XI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660726; c=relaxed/simple; bh=bYOSUeH8Tsfygywx3VBHrQIC4eU9dzx5J8svyPSfkS4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Yj0NaoCtoaD/ErZuZR3UQfX3NY0XfzXSL9jIsVsXMH0GEj5LKfJfWF6oE892clORwX67XLylRoZT7+8Dh/wTDAiIH4n6OzTHIiJ5mcQ33Yon1eMglTg5swGVSH+pA5pKFB2TS1BGY44Q2j07y4q/Dgzgw04WGyJ8OloyJTih1t4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=ag0tOMSZ; arc=fail smtp.client-ip=40.107.105.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="ag0tOMSZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rEoOWXwahvR1BJEW3+lpHQb9Sa+iAmQEKMrpS58P585zcGFosZHqBSpcP0lPnXgaRrMl+FTqBPLQG4KlSP08yxYYHuvrWRndA2MrjIq27ttCxSj1Qx/gOV6S75haaVIRd/zozkFqEycfUDVNJZzGI+iXBKEus2mxabwPEO/gDZtMvfF5ForICAnTBwZa1Gja5JctlZQ6yjNFLECBbnv1sMgJ7Sf80gT4QBh1I2Nt1P7xEqcvTWt9NhE4NiH7MAWpFj7fg0GDzZxAgro8Aa3FEwm/oSJFmV8SnEWmcRfi3UQXTNpMHxYVnCyqGm0n1U+g9HRURJwEZdhYE8XJnwFbKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oThGc+PInWWFzFHWkQtWRVZUx01s9iDEryoUEl8TSD8=; b=cJ7YKl+/OdZ60XmzS/yLQ6+TFWYNi46QMCmp/LzP5grU/IFY60rrZmWE+DOD2C/qvGWj2iEmbNVYxRxm1/vq/MYMcBQa8YN73CtwGNYj4nGoA535IBY7xD9Uz+w+b3ubwQINKUDl2rhY+wau/RZDG2vvbABFt/Y2vtl1fSaqcatjyTe24X5PxYR3vjXeXDXquNfL3w6u9QDsEqUgyvDVcvfD5CGgF2kBv6dmnvD4yBJAqhFBzr/7LUDjZQQUoq1j/NM4yYQBWaxHQj7GdZv0yqMEP0S5iCcKXno8JKz77S3Eg9Xlt+OxsrxEchrT6/uTFFSOp9TKNucSaywEQruU5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oThGc+PInWWFzFHWkQtWRVZUx01s9iDEryoUEl8TSD8=; b=ag0tOMSZeGlCwY6HqL++k36OfWBb5CKMV/bPK0/5hIHCoIqn/1swExmBkvp43b4ShqySsy+yk+3n8g5KczbdH64l06Q5rw6vjGpsXPdoF4zQ2JlnpUn/chEL3rCOJTZFuN+9oUqdAX87/T9ZY/+cOq9i2fEKboxYx2BqVMmRzCxHCHGYQ/7M2vWG9fOrfDCGE6q/JMTGlWElhiWn6NgXhii4y5Rcsgn1CewgHRgBgmY8wbm47o7IzvbsUxvZoJKTzCazXD1OyJYMdC6iiGj8OJEeTnmcIu6V+jKbkzHzfftAqvPcxVdflZu5gokTXAk7YZfo/LHac4dmSARVX+4a0w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VE1PR04MB7360.eurprd04.prod.outlook.com (2603:10a6:800:1a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 11 Oct 2024 15:32:00 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 15:32:00 +0000 From: Frank Li Date: Fri, 11 Oct 2024 11:31:30 -0400 Subject: [PATCH v2 2/6] EDAC/fsl_ddr: Move global variables into struct fsl_mc_pdata Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241011-imx95_edac-v2-2-011b68290951@nxp.com> References: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> In-Reply-To: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> To: York Sun , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728660703; l=3246; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=bYOSUeH8Tsfygywx3VBHrQIC4eU9dzx5J8svyPSfkS4=; b=Jr4ZBVdjm68AQYMozrhBBkHuOgXtkZe2yfQsG4tul8HwMEu9Uo4auwEhsTkM3jvVp+pVnWdqK GiUBeH7crjmAohu8MLvaUbS/kQCKODv1F1SqrqywQjvgjyJV5/5ZJCK X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:217::19) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7360:EE_ X-MS-Office365-Filtering-Correlation-Id: a58a03ec-8828-41d7-0cd3-08dcea09d92a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?S1ZFVGpFdk9RQkt3dEp6RkZoNThqOUpFeklPQm1WVktITDRka01yZm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DNZ44Y92hZdXI6OX3KdizMI=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y0Jac21tZW9JbW5wK1pwek9WSjNJY2xRWUg5WEY4b3NIRmRuSHdvUWl4WndJ?= =?utf-8?B?elFnemY3TTFSbWt0VVZ6NVFmQ0t2aitrT3drdEcxR2F1ODhvWE1YUW4wamwx?= =?utf-8?B?eUdyR1ZjVnJaQ25VV3BvTlNzTkNNQVpmdTlnOGlhN0pzYnlweDRPdElCTzlj?= =?utf-8?B?R2xvNms3NERXYkY0ejB6elpmTDdDL2FGWTNscjRpemo3cVk4cGRCenM4Z2Z1?= =?utf-8?B?WWVLbkNkM1JoQkJ2WS9HQVhxS0R2Mi9YUDhRckd4eEF5ZWx1RnZERjBxaGdh?= =?utf-8?B?dUJXTi9zcDF3Q2loMzZvRmhBV0dta1BTc1dVcnRVeTlJNEdQdzdzanpjOVhW?= =?utf-8?B?Tmt2MDdKWmdBWnBUTEl0UHArNWpsRFdqcllxdVUyWVJ4R0FFUGZrYnJlY2dT?= =?utf-8?B?VUtpdVpVVk9rM0V0ekJKNk84bmJxRHNURjlFRDBGWTY2cDNnRFlHeHhXVEhO?= =?utf-8?B?eGhzc000SndpbG12L3M4cXEybmZJaE1pYWlRVFo0akVCR0pNZ3FLOW5Xdllw?= =?utf-8?B?T3pCTDFqMlBNOEJFVHBEdGZuUFplaUFtOFBycTR4RjRtN0ZTbk1iV0gwemI5?= =?utf-8?B?cC9UQnZrbGZXbWx3NU1EOEpXNHEzWENPSVU3ZFFTajBKV200MmpSdHRMVU1I?= =?utf-8?B?aEY0aG53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czFjUm1HeXRQUHowNTBETEE3ZW9NK0R2RkNyOVZLQ3RkaGlXRUFPc1hvSXRZ?= =?utf-8?B?Q2lZUlB5L1J5bzl4UWtZY3grRmNQN2tWcjY2aHJnWHY1Ym80dUJ3bkFzQVNj?= =?utf-8?B?RnlJTC9HT1RUMFFlcUExdVFWZTBEMzdKSHRPUnFFVTFZbExKcmZSYWxiYnNh?= =?utf-8?B?a253cFBQeXpmTlNnWFlYeFdSNUdPWGpiT3RCKzNUelVRb0ZKMzdpakIybmtj?= =?utf-8?B?cjJBUmVwbzNpMjlxak5nT0M3THQ0NDdJcHFyRFpKNkRPNlVDR2xwNitnb1lj?= =?utf-8?B?Y09RZ1N6REpxNWVia2tFSUdrVDVZeUpOaTlTZzRJbTJJcE85Q29PZGg4UnNO?= =?utf-8?B?bGUrNGJMLzBDNmxJSTVQMUhGcS84OENMRHF6NFpyVlVQSVQ2ZEQ5akZPWEVP?= =?utf-8?B?dHZvZWVKRnFaOUdxTXU0d0czZlE0dzYrQ25HUHAraVRONmo1VEkraFNpb2U3?= =?utf-8?B?aDFwVkxXbTRlYmVLYW1XWmJQY3hIMlgyaFRpU3VMTzE5RlhtZXk4WURRQWkz?= =?utf-8?Q?0hMIVOI08gzqBwDTstX9p54ps?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a58a03ec-8828-41d7-0cd3-08dcea09d92a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 15:32:00.0664 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bNuusndbDpAAtiRZGmMBiy3+0/o3zzKz3e2qf/miMXWs4oQGVdxFwPA5OZ71/janMXY8aBw9KRoOsX5l8CPA5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7360 Move global variables into the struct `fsl_mc_pdata` to handle systems with multiple DDR controllers. No functional change. Signed-off-by: Frank Li --- - rework commit message. --- drivers/edac/fsl_ddr_edac.c | 21 +++++++++------------ drivers/edac/fsl_ddr_edac.h | 3 +++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index 9924c6b816648..7a9fb1202f1a0 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -31,22 +31,18 @@ =20 static int edac_mc_idx; =20 -static u32 orig_ddr_err_disable; -static u32 orig_ddr_err_sbe; -static bool little_endian; - static inline u32 ddr_in32(struct fsl_mc_pdata *pdata, unsigned int off) { void __iomem *addr =3D pdata->mc_vbase + off; =20 - return little_endian ? ioread32(addr) : ioread32be(addr); + return pdata->little_endian ? ioread32(addr) : ioread32be(addr); } =20 static inline void ddr_out32(struct fsl_mc_pdata *pdata, unsigned int off,= u32 value) { void __iomem *addr =3D pdata->mc_vbase + off; =20 - if (little_endian) + if (pdata->little_endian) iowrite32(value, addr); else iowrite32be(value, addr); @@ -511,7 +507,7 @@ int fsl_mc_err_probe(struct platform_device *op) * Get the endianness of DDR controller registers. * Default is big endian. */ - little_endian =3D of_property_read_bool(op->dev.of_node, "little-endian"); + pdata->little_endian =3D of_property_read_bool(op->dev.of_node, "little-e= ndian"); =20 res =3D of_address_to_resource(op->dev.of_node, 0, &r); if (res) { @@ -562,7 +558,7 @@ int fsl_mc_err_probe(struct platform_device *op) fsl_ddr_init_csrows(mci); =20 /* store the original error disable bits */ - orig_ddr_err_disable =3D ddr_in32(pdata, FSL_MC_ERR_DISABLE); + pdata->orig_ddr_err_disable =3D ddr_in32(pdata, FSL_MC_ERR_DISABLE); ddr_out32(pdata, FSL_MC_ERR_DISABLE, 0); =20 /* clear all error bits */ @@ -579,8 +575,8 @@ int fsl_mc_err_probe(struct platform_device *op) DDR_EIE_MBEE | DDR_EIE_SBEE); =20 /* store the original error management threshold */ - orig_ddr_err_sbe =3D ddr_in32(pdata, - FSL_MC_ERR_SBE) & 0xff0000; + pdata->orig_ddr_err_sbe =3D ddr_in32(pdata, + FSL_MC_ERR_SBE) & 0xff0000; =20 /* set threshold to 1 error per interrupt */ ddr_out32(pdata, FSL_MC_ERR_SBE, 0x10000); @@ -628,8 +624,9 @@ void fsl_mc_err_remove(struct platform_device *op) } =20 ddr_out32(pdata, FSL_MC_ERR_DISABLE, - orig_ddr_err_disable); - ddr_out32(pdata, FSL_MC_ERR_SBE, orig_ddr_err_sbe); + pdata->orig_ddr_err_disable); + ddr_out32(pdata, FSL_MC_ERR_SBE, pdata->orig_ddr_err_sbe); + =20 edac_mc_del_mc(&op->dev); edac_mc_free(mci); diff --git a/drivers/edac/fsl_ddr_edac.h b/drivers/edac/fsl_ddr_edac.h index c0994a2a003c2..de66f9822fba1 100644 --- a/drivers/edac/fsl_ddr_edac.h +++ b/drivers/edac/fsl_ddr_edac.h @@ -70,6 +70,9 @@ struct fsl_mc_pdata { int edac_idx; void __iomem *mc_vbase; int irq; + u32 orig_ddr_err_disable; + u32 orig_ddr_err_sbe; + bool little_endian; }; int fsl_mc_err_probe(struct platform_device *op); void fsl_mc_err_remove(struct platform_device *op); --=20 2.34.1 From nobody Wed Nov 27 07:29:45 2024 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2048.outbound.protection.outlook.com [40.107.104.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B41D3198A0E; Fri, 11 Oct 2024 15:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660730; cv=fail; b=GdOIZhWeF87lgEZ8kqnY1NkpM2l4SJl09yipREDyQ5XNRZlBbbZ5pL79jGXrVI00OESsmgVB4lnNICWoI0oTWRvNHKxGwCzLiELvnfhM8Gcwu8RqdD+uFKHtDKZ6oTvlywjGSEwi8vuMJkv5qF3AiWWEEgJbqXXTcnV9Z5JMZ0Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660730; c=relaxed/simple; bh=hC0sBAxHzPnh9khLdTN4tfAoX1ZN08Fnf4NleRupY5U=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Ah3xYNFU+oxGBV7rz6FiSav33Nipt/2R9w6mCyVtcLE1u/FbuNuJ+xd8RpfKmVCR5buM+iDnav8RiGTT2TDxGAcHwUSTbK8b8yyOqn2yvea0SWK97DkmWUj8S59qt6U47r9Wbuim3mYFLt/yAO2BA6m2K3KbG/RSN+735wyenNI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=G0P0puEG; arc=fail smtp.client-ip=40.107.104.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="G0P0puEG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JLsMksbZ7ldFthLQgSBiinu453UTWNWDNGfUfR3GUuEOJ0BgpNJvnr5fTWskiQUjQYtIuVAU4D006lFQwn3S1fcvReitIyXR0AbyNTmlAJK+iYIJcKoB+TQ9QZj2ujzAuqUTBXNb/lanwRf2eXx65h1nXyynv1cbWICdLM/+KBhPbUe7pW5UaSFMNWtCnEpkF467H8EYhoduUiTMQdQwYsfalaI5CPGRQpPYZ7DypkFD5LqJ/b8J1gfVWX43Cq98cLYmGywcru900yLDLzxXRAXfCzjC0XXBWxI4bAm3DC8+JzckluR/uX8q1xd2wsSnwyvFduceMaVnqjrYqFhZdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L1ERM/8wrAcld2CBubSctUu43sT3fAk/B7hSFIIETS4=; b=o+f/cSgD11bMsD8XzB/IXsuWxGldJZnt9zj/2fQkKW2uWj0mWBd/97DSrlcWzdTYSL1xE8Hy0PgI562ceKdoYP/4tTLCrAEFAjZlvFX5flCOLLl5AfoDXGgZUFXLqCQjn+Iv59RVwwBOhjP6jOCACMss+y8XDjFLRmxyrC6BdtcjpSpsHHfIdeSDStMQ1Ht3C9kzHtIRyevW01e9YRmw4yLebvchPtvBxrKDe2mRF00+Q8JEMIawtcLbK2ohmrA89euFvwvG4m1yjfkUBHWVcTicuBXGB+7VUTrB1FsS6LOpbpFMcavKoyCdJuoZD1N55H7xuhkfs2Q7OmTFdXXunw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L1ERM/8wrAcld2CBubSctUu43sT3fAk/B7hSFIIETS4=; b=G0P0puEGzrIe3TKl0oNVtsIBYB3BnJYZzuVpU5MGDO23AR+U8qMvHrsRFGjGs2KGI0U8RfIrlzj20JSho4lRSiUAfyJr+Y+8aGW9jtGC5LluFrrinHGwG0myFMGFNdrPLPvbSTjE3aZxulwxgAghu12OCSfNW2nepdECOz5L2mnASwuaYy5YKKVlIPzLn9Yq2aBf2GSH2466pVNKIWp+mZze+cnF4xxQC5VMU5NSjfn0RsdSYY7+I5JSwHJUwumfr+mu6XU4OoB8IoAML+IzKE2aFPBYVlmV56BZa7TD7cLOHbasItb3kekYDHA0ea1m/T8nUVGprGdPxUsV3f7FnA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VE1PR04MB7360.eurprd04.prod.outlook.com (2603:10a6:800:1a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 11 Oct 2024 15:32:06 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 15:32:06 +0000 From: Frank Li Date: Fri, 11 Oct 2024 11:31:31 -0400 Subject: [PATCH v2 3/6] EDAC/fsl_ddr: Fix bad bit shift operations Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241011-imx95_edac-v2-3-011b68290951@nxp.com> References: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> In-Reply-To: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> To: York Sun , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li , Priyanka Singh , Sherry Sun , Li Yang X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728660703; l=1906; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=+xRnp+RgtbOKGy8sOPUGCuuHfdPE/AGGQkiNocVxHng=; b=SMO52SX0EcGfPBqBbXpSDQbbPJX77GVtYwAMuCSnjLrGcDJ/ZFR56hKvD8MaU9TYgbn5zZv6X SFvzBe7b28uClXDQP20eGC60xpABjgiLBoGg2PWiMggsbsRFik+ii9U X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:217::19) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7360:EE_ X-MS-Office365-Filtering-Correlation-Id: 81e99a82-bff9-4492-ba7d-08dcea09dcbd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Q3l5Q0hrYUpVWEMxZlRyZ05OMUV2TGtKN2lpbGg2Zk9BR2tJcFlwLy8wSDV1?= =?utf-8?B?Z24vdmRBbFlvU0IyRGVjS1FMTTRqb1pHNkgyOHhGUzB3YUQvQldMTUJqQjB4?= =?utf-8?B?SFhOeGtMUlM4Qmh3TUJPeTJydDl0UnlyZUN6MkJydGJQbWsrK3N4Wm1Eb1pK?= =?utf-8?B?V241bUtJVDd4SWIxZVoxYUpnMS8zS3VsZjRpeXhqa01yZHcybE9sN0dGek9l?= =?utf-8?B?T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VnMxZHhtRXUzRjFT?= =?utf-8?B?cGRzOW93bnFZUXNwWEt4QmJTYm1Cd0dzT1g3dE5MVVl3QWcyYlN5Q1RVRkJj?= =?utf-8?B?V2haTmx2WkVBeWVqQXZFaEFmR21HSmQvNUhiSDFHbVpwcG5pYVpkUnFITkRM?= =?utf-8?B?UTl1OXJuakkwT0V4UjdIeC9obXdtam1oZi9jSDNLQTZibnRDNTdjc2xDYTc2?= =?utf-8?B?RENFcm0xTEQyYmg2LzI0OE84Qnc4aG9ZQWM4d1p2ZC9lZUdXSE5iUUpqV3pS?= =?utf-8?B?QVVFSEhoTkd0TFFQL3ovSU9FemdBT1A2TDlOcDFrMmQrLzRIRXpaK0U2K0Fa?= =?utf-8?B?M0RKSEhxZS9pZ2hqZmk2VW1LSkVkTnJoRDNhTzJoOW5VOWdLSElRbEV2OUlD?= =?utf-8?B?WWxlQlFkOHd4eWRmeHVlY2YxdXV4RDkxLzlxT010RWxDcU03WnhiZHpmU2Ni?= =?utf-8?B?K2RDWnRYNG1OR1hnc3hNTzVVV2V6TjNzQStMdlp0amFxQkg4YkxHKzhGZE9q?= =?utf-8?B?SXZrNFYrb1ltck5WRXpIS1ByVjJDNFdtYzRhWkI5VkVyZ3J4SmJWTlNFajNG?= =?utf-8?B?eEl6LzRVKzhaTXdlcWROK2JqVU9CS3ZScWRRUUY0a25scFYxRWRnWFRtdldN?= =?utf-8?B?TUwxYmN3Z283REozUGxDMGViVEpTRitabmpJclBLY3lSWXFmN3k1VmVneVBm?= =?utf-8?Q?AawWGVpLXniWZ5TNPnorEEo2l2BV05YwFkzc0=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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JvcTN5VjJpaDlRaFNiN3RsdjZQY245ZTN1?= =?utf-8?B?Nm1mc2tlcjJWT08xUUU0OC9WL0NqYmtTMitzSDB1ZmMwK0FtVmg5L0JVbnRH?= =?utf-8?B?QVUreUJ6YVhJQXZFamdGZVlWWHVmWUMxNnBJRis4RGx2NWVhcWNZS1kxTTBn?= =?utf-8?B?L09sVUpBcHd6b3R3RXBNT3JDS0t0Z0pmZk1iMEtjV0dZc0c4djlXeHQ1dHY4?= =?utf-8?B?SG93d01rNkJ5ak1rTk9pTFVCblhCM1VCUkV3Ymw5RkdvN0tudGllaVcwb0Np?= =?utf-8?B?TlNmYzhpZ2RiN1RpdktzYVFrWGt1bDdZaXFXSURHM1Q5MXBnT0lYSjZoZEFW?= =?utf-8?Q?34p6zLfqiHiOmyEidZYv3WziJ?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81e99a82-bff9-4492-ba7d-08dcea09dcbd X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 15:32:05.9771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lFKsWBLy1iZ/9aUtR2af6dxuthCUaNhrthmyWa/L7QZlUiFUxP6lxL5iv2GgygtHcsW/d1LOBMPm4eKIm4cFTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7360 From: Priyanka Singh Fix undefined behavior caused by left-shifting a negative value in the expression: cap_high ^ (1 << (bad_data_bit - 32)) The variable `bad_data_bit` ranges from 0 to 63. When `bad_data_bit` is less than 32, `bad_data_bit - 32` becomes negative, and left-shifting by a negative value in C is undefined behavior. Fix this by checking the range of `bad_data_bit` before performing the shift. Fixes: ea2eb9a8b620 ("EDAC, fsl-ddr: Separate FSL DDR driver from MPC85xx") Signed-off-by: Priyanka Singh Reviewed-by: Sherry Sun Signed-off-by: Li Yang Signed-off-by: Frank Li --- drivers/edac/fsl_ddr_edac.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index 7a9fb1202f1a0..ccc13c2adfd6f 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -338,11 +338,18 @@ static void fsl_mc_check(struct mem_ctl_info *mci) fsl_mc_printk(mci, KERN_ERR, "Faulty ECC bit: %d\n", bad_ecc_bit); =20 - fsl_mc_printk(mci, KERN_ERR, - "Expected Data / ECC:\t%#8.8x_%08x / %#2.2x\n", - cap_high ^ (1 << (bad_data_bit - 32)), - cap_low ^ (1 << bad_data_bit), - syndrome ^ (1 << bad_ecc_bit)); + if ((bad_data_bit > 0 && bad_data_bit < 32) && bad_ecc_bit > 0) { + fsl_mc_printk(mci, KERN_ERR, + "Expected Data / ECC:\t%#8.8x_%08x / %#2.2x\n", + cap_high, cap_low ^ (1 << bad_data_bit), + syndrome ^ (1 << bad_ecc_bit)); + } + if (bad_data_bit >=3D 32 && bad_ecc_bit > 0) { + fsl_mc_printk(mci, KERN_ERR, + "Expected Data / ECC:\t%#8.8x_%08x / %#2.2x\n", + cap_high ^ (1 << (bad_data_bit - 32)), + cap_low, syndrome ^ (1 << bad_ecc_bit)); + } } =20 fsl_mc_printk(mci, KERN_ERR, --=20 2.34.1 From nobody Wed Nov 27 07:29:45 2024 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2054.outbound.protection.outlook.com [40.107.103.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AD4D1990D0; Fri, 11 Oct 2024 15:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660737; cv=fail; b=FOrAV1CqL4qvyfOtBABBvtVkJ19+PLY8+zAMdNFdF0mLrLiJA8Qesl1KkDByz0I1QUNmfVJUoFVGkTXRuNA01G2u82TWieMdH+CzcqUnSoaVWg20UUuXiQCpuwcuC5KKE+SKw1YC9pyNOB+yxJIM0ZrCQbVChxi6BuYiRwiLFuA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660737; c=relaxed/simple; bh=lyWe/ySMkDZ490wGZqd1uDY524RbQ2uyh4spYd1a1x8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=UW0xZ33tI/kXOl5uFRS8s1eHdRocz0bAmWyOZ8VfsRzQOnMU2g0dkMw7vLxx1Xl5uQibKmS2xAzfrtyy2v/KaDw8I4OhYcn5aYsHtoeqpfoAEvzFzdF6IzMB4f76N3r/qUWzDSKdm2b8uhSP2P4oMckBofzfCA67uE+8fn1uGfw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=i7hM8ayA; arc=fail smtp.client-ip=40.107.103.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="i7hM8ayA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UGxKQfLwGyZREdw4HxRv4wrJ2iZm18NK+X3uwJIdL5cDFGKKWwuB4lOB6trIS/+AL/ak4drnMEqPg/BBVV7vtv6zzq723zVjU+41Va6qH26XT2DUUJZMenROAoLpRHDGk6FaRBlLoExhTLqWmnsxKIMD7zJ1q7IOpc+8VxppIuw9JsPuR8pdOL/COgJdmOQuAhq8nMdmjNypyYiEGv3FohXcFgCb4uygUAPAvwieJtiVpG4etAky4vL74IpCx9mvu4XLLnanut2KKyssPbC2GK/iBnPhVKJbUAaRLh9u6f+pTJ7c5XBqO/wfR9F695r10fEtpVVL00eUJW0roJPbwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qMo2ngT7gPC02/8eJPlx4Oq5Zz9LMuVnQAOCsuCJbzU=; b=NAD4mCozlbfl40y/GccvCefq9CSxXyu4Ulp6rMGucHpGa3Setx643tvnprH09Bw63mSMD82i3pCGDisTGIZMmIya9FZEZNA5r2JVhZ9c7nx+esalTCuJjxq1Hb9nSC3gr4+zkN2ktXdJZLL/OzpnBUJ9Ga0grynRqu7SqZs/39gUnwvgyi81LD6JY2oaq+cZ6XFC61a/hvhMEX6OEO24z4bYQi+zvcJlLumno1aoAVW1WU66N0cspaBcHTshUgQaWdwsngfYlx4mGl4qzojpzut1BDuOfyc0amsDUauywTxZfGjag5zxBl3Pb0CzTWXIXVDLdD+84CvDOABeAGvm0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qMo2ngT7gPC02/8eJPlx4Oq5Zz9LMuVnQAOCsuCJbzU=; b=i7hM8ayAI0mDQCWGuR2nvsP8Z+kKvamnuB7HoxGyy+DMCqvrpDh4RendBFLwaM3BFAi6ra4sE41lwwZBaV46IZEhUomEFsmw6/Aw1oiU4xU8QOiETb2yB9oA7sdcDMi1TiGHl/SNar4L5G2Dx1D2FL0m/+LPtKjniQiCKUnvglONPqRttwpuGB1WuRyhZjbA4QhpTK8hduCU825LBIu8Mso6V5Z8+ivg4+tymHO9lSDPPQItsEhjg6l2jthCHSGEl3IjXgHopb4GUCFkaaht+3P/a+LauaCpFq4Uas2+cd4Sigzf+h4TIgfY2DJaY2bAPisAPuaBSsYNF01JrF7t3g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VE1PR04MB7360.eurprd04.prod.outlook.com (2603:10a6:800:1a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 11 Oct 2024 15:32:11 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 15:32:11 +0000 From: Frank Li Date: Fri, 11 Oct 2024 11:31:32 -0400 Subject: [PATCH v2 4/6] dt-bindings: memory: fsl: Add compatible string nxp,imx9-memory-controller Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241011-imx95_edac-v2-4-011b68290951@nxp.com> References: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> In-Reply-To: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> To: York Sun , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li , Krzysztof Kozlowski X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728660703; l=1970; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=lyWe/ySMkDZ490wGZqd1uDY524RbQ2uyh4spYd1a1x8=; b=8xslh7HyUKmks2Olrk03Ae8GT5TqK/INwuDUBhtlDDIKksmu24kLZyPT7edpKvnbT/Be06O3Z Y4s6zNk2GrFAcsi7vbKkJBbrYW+H64BVD7o25CZGmtRRLxDfSq2Sr6N X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:217::19) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7360:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d46f4a2-257b-47c8-3d54-08dcea09dfc6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OUVVZ0FFdVJlVHF5Qm9TSy81RGNkNUpyUzhMbjE4RklKNVlzZi91ZWlBNkFN?= =?utf-8?B?SVpINUdRSElKMWxTWVdxK1czbkVQbUU0TGN2SmYzcEpOZ1NpaUQrT0NneVlD?= =?utf-8?B?YkdkOEhjMUFjdlgyZjlURE1DeXN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TR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NE5pMGhGaVJualdKZjAxYkJWNGxsdSt5Z1R1Ly9Td2FSSE5TbnN5bmlZaEc3?= =?utf-8?B?clI0bXpGdTZxRWFxOHNuZFNweWErTkhuSk9uMjRMYTZ6VHJmTXBiZTBKblRK?= =?utf-8?B?ano1NXRXNjc3U250MStyMnhIU1B3ZGF0L2tiZFhaSXB4bklqQTNKeEw0bVZ0?= =?utf-8?B?dThTbVh0TnNiNDRNRGdYWkdyZ2dCQWN4ZGVUSGhtOC9QYWg4bXhuUTArcWFl?= =?utf-8?B?NXZTSWN0cFhqSVBQM1ZIVi9QalFjWXFRVkptaVRBaTAvT3hsR2t0Wnc1WFg5?= =?utf-8?B?QlNHNk1TUHNyeE1OK0ZyOFVXU3lQaHV6R3dCZ0RqYkdTNXZYN3FaY1VrakVo?= =?utf-8?B?RWRTSG1DSmZJRFBVVzBTSzZCSmFrSFRrSWUybHNqb1BMMThYdmFWbURtYXhh?= =?utf-8?B?aGlTb2Q2aVZQbDlHWXRZdWFPYXdIbDFmazNCcEl6c3ZyNHRsS3crdDNKSDgw?= =?utf-8?B?c2MxWHNPZE9hQ0RTejM0dHBIcHAxT2NpK0hxKzBZUHVFMUNvZ0JMeFNwWWc0?= =?utf-8?B?M25IR3VFZ2sycCttdkljSmtTWVlSNkx1TFpoT1UyY2F3dWRlc0JrL283dFlS?= =?utf-8?B?TjhPckZleGIvbHlmbHFqLzFQaWNveUFBK0FoQVkrQis5Y1hpLzR4ak5JMXBS?= =?utf-8?B?NnZJSDZiWnVZWFpGUlpiZHptc0dZekp2TTZ1WXVaTTVyUy9vOUcxWXM4bGpD?= =?utf-8?B?Y2Q3ZUZrWjhSc1NweDVFOXNwUDVQeTZKelk1ZGp1TkZKWjRvYkV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nluMEdIcm52SXR0TG1zV2doTnJFcHQvWGxMVmRH?= =?utf-8?B?YlcrYkxDcXdnY25PNGRsSDdkdXJpMUZvQ2VjaWMyRThxVkZuK3ovOTRNUEJa?= =?utf-8?B?dFVWSG5INjBqWGxSOVp5UkZWblpIbmNXUisxRjFYNFU3T3IvMDNvcnArSCtp?= =?utf-8?B?Q2Y2cmlVQ0lWZTRPNFpVZFd1M0pUcnN2eU96Q1g0dkdZYS8vVU55ei9MTzhJ?= =?utf-8?B?ZE5ibk5ObUtLSTkzQ01oUktOejdMdDNhY24xR1FoUzRHVXBuTnFiWUFxNFM1?= =?utf-8?B?OUJyMTMwanlZaXBacldKYS9JTHYzaTdqM2VDQXcvckt0ejFGbnlXU3NMWE1L?= =?utf-8?B?bTd4Qm5FQXgveitiY09TbUUxcXhHMzc4b0pJNzF1Z2VaRzlEeVVUaHFUWHUv?= =?utf-8?B?WGc0Y1oyTEl3d0JEK3B1cE1FS3dnc05XTjJQTzZXUnpEd3N5Vm45TEF2alZG?= =?utf-8?Q?fiQ96sKIaAM0G1p1EvjabuojU?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d46f4a2-257b-47c8-3d54-08dcea09dfc6 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 15:32:11.0828 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VAzlLe0S7kgcgZsVFsmqVLzX02+BJ7gHLOo7jRqF7Oy4zOWWD5Mb7GKeZfsQxtGFNRZvJ5MI1B9tiyf4iSoxKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7360 iMX9 memory controller is similar with other layerscape chips. But some register layout has a little bit difference, so add new compatible string 'nxp,imx9-memory-controller' for it. imx9 need two 'reg', one for DDR controller and the other is ECC inject engine register space. Keep the same restriction for other compatible string. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Frank Li --- .../bindings/memory-controllers/fsl/fsl,ddr.yaml | 31 ++++++++++++++++++= +++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/memory-controllers/fsl/fsl,d= dr.yaml b/Documentation/devicetree/bindings/memory-controllers/fsl/fsl,ddr.= yaml index 84f778a99546b..e0786153eec73 100644 --- a/Documentation/devicetree/bindings/memory-controllers/fsl/fsl,ddr.yaml +++ b/Documentation/devicetree/bindings/memory-controllers/fsl/fsl,ddr.yaml @@ -40,6 +40,7 @@ properties: - fsl,p1021-memory-controller - fsl,p2020-memory-controller - fsl,qoriq-memory-controller + - nxp,imx9-memory-controller =20 interrupts: maxItems: 1 @@ -51,13 +52,41 @@ properties: type: boolean =20 reg: - maxItems: 1 + items: + - description: Controller register space + - description: Inject register space + minItems: 1 + + reg-names: + items: + - const: ctrl + - const: inject + minItems: 1 =20 required: - compatible - interrupts - reg =20 +allOf: + - if: + properties: + compatible: + contains: + enum: + - nxp,imx9-memory-controller + then: + properties: + reg: + minItems: 2 + reg-names: + minItems: 2 + else: + properties: + reg: + maxItems: 1 + reg-names: false + additionalProperties: false =20 examples: --=20 2.34.1 From nobody Wed Nov 27 07:29:45 2024 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2049.outbound.protection.outlook.com [40.107.105.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CE7319923F; Fri, 11 Oct 2024 15:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660742; cv=fail; b=rIwzIqML6RGIo96c5mOnbX0C9Ja8uqwHIY+/Tcy3u/L32LvyGfPHBbJPWQWF9Q2GzbXMk7UH3J6lhfscgxMZZsVexX7oTecWJ3GH/UO/KdrV17y+vCXwKdsDmBjls0LjvFslthsgTt1ajegKq+JgszUu8d7AxqvHVKIjfpLPzyA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660742; c=relaxed/simple; bh=gc6MJagSfltYpYFvAf1m4jDcabhy+YaKNDc5xPAp+Ho=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=akAb3lDhq75loYMnemFRu6+fKa/99o/kqJQNuO2R9n9a3rUQyLSipZyV+RmX92djAf3kkOgQqxGIKTSdGX0Gr2qHExoVQBgV8FBrrPU64Y2VgTvXvm5dyZzQXHbp3sbducf96NLCvt6JLHzv8K9lgcJuMv444DtNUnMdO5X9RIs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=aay3Dn2j; arc=fail smtp.client-ip=40.107.105.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="aay3Dn2j" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jcLEpqRJuzlGlA3iCLpBg0/IxZNqCuW0pKav7l3Stly/ABlQwtEAEyMpDloOjijXVMHh/iJ1osmpBz6DGlFlKMtgZAnRGWFoz0TqC+fRY2YjWDd+tB5mW1CmEa7zSrSO4n7j+ILLOd2j+TTEGIE9TG2K3vbof9EBaGn5puOT+8kmwD5/qJuacdydUx3ofWMKDKDKOQeFjhuDomCHosrEW40T2EQ8DvySy79u8AdqI/ShzHaUnJH+GQLNE3L7yxralF1PA58EeHIuGkUVNgPjI6lai0XJFMXMfkl2iHoVkzg5cMj0zx1Z5VGveMorEefm4yHkTYnV3yA1OgxzD1k0UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mxG0yqWh7JOJe4yZxrUWXuSBYgE7RS5YP+66smYxrH4=; b=eMyA8FCBU72m1skytn6Q3jI4wxNe+qcSmh1mdni7IvGezY1rhM8CfTmHCEimZTW0VMzGFxRqn8D8/wvQLRyaDzGEGuDmL44JgLqcA2Jkork4SHGApaYuVqW4nwXvz1UpmKjtzP69b1QlG15v2j1B80Z2oTBJ7ct6RkgjVDaGkW05TpdDi01eP/MPWxd6mds2zzokiapJCJ27S/ap2gSvp25lzVV54Uz3rTGhTOcv87rktrHHjmNm0miYNhqRGMoeSxEoS6nGjt3x2Z8N2eJ/qxQwawXmIdj7Mhstv3RnPM/8UeDNfxeWv124J8L5142dTzxA2LJJZJIq4FhH4SRGSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mxG0yqWh7JOJe4yZxrUWXuSBYgE7RS5YP+66smYxrH4=; b=aay3Dn2jnbWT2/c1UmxcgJeUjgkggG6D7a0qkmO4uYWGI44lYJEqQFuyH0Wn5aj5I6Pg75IRWLT5jgtF7juC9ReRAqrAeCP4VPq74iQYJTeWLwNz9mFXNeemBaEKwfvJKu3400CGA3R+F7bNNrHQ7wKRrTHNzg1jk54zgQuxpqUhxhjdk4datZl4m+gVP+sTsfjVnR285i7+Ao8TEAuMXypARzRiCoEgP2PhToyG6AsvIhoYO+uK3y6a2t8JJs7WiC25XbzOJt8ydowEcyhTkLyq126lt95sGmIpuyJSEZWMgBQEz4QjMj6192u8liWXQx7ATMbSoupPBNPtQFRK3A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VE1PR04MB7360.eurprd04.prod.outlook.com (2603:10a6:800:1a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 11 Oct 2024 15:32:16 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 15:32:16 +0000 From: Frank Li Date: Fri, 11 Oct 2024 11:31:33 -0400 Subject: [PATCH v2 5/6] EDAC/fsl_ddr: Add support for i.MX9 DDR controller Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241011-imx95_edac-v2-5-011b68290951@nxp.com> References: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> In-Reply-To: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> To: York Sun , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li , Ye Li , Peng Fan X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728660703; l=5954; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=M8I8hajo7XY5xWGLxmn0PTrzPVpEdSTe8Q2nAI4GQg0=; b=7h4BJZ3mCnPCp/AD4A6vgkBR47ZLFq3MbXdu65ZwN022GV3hyVKXT7toQyBv/9i4bctjP0Ft0 aj4V27sIwQsDXUdWxSpOFedzyS1TwYkXpKBShyGiDlE4goRrDDvTEmo X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:217::19) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7360:EE_ X-MS-Office365-Filtering-Correlation-Id: d0c13928-fb2c-4cce-5701-08dcea09e2eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NW5PNDZqZ0NIOUxnVkZhY3ltbmYrUllhdytUZmVPT1NjUnZ0aTRQTWhkMnNS?= =?utf-8?B?dTRBYlk3TFVFSGpnTmdrTmJHOUMwSGQwR1VGSlFPZk1DRlVFZTdVUE1XS2dx?= =?utf-8?B?OENoa2o5cDdMaUp5WVJTN1BRWHBmaHcxQ2JYYXBycGFBNjNtNkIzQkhGaDNt?= =?utf-8?B?UE5ka0JHdjdVRDF2dGE3WUNycXJQRG5nekx6Wit6ZndQSDhURGpoZWxZdTFC?= =?utf-8?B?cGxvMl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?= =?utf-8?B?UGFabW5CNVNTWTI3c1RDYW54dEtPMTJJRy9DZkZXUjd0ZC8rdm5URmwrUkV0?= =?utf-8?B?YllDeDVNak9EQk1VTlBvWWFvWVM3WGtZNGIrdDF0cjBVYzlaZ3FneVVjd04z?= =?utf-8?B?K2oxTm05aVJyRDJTZ0prdXovVzB4NTlGa3M4MytFRjg5Y1RFL0JsOEtySDRm?= =?utf-8?B?TUhSYkIyVTNuakJDbG1IOHJlRy9WUDc1MW40VTVWL0RSVGM2bFZPaHBWSzlW?= =?utf-8?B?NU9paytvZTQzV3JVQTdDekZBVHc1QjR3aDMwdEFwYk5ESTZOVWlhUkt1NmxZ?= =?utf-8?B?dVFhbkJ6ZCtNZ0xvUVNCL08zL1hlTFRGZVc4UFFNcGpqMG52eW15QlZIME9j?= =?utf-8?B?cFVuVmZVb092M0dudFBvS1l5UXRnS1g1dFU0c3FpdzR4Q1Bjd1pTNzcwL20y?= =?utf-8?B?dFF6Y0Vnb1BHL3EwTWhMVVZDekR4TTRrcVFIUHNPemNDbklQczMrTzBzZ3Jr?= =?utf-8?B?T2FYOUZGT2V1RmhPNFE2S1VlaHdjaU5KbFBuV0hoNVJ3SXVjVnF4NHpnWHND?= =?utf-8?B?aGcwQlNMdUJkanVnckZXSGFEVmRWcUJOZkpsbDRXZjRjQ1YvalpUSDZhSDVF?= =?utf-8?B?WlZMVW44dENwRm9HUjk4MXBaUnFiZ2Z1RitGZ1NOY2pyL0FnNGNtWGZZanlB?= =?utf-8?Q?nBKZtZx3RMESke0E7/EMLyfMNZJNyUcJQkq9o=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-A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ybzhTd1ZVbnZ2Q05lQ3d2UjVHbEdacFU4OTJCVzcxSUdqT1UxdU1U?= =?utf-8?B?L3JRUEc2NEJRUDFtZXBzcWZ1ZkNMNmg3MEhFbWhScXVTdWhHcU1TcTJPb1ky?= =?utf-8?B?bWpLVklBMXI2VVRnYUtZblBmSzdqN2U4akNFZ0pMT1BJcnpNVWpjVE1MRnVi?= =?utf-8?B?bFdVN3Q1ZHBrblNTblhTOFR5ZXRPYjFTeDM0cHFYaU1tRDc4V3Y1aGRSUENV?= =?utf-8?B?bUtMWmdrcnZhQnV5eFlNdkFiWTRzRVZMTEVNR0c5TGdHSkg1V0JUSkxuSlhH?= =?utf-8?B?dDBQZk5OYk9TQUdjS2dWNzZOT0pyK0dCd1pFZE5ud0lWcjJRa2dkdWpPUmEr?= =?utf-8?Q?CJn/lA/KMBzvyumhiqbbYjcSA?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0c13928-fb2c-4cce-5701-08dcea09e2eb X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 15:32:16.3282 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CM6a9wDgmT5mkqJx3mQ2KWmar3yeGEkA/uyOv60TPEmbr6WPJLnksdh+qTMyqDSYVX1Bb37il+3vCXL6w5g3aQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7360 From: Ye Li Add support for the i.MX9 DDR controller, which has different register offsets and some function changes compared to the existing fsl_ddr controller. The ECC and error injection functions are almost the same, so update and reuse the driver for i.MX9. A special type 'TYPE_IMX9' is added specifically for the i.MX9 controller to distinguish the differences. Signed-off-by: Ye Li Reviewed-by: Peng Fan Signed-off-by: Frank Li --- drivers/edac/fsl_ddr_edac.c | 48 ++++++++++++++++++++++++++++++++++++--= ---- drivers/edac/fsl_ddr_edac.h | 10 +++++++++ drivers/edac/layerscape_edac.c | 1 + 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/drivers/edac/fsl_ddr_edac.c b/drivers/edac/fsl_ddr_edac.c index ccc13c2adfd6f..3e4c2869a07cd 100644 --- a/drivers/edac/fsl_ddr_edac.c +++ b/drivers/edac/fsl_ddr_edac.c @@ -31,16 +31,28 @@ =20 static int edac_mc_idx; =20 +static inline void __iomem *ddr_reg_addr(struct fsl_mc_pdata *pdata, unsig= ned int off) +{ + if (pdata->flag =3D=3D TYPE_IMX9 && off >=3D FSL_MC_DATA_ERR_INJECT_HI &&= off <=3D FSL_MC_ERR_SBE) + return pdata->inject_vbase + off - FSL_MC_DATA_ERR_INJECT_HI + + IMX9_MC_DATA_ERR_INJECT_OFF; + + if (pdata->flag =3D=3D TYPE_IMX9 && off >=3D IMX9_MC_ERR_EN) + return pdata->inject_vbase + off - IMX9_MC_ERR_EN; + + return pdata->mc_vbase + off; +} + static inline u32 ddr_in32(struct fsl_mc_pdata *pdata, unsigned int off) { - void __iomem *addr =3D pdata->mc_vbase + off; + void __iomem *addr =3D ddr_reg_addr(pdata, off); =20 return pdata->little_endian ? ioread32(addr) : ioread32be(addr); } =20 static inline void ddr_out32(struct fsl_mc_pdata *pdata, unsigned int off,= u32 value) { - void __iomem *addr =3D pdata->mc_vbase + off; + void __iomem *addr =3D ddr_reg_addr(pdata, off); =20 if (pdata->little_endian) iowrite32(value, addr); @@ -438,6 +450,9 @@ static void fsl_ddr_init_csrows(struct mem_ctl_info *mc= i) case 0x05000000: mtype =3D MEM_DDR4; break; + case 0x04000000: + mtype =3D MEM_LPDDR4; + break; default: mtype =3D MEM_UNKNOWN; break; @@ -471,7 +486,9 @@ static void fsl_ddr_init_csrows(struct mem_ctl_info *mc= i) dimm->grain =3D 8; dimm->mtype =3D mtype; dimm->dtype =3D DEV_UNKNOWN; - if (sdram_ctl & DSC_X32_EN) + if (pdata->flag =3D=3D TYPE_IMX9) + dimm->dtype =3D DEV_X16; + else if (sdram_ctl & DSC_X32_EN) dimm->dtype =3D DEV_X32; dimm->edac_mode =3D EDAC_SECDED; } @@ -483,6 +500,7 @@ int fsl_mc_err_probe(struct platform_device *op) struct edac_mc_layer layers[2]; struct fsl_mc_pdata *pdata; struct resource r; + u32 ecc_en_mask; u32 sdram_ctl; int res; =20 @@ -510,6 +528,8 @@ int fsl_mc_err_probe(struct platform_device *op) mci->ctl_name =3D pdata->name; mci->dev_name =3D pdata->name; =20 + pdata->flag =3D (unsigned long)device_get_match_data(&op->dev); + /* * Get the endianness of DDR controller registers. * Default is big endian. @@ -538,8 +558,23 @@ int fsl_mc_err_probe(struct platform_device *op) goto err; } =20 - sdram_ctl =3D ddr_in32(pdata, FSL_MC_DDR_SDRAM_CFG); - if (!(sdram_ctl & DSC_ECC_EN)) { + if (pdata->flag =3D=3D TYPE_IMX9) { + pdata->inject_vbase =3D devm_platform_ioremap_resource_byname(op, "injec= t"); + if (IS_ERR(pdata->inject_vbase)) { + res =3D -ENOMEM; + goto err; + } + } + + if (pdata->flag =3D=3D TYPE_IMX9) { + sdram_ctl =3D ddr_in32(pdata, IMX9_MC_ERR_EN); + ecc_en_mask =3D ERR_ECC_EN | ERR_INLINE_ECC; + } else { + sdram_ctl =3D ddr_in32(pdata, FSL_MC_DDR_SDRAM_CFG); + ecc_en_mask =3D DSC_ECC_EN; + } + + if ((sdram_ctl & ecc_en_mask) !=3D ecc_en_mask) { /* no ECC */ pr_warn("%s: No ECC DIMMs discovered\n", __func__); res =3D -ENODEV; @@ -550,7 +585,8 @@ int fsl_mc_err_probe(struct platform_device *op) mci->mtype_cap =3D MEM_FLAG_DDR | MEM_FLAG_RDDR | MEM_FLAG_DDR2 | MEM_FLAG_RDDR2 | MEM_FLAG_DDR3 | MEM_FLAG_RDDR3 | - MEM_FLAG_DDR4 | MEM_FLAG_RDDR4; + MEM_FLAG_DDR4 | MEM_FLAG_RDDR4 | + MEM_FLAG_LPDDR4; mci->edac_ctl_cap =3D EDAC_FLAG_NONE | EDAC_FLAG_SECDED; mci->edac_cap =3D EDAC_FLAG_SECDED; mci->mod_name =3D EDAC_MOD_STR; diff --git a/drivers/edac/fsl_ddr_edac.h b/drivers/edac/fsl_ddr_edac.h index de66f9822fba1..73618f79e587f 100644 --- a/drivers/edac/fsl_ddr_edac.h +++ b/drivers/edac/fsl_ddr_edac.h @@ -39,6 +39,9 @@ #define FSL_MC_CAPTURE_EXT_ADDRESS 0x0e54 #define FSL_MC_ERR_SBE 0x0e58 =20 +#define IMX9_MC_ERR_EN 0x1000 +#define IMX9_MC_DATA_ERR_INJECT_OFF 0x100 + #define DSC_MEM_EN 0x80000000 #define DSC_ECC_EN 0x20000000 #define DSC_RD_EN 0x10000000 @@ -46,6 +49,9 @@ #define DSC_DBW_32 0x00080000 #define DSC_DBW_64 0x00000000 =20 +#define ERR_ECC_EN 0x80000000 +#define ERR_INLINE_ECC 0x40000000 + #define DSC_SDTYPE_MASK 0x07000000 #define DSC_X32_EN 0x00000020 =20 @@ -65,14 +71,18 @@ #define DDR_EDI_SBED 0x4 /* single-bit ECC error disable */ #define DDR_EDI_MBED 0x8 /* multi-bit ECC error disable */ =20 +#define TYPE_IMX9 0x1 /* MC used by iMX9 having registers changed */ + struct fsl_mc_pdata { char *name; int edac_idx; void __iomem *mc_vbase; + void __iomem *inject_vbase; int irq; u32 orig_ddr_err_disable; u32 orig_ddr_err_sbe; bool little_endian; + unsigned long flag; }; int fsl_mc_err_probe(struct platform_device *op); void fsl_mc_err_remove(struct platform_device *op); diff --git a/drivers/edac/layerscape_edac.c b/drivers/edac/layerscape_edac.c index 0d42c1238908b..9a0c92ebbc3c4 100644 --- a/drivers/edac/layerscape_edac.c +++ b/drivers/edac/layerscape_edac.c @@ -21,6 +21,7 @@ =20 static const struct of_device_id fsl_ddr_mc_err_of_match[] =3D { { .compatible =3D "fsl,qoriq-memory-controller", }, + { .compatible =3D "nxp,imx9-memory-controller", .data =3D (void *)TYPE_IM= X9, }, {}, }; MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match); --=20 2.34.1 From nobody Wed Nov 27 07:29:45 2024 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2049.outbound.protection.outlook.com [40.107.105.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9E921993A3; Fri, 11 Oct 2024 15:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660744; cv=fail; b=g4/0G+/aInspR+2sd9TCH037S7cpUDGGOEVkc+O8X+XSGe26xISBttUNTAJr9kayVDP6c6aueNxj88LMiL+DMmnmXgfB8ipqPcwyGXJnJYSwZg0zSrd84xo9OqolTQtOXHbiVrsbOC2ROkZ9QhIQFfV7+48B65oQDx4m/jcjHt4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728660744; c=relaxed/simple; bh=79MXg57Cyd0Ls8RHW05eE1dZDeIAJiwGUJukDHuBEDA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=iCQHLQCowjAr8XC85jPM4FhbysgzfdwNpZQhLy8cmjOLR4ZCQA++iy8MrRmYnDi8+ZDoO8+fZb0HwiMMb1pPEUbvXGh/f2GJAIJNCAvXiv7ymisGrQBgIUcNjqsShlA7HcAkdnenCsUKCjTyqrC5VMjW1nOK9bhXRLPnE5otnTo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=PLi83TMZ; arc=fail smtp.client-ip=40.107.105.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="PLi83TMZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yR5Cdc2Y3t2N5YYhxRYo+a5UKax2dpU2cBbaKGYsiFagmc5cq51qSscHCVlTNUGi9sZ4liSUR60S8QctwPJ3S2o9Sb6+8CMDUNDS49YDqyeGeg89g9N5hNf2Q6LQt2DCr/OjDkQF1oFdUJn/5zXYkmhUtu6Ad0ZnONgGdbAICqheq42dKILNYIFjnEaR/Bn1W8lJGyVG2irwockJYZZmiIx+5mIpG29UtPs0ZR9YAC8q4go8TXAu0dQnMyKB3pOdy/JUQqG7WSEJixw0aXwrwwg5cNHPVpqQHs3bp2veYTLIoTnyrPAxO+nwWfqVKu4zVC8NK440L13k1k+5ocJByg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yMjEE4+kvbYP5U/kSZ9Rky2OKvC/sfNSCk6XWJ+IRQI=; b=O+tSwGhWprLNHWAsFWHuyxmAu0T58MIDhuV5ojTv5RW8lZGtCcraV0LQnKxqB+4l4CCUioayvLqPmBchMPoy3oqrS23wWRx4zRxD0DJtpPcZcbrll1yBRn2/Eq7CiSv9q4a4qbP3cN5ma5XXFDm9KtQnQE/kgo+3+F3GVa7iB+Fc91w8jd9oSzKcIjOVE7MlGgsJpmGEaNabs/5lblJ4WKo2OLyiJYvOHgveJQFkh7Nu/NVjQHyuGjkdFUSv4Fq6Z/m2uhpBOF1DR70uYyqSISufwyHLXrjLrnFy7henQJ2L90WvEKoowotcI/rDclImLTvcwz22dCQfxsi33tO1+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yMjEE4+kvbYP5U/kSZ9Rky2OKvC/sfNSCk6XWJ+IRQI=; b=PLi83TMZidU4AWRXwiFqx4oEESOhJUgzghaC1b6j27pqsI98qXknViwvyGD3dGNC36rzySCHYN/re1Mx9UnctXRapwDsLYyFsLTyXY8fIDIYR8zOLIgyccSWUABP8QAkR+Q58ivQGLh/bKrBrVYYU+4MLgCZJckRJAcXAOt29exMg0/HR8MXLVISatbcmmPztltkTgYhH4cf/bN8Dsnk8QXCGIRYOaYjvxSpRm0k1bPSfVebIdnx07AnrrOiOt8t0YYJKEccCNlMCEwQN4/JmC6a2aLdtNNLb2sEKSOY0ob9eTb4vZvYnwUOr749eyWMDhoFyvgqeik1Ezi+Mf/hfg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VE1PR04MB7360.eurprd04.prod.outlook.com (2603:10a6:800:1a3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 11 Oct 2024 15:32:21 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.8048.013; Fri, 11 Oct 2024 15:32:21 +0000 From: Frank Li Date: Fri, 11 Oct 2024 11:31:34 -0400 Subject: [PATCH v2 6/6] arm64: dts: imx93: add ddr edac support Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241011-imx95_edac-v2-6-011b68290951@nxp.com> References: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> In-Reply-To: <20241011-imx95_edac-v2-0-011b68290951@nxp.com> To: York Sun , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Krzysztof Kozlowski , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1728660703; l=859; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=79MXg57Cyd0Ls8RHW05eE1dZDeIAJiwGUJukDHuBEDA=; b=w6Ci5x6+kUwU0qSrTG7LmFOXnAYqjOYX6i/PqI9i2yScNOg94SIwsb40Ls7cAvvfpqdhHtsPA hsOP5cFadw4Cqf3eRo3/Bj5l9CGbI4jnuTSUm6uqBOuIIVdIxI5Xv4a X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:217::19) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VE1PR04MB7360:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ecc51ff-41c7-4431-29ca-08dcea09e5d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?V0RsUy9oSlFld1Nsd011a1JMRk5KTkZ0RWxCN2JVVE12TWpsWGdlSnB2aGMz?= =?utf-8?B?NUxuajhoRzRmRVlvZW9xMy84S24rMStOckprZjJkeVQ0aG42RmRuRlVTWVhL?= =?utf-8?B?R2VSbUY2YndWdWFjVGpQbmMvRDZVY1gxTnprdUJTUWliMzlLQmd5VDJTZ0Nm?= =?utf-8?B?MWtHbTBUaUxkZitpR1dhU3M0VUt1ZGg5WnpFSXhRNGJ5cDF0YjltWC9xNWVm?= =?utf-8?B?WGlNeW5PSEVUVEd2ZllLU0hxd0hZdDhHOFNPV05wbUhLcHMwWDlkditHSUxu?= =?utf-8?B?aHlIUytBNjg1VHJYTEFObitIS1ZqWTBGaC9BQm8wN2pGTlk1MzY5RUtKSjFl?= =?utf-8?B?SVdhSlZSbFE4dWc5YzVWUHB4Y012TXVRUTZjbGJocmtsbm4wQ3FHMXlNWEdu?= =?utf-8?B?elo2SmxubnFGazFWaWl2L1BaZVRLNmlLOFN4dmtqaUU4Q1Vkb1JyWnpLWTdu?= =?utf-8?B?R3o0NkNvRkhtSjhVTjFFSktRSkNCdElPSHZUTlVuVVVmU1dudzBRS0xMRElK?= =?utf-8?B?ZEIzUjFyczAvQ3d6a2JaQ3owZnBzUzBaT1hscHV0NXpuK3ZZMTZVc0hUSkFw?= =?utf-8?B?anp5Qk8xNCtXYlZRblBwNFYyVnVCaFFlZGhuUzZZYXR5N2k5TCt4WEJ0QTkr?= =?utf-8?B?dzBycDZueGhTVFR1TkU2aWxVK2c4VEJPbm5sQnNROVovOUxkY1Y1czFNOTBn?= =?utf-8?B?NjNyMlFzb2FGTHc4b1NoeTA1dkxTaFNON3VRVVFDbEtpMWZaN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EzeGRlaHBZVzFwUVFEOVloUUhL?= =?utf-8?B?TVFSOGRJN2NmVGFMcmlxMlVwaytTSmFsTkNYeUhnSjl6ai96RnMwTVpHeGhL?= =?utf-8?B?dVFsY3ZPTnpSL2RkeUYxYng5L1JqelU3RVpQYkVxeUlZaWRYbVdHRmltZkJ2?= =?utf-8?Q?4bdJRhAbORkUaPkw9c5VivgqpO1nifDBY9GeE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WWZFMTVxaGxzT3lpd0Foc2kwaFU0dkJQenltWEFrRDQ5ZmJPbE10d09nSk8z?= =?utf-8?B?QWpaVUl4YmxCVnVSQytWVDZhb1RsdFFRYzdzUHEvS1gxOTdMNCt0UlJhcDJp?= =?utf-8?B?djRMSUgxOWFBTTE5NmdmVDBUYmIwYlR5dnIxOGR3eUxuTUU2NTZUUFF2aEhh?= =?utf-8?B?YmY3VXZlTC80VitxV0VSUGxaV2dVeitHV1JxMC8va0ZiY0w3L0l4aXZNQUF2?= =?utf-8?B?akN5RWRJbzhOOTNpWEpzVUx1aUxVekgxbUo0SytWaDc5dFlrbHJGSHhuY0Mr?= =?utf-8?B?VXEyaUJubVBVOGVkSlJkV3FiMmxSTEJvMEc1c2QydkR6UGxIeDZ5M3hxKys3?= =?utf-8?B?TU5ySmd5am9KWkcwZUc3UG9SanFKQnhGZ044VnQ3VmNKYUZKTlZ6UGhUN09M?= =?utf-8?B?dGRSTWU3TGJhZVY1T1REQ0Q5QzNJOEJ0NTRqSkE3NGkyUVdnYWpSTy9ESENx?= =?utf-8?B?bkpjeGNycmp2T0ppRkRsaHJ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YRmtJSmxac1NjaFJlU2Q1c05SMG5xcytnQ3pFNUVvbVZ6d2dB?= =?utf-8?B?YTdXYWZ2SW5udU95RDhlVDc5dzdRcTkvWlZoNEF3VTc2NWVraVkraXd0Tmh5?= =?utf-8?B?d2xYT3BsVHpSVFo4bVFDalZoL3huKzBxSFFKVWw3b1R6QjZuYytOTGV4VnJl?= =?utf-8?B?bnpxR3RzTTEvdlpBem44cEhxZTlhWWJZdmdPYVJHZ3JWUmppclZqTmxyeXI0?= =?utf-8?B?VkF3cG13T2grcEEyM3hDcmVvV01NcVJBVFBZY3FUMGJNaytuY3J3Y1B3aldJ?= =?utf-8?B?S3IxMUQ1a0oyT2NNWU9vMnFWaVhVS3ArN1FaUHpCd1l1Q20rT0Ewd2FHcTRL?= =?utf-8?B?YndzVlJ2bm1xZlA5NDM3d3NXVHIzUVd5SloxdllUR1BuWHJMOTRrY3krakk0?= =?utf-8?B?WHpjdU5rYjFhV2kzd3YwVEQ3NS9VVXdHcCtCYVI2ckZLZmZSakFrQ2xQcERF?= =?utf-8?B?RVlkd1BiN3dvRmI3MUR0OHBycFBSQUVFUTVUR0lIWVBEY1JWbnc4UFpZRExF?= =?utf-8?B?ZFQxU2hwZXpJTEQ3TXJGUXlUNVN1ZmtvMWI5YnZlRExSRFRYdnIxY0o0R3hm?= =?utf-8?B?QnRFaG40eitFcnB6bWZHN2xIeWlQUzVhclFzMWNzeFRIMlhsOWV2Wkx0MVVT?= =?utf-8?B?WE5MNXlvdGd2aXdhRkRpWWp2OVJDVnhyYmU1clEvYVhVSzRBTC83VWRlbGdP?= =?utf-8?Q?TmfYIED215bweKXfCp6mqrXv/?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ecc51ff-41c7-4431-29ca-08dcea09e5d0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 15:32:21.1975 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8223AXzy8ZNfxYC4tgebjTU7tWrq3C6iRXMi7JjL1FTJ3E6suRmcNJvdXXgz2ikEi6XDl9h/GSceJt1H3EGAww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7360 Add ddr edac support for imx93. Signed-off-by: Frank Li --- arch/arm64/boot/dts/freescale/imx93.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts= /freescale/imx93.dtsi index 04b9b3d31f4fa..ea83e38ae4d88 100644 --- a/arch/arm64/boot/dts/freescale/imx93.dtsi +++ b/arch/arm64/boot/dts/freescale/imx93.dtsi @@ -1326,6 +1326,14 @@ usbmisc2: usbmisc@4c200200 { #index-cells =3D <1>; }; =20 + memory-controller@4e300000 { + compatible =3D "nxp,imx9-memory-controller"; + reg =3D <0x4e300000 0x800>, <0x4e301000 0x1000>; + reg-names =3D "ctrl", "inject"; + interrupts =3D ; + little-endian; + }; + ddr-pmu@4e300dc0 { compatible =3D "fsl,imx93-ddr-pmu"; reg =3D <0x4e300dc0 0x200>; --=20 2.34.1