hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/memory/fsl_ifc.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2011 Freescale Semiconductor, Inc
34 *
45 * Freescale Integrated Flash Controller
56 *
67 * Author: Dipen Dudhat <Dipen.Dudhat@freescale.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
218 */
229 #include <linux/module.h>
2310 #include <linux/kernel.h>
....@@ -66,6 +53,7 @@
6653
6754 for (i = 0; i < fsl_ifc_ctrl_dev->banks; i++) {
6855 u32 cspr = ifc_in32(&fsl_ifc_ctrl_dev->gregs->cspr_cs[i].cspr);
56
+
6957 if (cspr & CSPR_V && (cspr & CSPR_BA) ==
7058 convert_ifc_address(addr_base))
7159 return i;
....@@ -165,8 +153,8 @@
165153 /* read for chip select error */
166154 cs_err = ifc_in32(&ifc->cm_evter_stat);
167155 if (cs_err) {
168
- dev_err(ctrl->dev, "transaction sent to IFC is not mapped to"
169
- "any memory bank 0x%08X\n", cs_err);
156
+ dev_err(ctrl->dev, "transaction sent to IFC is not mapped to any memory bank 0x%08X\n",
157
+ cs_err);
170158 /* clear the chip select error */
171159 ifc_out32(IFC_CM_EVTER_STAT_CSER, &ifc->cm_evter_stat);
172160
....@@ -175,24 +163,24 @@
175163 err_addr = ifc_in32(&ifc->cm_erattr1);
176164
177165 if (status & IFC_CM_ERATTR0_ERTYP_READ)
178
- dev_err(ctrl->dev, "Read transaction error"
179
- "CM_ERATTR0 0x%08X\n", status);
166
+ dev_err(ctrl->dev, "Read transaction error CM_ERATTR0 0x%08X\n",
167
+ status);
180168 else
181
- dev_err(ctrl->dev, "Write transaction error"
182
- "CM_ERATTR0 0x%08X\n", status);
169
+ dev_err(ctrl->dev, "Write transaction error CM_ERATTR0 0x%08X\n",
170
+ status);
183171
184172 err_axiid = (status & IFC_CM_ERATTR0_ERAID) >>
185173 IFC_CM_ERATTR0_ERAID_SHIFT;
186
- dev_err(ctrl->dev, "AXI ID of the error"
187
- "transaction 0x%08X\n", err_axiid);
174
+ dev_err(ctrl->dev, "AXI ID of the error transaction 0x%08X\n",
175
+ err_axiid);
188176
189177 err_srcid = (status & IFC_CM_ERATTR0_ESRCID) >>
190178 IFC_CM_ERATTR0_ESRCID_SHIFT;
191
- dev_err(ctrl->dev, "SRC ID of the error"
192
- "transaction 0x%08X\n", err_srcid);
179
+ dev_err(ctrl->dev, "SRC ID of the error transaction 0x%08X\n",
180
+ err_srcid);
193181
194
- dev_err(ctrl->dev, "Transaction Address corresponding to error"
195
- "ERADDR 0x%08X\n", err_addr);
182
+ dev_err(ctrl->dev, "Transaction Address corresponding to error ERADDR 0x%08X\n",
183
+ err_addr);
196184
197185 ret = IRQ_HANDLED;
198186 }
....@@ -211,7 +199,7 @@
211199 * the resources needed for the controller only. The
212200 * resources for the NAND banks themselves are allocated
213201 * in the chip probe function.
214
-*/
202
+ */
215203 static int fsl_ifc_ctrl_probe(struct platform_device *dev)
216204 {
217205 int ret = 0;
....@@ -262,8 +250,7 @@
262250 /* get the Controller level irq */
263251 fsl_ifc_ctrl_dev->irq = irq_of_parse_and_map(dev->dev.of_node, 0);
264252 if (fsl_ifc_ctrl_dev->irq == 0) {
265
- dev_err(&dev->dev, "failed to get irq resource "
266
- "for IFC\n");
253
+ dev_err(&dev->dev, "failed to get irq resource for IFC\n");
267254 ret = -ENODEV;
268255 goto err;
269256 }