From nobody Tue Nov 26 19:46:48 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2073.outbound.protection.outlook.com [40.107.20.73]) (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 B46A1176AB6; Wed, 16 Oct 2024 20:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729110698; cv=fail; b=KH4mLWEB5Yi54nCwRFbMUqUDbKRyWaUtyZmj/W6NPRRRHwUpLC4zMH60f64izpWIWgsEK5OvXf3iWLG6c4KPNHVurboCOuo2VHaSd7DR/VdRJx78eqUf9yT4frm9Lvsu+5kRy8sODNXDwsL4/PzNxJMVecFFbFV9yfPVtbLz6u8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729110698; c=relaxed/simple; bh=tWA2t7dYpkCGQPCP1WcAIC7H3OdUmQUbtGujuyE7dVw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ZEm0Juc0VJ5Qox6US6nwRqSRScFtZie5slRtr8L6y/qmZGUzUggHDzP1UJ6KhI+yn3T5FEzHw1l+MILPgR2tUI5cZzJDz7bhH4//sgjaVyjwixAR2fCn0UzYhoRFvPY1RhEix1YFQhelxS1cEFrlA5WTWz631cCoQdZ+QtjHV0k= 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=HaUuf68g; arc=fail smtp.client-ip=40.107.20.73 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="HaUuf68g" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rArMl372FD+nVxbux3L3mBZabLu/qSSChwHXmhakA3I0TyjZ5ggdjx++PMDiiyO10U5YBjCb9wfJDea3XQcbp8p/hNO+d0Ypu/xrL2vCLLEUQb9Km7jFlBerGyRXINqqmAMV8xfNQFXffozTj8U4i9yHNMc89g0gOEA1Yk3b4loB91WzVjLpQluyMHDIv9lh5J9eCypVyeFXekL7PjBNeZTDs3Yi1/bZGWSEgtDn9W5sOwsj7jRAMgSZVrilbl0IH7uraA/xpe9i/SYtGcphnYW/e0yKA8F/gXYD9KwdZgKffyHf4BtKifSfjUaTJkY9nyPAyGM4HY7/fFkUkeGf1Q== 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=urJICd3lbSdxaxqeEJplrHvCl1CJfsObgNCFo7v2RW2v4huggHbO3aVv6rkAeIFc/D0rk4lDMLb0NOOhEToreqtV/pyuJ0KmnSBzsJDiW9zV6Tjw6HpEOuxSqNnBU/VGuLtno/F/omV1pR12sHbfzbnKXJ49vFuB/wj/KRGBxbrqp7I1hfiN3fm4ZeQKEO3UrhfbUVHqN6Y0/L/ogqu9d0o+wfLh41inQz3ua2RzuU3BiPWFcQnIiDgjMxD5eAV1OowavrVjYCUVLZAjukL3OowcoEzKUsALTeHRHTb3veTzZ5wrelxw/awTUBduwnorEYOkuwzcMWVX0efeCCq8GA== 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=HaUuf68g2dbWxFoph3+axCosMY3+NBHKGOWhZ9NruHfWVJLIRswwoq6oSSdpkgbjL/7faaLBFdQHnCInv6glhsTL6XPF7zIMfn/rDAJTXGgDVY0FPBpLo/L0y4ihGalAtZS1As9GIl99I82zxX88tdoj7fJ71SUs4lbnhEvdHxt/+IzUU2m1kAXHVsDQK7VEPzq9PJzmVPUi8huZxGgI1IQBFfnsnGaX5zlAUVZEhsPrvztmZ9pyCkiNZhysr7TmzJ/O75rpv+G/usIUmSeu6xOFrDvPHOm67Zcl6dhnPzNiWX4n2J7qbRbYfg5li2cBD6m0h5+TacnlQvFU0pevfg== 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 DUZPR04MB9845.eurprd04.prod.outlook.com (2603:10a6:10:4d8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Wed, 16 Oct 2024 20:31:34 +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.8069.016; Wed, 16 Oct 2024 20:31:34 +0000 From: Frank Li Date: Wed, 16 Oct 2024 16:31:09 -0400 Subject: [PATCH v3 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: <20241016-imx95_edac-v3-1-86ae6fc2756a@nxp.com> References: <20241016-imx95_edac-v3-0-86ae6fc2756a@nxp.com> In-Reply-To: <20241016-imx95_edac-v3-0-86ae6fc2756a@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=1729110683; l=8457; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=tWA2t7dYpkCGQPCP1WcAIC7H3OdUmQUbtGujuyE7dVw=; b=34tuxc5Oxl6QFwxosBHK4hU0B75MJTe51HVmMDYoaMh+3EeG/jrcNLOw3slkd7+tm2ffcoHTI jkuMYiZpWtCD1/fhprUINqz30X9P7tU1Tv7YHghohKKDFDt09Ynp23S X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR07CA0042.namprd07.prod.outlook.com (2603:10b6:a03:60::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_|DUZPR04MB9845:EE_ X-MS-Office365-Filtering-Correlation-Id: 85a3b70a-3e17-400c-beeb-08dcee218709 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|7416014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: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HBqZWZYL2FLZmFW?= =?utf-8?B?OWJRQkRJSGo1VHVSOVNmMVAvQWk3NE9vYmJ2c1dRTlJUb0JxQ2xVV1hCTjJC?= =?utf-8?Q?226FE5O1mRc2M?= 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)(376014)(52116014)(7416014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MkxFdmk1Nmt4OEgwWGtPWWtmR0x3SHpXRlNmTkFQSzBPbmRGZzJiayt1N1Er?= =?utf-8?B?d05jSWJjdmt4K21lOHVCRTBFQjBQbC9JejdTeUpQNGZzNzhReWhhT0JOZzA4?= =?utf-8?B?SkcvRTdmSGtnaFNxMkdiMmFGWmt1UkhwZk1KTUh4enRmVnB6VmUvUHgrOFgv?= =?utf-8?B?QU5Ec1QvY2M2NUQ4Y3lwU3JseURPMDBIRHp1WW55UkxvRVBnOWkvRWRhcWUz?= =?utf-8?B?MTczSnYvUnZHck5TOExhZkhVMHVuTXZUK2VSVVZMd0JFY0VNUkV1Znczc2dG?= =?utf-8?B?YnVPTkZpY3VFaU5tcHZhT2ZGNEdHd1VyRm9qbFhBMWg1Z3RKMklGTy9haVVO?= =?utf-8?B?eXhTVEgrdXNmc2pUTFRMSTZ4TXI4QmRSM3ZucVlqTm5JMmk4eTl6N3lEOE9p?= =?utf-8?B?amxRdWJTYVU5MW9STk1Kam5SaE9Kdit2L0xLNGEvdlp4Nmc0ci9oUjJuRzhy?= =?utf-8?B?aCt1OVFaajhIVUwwVmRaRE00WENzckQzcnEvdzBpcHBDTU84Y1Fad2xSTVl6?= =?utf-8?B?S1FBZ0l3MlFIeVNmUFhYUU5xZHVnbjZVM2l4aTVLakFtSG1VYVFiV2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Vya1FPcDIrbzZoSTlTSk1IWVdxczJiSlBOQVNseEdt?= =?utf-8?B?eFgrNDVMOGM3elozcVFtL0laTzVnam0yb0xBdTM3TVI2anZ1WDRLcVRUMy9E?= =?utf-8?B?dk0zdWFiMWhrejZlNkZVYVg4bGtkWHZ2anpyMGFTTEdnZzY4c0RxMS9zQjd5?= =?utf-8?B?d0JUZ3ExdFpvVTl4TDZwQjdvbnUwVXlhOHBtbTdrTFU5VDMvcW9iT0FiMWVM?= =?utf-8?B?MTB5ZHpyc2hzOTlwcFJoakgrNGJMWHREMWpmaERPcWg4Q05DVnM2NmhBd1lN?= =?utf-8?B?R1hSeW44RWVYZDdMU1pWejJQN285d0RHa09FYWVxdTUrVU1sUlFtSFYvNWRl?= =?utf-8?B?RGtXL0pPTE1od1FJQmZxRTdYZ3U0Uy8rSXE1WjFxTWQ4MzQyWUVraEhTV0Na?= =?utf-8?B?OS93cUpvMmlPbjhHU0swc2VFMnpzUzdkTTQ0dTJrNkgvajJSWVZEYVpxSDBi?= =?utf-8?B?bkd4Q3dtZFJ5R2JFR3NKVkJ3WEJCS1lLbGN3T0NDaHpsRTI1V2dLOFRQdTU3?= =?utf-8?B?em85WUZMeFl1d1lZbnVaWEQvbjJZZFB6MWRyUlh3MXc3UVJLU1dSZ3FqTnpL?= =?utf-8?B?WDBnR0FhcXlrVzJ6eUhPdC9kZTBVMnRhbnlDd1l4S1ZDb2dYTGMrMlVWdlhm?= =?utf-8?Q?UUv8IqWiF6lm23mnJiCkd7ZEP?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85a3b70a-3e17-400c-beeb-08dcee218709 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 20:31:34.7404 (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: /JS4W3mH56qcjr4pbP4NIchaULlI6C7dV3qAds6E/iMq3ZfaGY6XeXunXXBPDcZGcEwi7gPy5zUNGgcp+UzBmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DUZPR04MB9845 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