forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/arch/parisc/kernel/processor.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Initial setup-routines for HP 9000 based hardware.
34 *
....@@ -9,21 +10,6 @@
910 * Modifications copyright 2001 Ryan Bradetich <rbradetich@uswest.net>
1011 *
1112 * Initial PA-RISC Version: 04-23-1999 by Helge Deller
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2, or (at your option)
16
- * any later version.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
22
- *
23
- * You should have received a copy of the GNU General Public License
24
- * along with this program; if not, write to the Free Software
25
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
- *
2713 */
2814 #include <linux/delay.h>
2915 #include <linux/init.h>
....@@ -43,10 +29,10 @@
4329 #include <asm/irq.h> /* for struct irq_region */
4430 #include <asm/parisc-device.h>
4531
46
-struct system_cpuinfo_parisc boot_cpu_data __read_mostly;
32
+struct system_cpuinfo_parisc boot_cpu_data __ro_after_init;
4733 EXPORT_SYMBOL(boot_cpu_data);
4834 #ifdef CONFIG_PA8X00
49
-int _parisc_requires_coherency __read_mostly;
35
+int _parisc_requires_coherency __ro_after_init;
5036 EXPORT_SYMBOL(_parisc_requires_coherency);
5137 #endif
5238
....@@ -226,7 +212,7 @@
226212 #ifdef CONFIG_SMP
227213 if (cpuid) {
228214 set_cpu_present(cpuid, true);
229
- cpu_up(cpuid);
215
+ add_cpu(cpuid);
230216 }
231217 #endif
232218
....@@ -242,6 +228,7 @@
242228 void __init collect_boot_cpu_data(void)
243229 {
244230 unsigned long cr16_seed;
231
+ char orig_prod_num[64], current_prod_num[64], serial_no[64];
245232
246233 memset(&boot_cpu_data, 0, sizeof(boot_cpu_data));
247234
....@@ -301,6 +288,15 @@
301288 _parisc_requires_coherency = (boot_cpu_data.cpu_type == mako) ||
302289 (boot_cpu_data.cpu_type == mako2);
303290 #endif
291
+
292
+ if (pdc_model_platform_info(orig_prod_num, current_prod_num, serial_no) == PDC_OK) {
293
+ printk(KERN_INFO "product %s, original product %s, S/N: %s\n",
294
+ current_prod_num[0] ? current_prod_num : "n/a",
295
+ orig_prod_num, serial_no);
296
+ add_device_randomness(orig_prod_num, strlen(orig_prod_num));
297
+ add_device_randomness(current_prod_num, strlen(current_prod_num));
298
+ add_device_randomness(serial_no, strlen(serial_no));
299
+ }
304300 }
305301
306302
....@@ -423,8 +419,7 @@
423419 }
424420 seq_printf(m, " (0x%02lx)\n", boot_cpu_data.pdc.capabilities);
425421
426
- seq_printf(m, "model\t\t: %s\n"
427
- "model name\t: %s\n",
422
+ seq_printf(m, "model\t\t: %s - %s\n",
428423 boot_cpu_data.pdc.sys_model_name,
429424 cpuinfo->dev ?
430425 cpuinfo->dev->name : "Unknown");