hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/soc/fsl/guts.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Freescale QorIQ Platforms GUTS Driver
34 *
45 * Copyright (C) 2016 Freescale Semiconductor, Inc.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
106 */
117
128 #include <linux/io.h>
....@@ -100,6 +96,16 @@
10096 .svr = 0x87000000,
10197 .mask = 0xfff70000,
10298 },
99
+ /* Die: LX2160A, SoC: LX2160A/LX2120A/LX2080A */
100
+ { .die = "LX2160A",
101
+ .svr = 0x87360000,
102
+ .mask = 0xff3f0000,
103
+ },
104
+ /* Die: LS1028A, SoC: LS1028A */
105
+ { .die = "LS1028A",
106
+ .svr = 0x870b0000,
107
+ .mask = 0xff3f0000,
108
+ },
103109 { },
104110 };
105111
....@@ -114,7 +120,7 @@
114120 return NULL;
115121 }
116122
117
-u32 fsl_guts_get_svr(void)
123
+static u32 fsl_guts_get_svr(void)
118124 {
119125 u32 svr = 0;
120126
....@@ -128,7 +134,6 @@
128134
129135 return svr;
130136 }
131
-EXPORT_SYMBOL(fsl_guts_get_svr);
132137
133138 static int fsl_guts_probe(struct platform_device *pdev)
134139 {
....@@ -136,7 +141,7 @@
136141 struct device *dev = &pdev->dev;
137142 struct resource *res;
138143 const struct fsl_soc_die_attr *soc_die;
139
- const char *machine;
144
+ const char *machine = NULL;
140145 u32 svr;
141146
142147 /* Initialize guts */
....@@ -155,9 +160,14 @@
155160 root = of_find_node_by_path("/");
156161 if (of_property_read_string(root, "model", &machine))
157162 of_property_read_string_index(root, "compatible", 0, &machine);
158
- of_node_put(root);
159
- if (machine)
163
+ if (machine) {
160164 soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL);
165
+ if (!soc_dev_attr.machine) {
166
+ of_node_put(root);
167
+ return -ENOMEM;
168
+ }
169
+ }
170
+ of_node_put(root);
161171
162172 svr = fsl_guts_get_svr();
163173 soc_die = fsl_soc_die_match(svr, fsl_soc_die);
....@@ -222,6 +232,8 @@
222232 { .compatible = "fsl,ls1088a-dcfg", },
223233 { .compatible = "fsl,ls1012a-dcfg", },
224234 { .compatible = "fsl,ls1046a-dcfg", },
235
+ { .compatible = "fsl,lx2160a-dcfg", },
236
+ { .compatible = "fsl,ls1028a-dcfg", },
225237 {}
226238 };
227239 MODULE_DEVICE_TABLE(of, fsl_guts_of_match);