hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/arch/ia64/kernel/setup.c
....@@ -25,12 +25,13 @@
2525 */
2626 #include <linux/module.h>
2727 #include <linux/init.h>
28
+#include <linux/pgtable.h>
2829
2930 #include <linux/acpi.h>
30
-#include <linux/bootmem.h>
3131 #include <linux/console.h>
3232 #include <linux/delay.h>
3333 #include <linux/cpu.h>
34
+#include <linux/kdev_t.h>
3435 #include <linux/kernel.h>
3536 #include <linux/memblock.h>
3637 #include <linux/reboot.h>
....@@ -42,6 +43,7 @@
4243 #include <linux/threads.h>
4344 #include <linux/screen_info.h>
4445 #include <linux/dmi.h>
46
+#include <linux/root_dev.h>
4547 #include <linux/serial.h>
4648 #include <linux/serial_core.h>
4749 #include <linux/efi.h>
....@@ -51,12 +53,10 @@
5153 #include <linux/kexec.h>
5254 #include <linux/crash_dump.h>
5355
54
-#include <asm/machvec.h>
5556 #include <asm/mca.h>
5657 #include <asm/meminit.h>
5758 #include <asm/page.h>
5859 #include <asm/patch.h>
59
-#include <asm/pgtable.h>
6060 #include <asm/processor.h>
6161 #include <asm/sal.h>
6262 #include <asm/sections.h>
....@@ -64,11 +64,14 @@
6464 #include <asm/smp.h>
6565 #include <asm/tlbflush.h>
6666 #include <asm/unistd.h>
67
-#include <asm/hpsim.h>
67
+#include <asm/uv/uv.h>
68
+#include <asm/xtp.h>
6869
6970 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
7071 # error "struct cpuinfo_ia64 too big!"
7172 #endif
73
+
74
+char ia64_platform_name[64];
7275
7376 #ifdef CONFIG_SMP
7477 unsigned long __per_cpu_offset[NR_CPUS];
....@@ -257,15 +260,15 @@
257260 * This function checks if the reserved crashkernel is allowed on the specific
258261 * IA64 machine flavour. Machines without an IO TLB use swiotlb and require
259262 * some memory below 4 GB (i.e. in 32 bit area), see the implementation of
260
- * lib/swiotlb.c. The hpzx1 architecture has an IO TLB but cannot use that
263
+ * kernel/dma/swiotlb.c. The hpzx1 architecture has an IO TLB but cannot use that
261264 * in kdump case. See the comment in sba_init() in sba_iommu.c.
262265 *
263266 * So, the only machvec that really supports loading the kdump kernel
264
- * over 4 GB is "sn2".
267
+ * over 4 GB is "uv".
265268 */
266269 static int __init check_crashkernel_memory(unsigned long pbase, size_t size)
267270 {
268
- if (ia64_platform_is("sn2") || ia64_platform_is("uv"))
271
+ if (is_uv_system())
269272 return 1;
270273 else
271274 return pbase < (1UL << 32);
....@@ -287,7 +290,7 @@
287290 }
288291
289292 if (!check_crashkernel_memory(base, size)) {
290
- pr_warning("crashkernel: There would be kdump memory "
293
+ pr_warn("crashkernel: There would be kdump memory "
291294 "at %ld GB but this is unusable because it "
292295 "must\nbe below 4 GB. Change the memory "
293296 "configuration of the machine.\n",
....@@ -462,23 +465,44 @@
462465 static inline int __init
463466 early_console_setup (char *cmdline)
464467 {
465
- int earlycons = 0;
466
-
467
-#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
468
- {
469
- extern int sn_serial_console_early_setup(void);
470
- if (!sn_serial_console_early_setup())
471
- earlycons++;
472
- }
473
-#endif
474468 #ifdef CONFIG_EFI_PCDP
475469 if (!efi_setup_pcdp_console(cmdline))
476
- earlycons++;
470
+ return 0;
477471 #endif
478
- if (!simcons_register())
479
- earlycons++;
472
+ return -1;
473
+}
480474
481
- return (earlycons) ? 0 : -1;
475
+static void __init
476
+screen_info_setup(void)
477
+{
478
+ unsigned int orig_x, orig_y, num_cols, num_rows, font_height;
479
+
480
+ memset(&screen_info, 0, sizeof(screen_info));
481
+
482
+ if (!ia64_boot_param->console_info.num_rows ||
483
+ !ia64_boot_param->console_info.num_cols) {
484
+ printk(KERN_WARNING "invalid screen-info, guessing 80x25\n");
485
+ orig_x = 0;
486
+ orig_y = 0;
487
+ num_cols = 80;
488
+ num_rows = 25;
489
+ font_height = 16;
490
+ } else {
491
+ orig_x = ia64_boot_param->console_info.orig_x;
492
+ orig_y = ia64_boot_param->console_info.orig_y;
493
+ num_cols = ia64_boot_param->console_info.num_cols;
494
+ num_rows = ia64_boot_param->console_info.num_rows;
495
+ font_height = 400 / num_rows;
496
+ }
497
+
498
+ screen_info.orig_x = orig_x;
499
+ screen_info.orig_y = orig_y;
500
+ screen_info.orig_video_cols = num_cols;
501
+ screen_info.orig_video_lines = num_rows;
502
+ screen_info.orig_video_points = font_height;
503
+ screen_info.orig_video_mode = 3; /* XXX fake */
504
+ screen_info.orig_video_isVGA = 1; /* XXX fake */
505
+ screen_info.orig_video_ega_bx = 3; /* XXX fake */
482506 }
483507
484508 static inline void
....@@ -537,35 +561,25 @@
537561 efi_init();
538562 io_port_init();
539563
540
-#ifdef CONFIG_IA64_GENERIC
541
- /* machvec needs to be parsed from the command line
542
- * before parse_early_param() is called to ensure
543
- * that ia64_mv is initialised before any command line
544
- * settings may cause console setup to occur
545
- */
546
- machvec_init_from_cmdline(*cmdline_p);
547
-#endif
548
-
564
+ uv_probe_system_type();
549565 parse_early_param();
550566
551567 if (early_console_setup(*cmdline_p) == 0)
552568 mark_bsp_online();
553569
554
-#ifdef CONFIG_ACPI
555570 /* Initialize the ACPI boot-time table parser */
556571 acpi_table_init();
557572 early_acpi_boot_init();
558
-# ifdef CONFIG_ACPI_NUMA
573
+#ifdef CONFIG_ACPI_NUMA
559574 acpi_numa_init();
560575 acpi_numa_fixup();
561
-# ifdef CONFIG_ACPI_HOTPLUG_CPU
576
+#ifdef CONFIG_ACPI_HOTPLUG_CPU
562577 prefill_possible_map();
563
-# endif
578
+#endif
564579 per_cpu_scan_finalize((cpumask_weight(&early_cpu_possible_map) == 0 ?
565580 32 : cpumask_weight(&early_cpu_possible_map)),
566581 additional_cpus > 0 ? additional_cpus : 0);
567
-# endif
568
-#endif /* CONFIG_APCI_BOOT */
582
+#endif /* CONFIG_ACPI_NUMA */
569583
570584 #ifdef CONFIG_SMP
571585 smp_build_cpu_map();
....@@ -573,7 +587,7 @@
573587 find_memory();
574588
575589 /* process SAL system table: */
576
- ia64_sal_init(__va(efi.sal_systab));
590
+ ia64_sal_init(__va(sal_systab_phys));
577591
578592 #ifdef CONFIG_ITANIUM
579593 ia64_patch_rse((u64) __start___rse_patchlist, (u64) __end___rse_patchlist);
....@@ -595,9 +609,6 @@
595609
596610 #ifdef CONFIG_VT
597611 if (!conswitchp) {
598
-# if defined(CONFIG_DUMMY_CONSOLE)
599
- conswitchp = &dummy_con;
600
-# endif
601612 # if defined(CONFIG_VGA_CONSOLE)
602613 /*
603614 * Non-legacy systems may route legacy VGA MMIO range to system
....@@ -615,10 +626,21 @@
615626 if (!nomca)
616627 ia64_mca_init();
617628
618
- platform_setup(cmdline_p);
619
-#ifndef CONFIG_IA64_HP_SIM
620
- check_sal_cache_flush();
629
+ /*
630
+ * Default to /dev/sda2. This assumes that the EFI partition
631
+ * is physical disk 1 partition 1 and the Linux root disk is
632
+ * physical disk 1 partition 2.
633
+ */
634
+ ROOT_DEV = Root_SDA2; /* default to second partition on first drive */
635
+
636
+ if (is_uv_system())
637
+ uv_setup(cmdline_p);
638
+#ifdef CONFIG_SMP
639
+ else
640
+ init_smp_config();
621641 #endif
642
+
643
+ screen_info_setup();
622644 paging_init();
623645
624646 clear_sched_clock_stable();
....@@ -1047,7 +1069,6 @@
10471069 ia64_patch_phys_stack_reg(num_phys_stacked*8 + 8);
10481070 max_num_phys_stacked = num_phys_stacked;
10491071 }
1050
- platform_cpu_init();
10511072 }
10521073
10531074 void __init
....@@ -1059,9 +1080,7 @@
10591080
10601081 static int __init run_dmi_scan(void)
10611082 {
1062
- dmi_scan_machine();
1063
- dmi_memdev_walk();
1064
- dmi_set_dump_stack_arch_desc();
1083
+ dmi_setup();
10651084 return 0;
10661085 }
10671086 core_initcall(run_dmi_scan);