Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[platform/kernel/linux-starfive.git] / arch / ia64 / kernel / machvec.c
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
3 #include <linux/dma-mapping.h>
4 #include <asm/machvec.h>
5
6 #ifdef CONFIG_IA64_GENERIC
7
8 #include <linux/kernel.h>
9 #include <linux/string.h>
10
11 #include <asm/page.h>
12
13 struct ia64_machine_vector ia64_mv = {
14         .mmiowb = ___ia64_mmiowb
15 };
16 EXPORT_SYMBOL(ia64_mv);
17
18 static struct ia64_machine_vector * __init
19 lookup_machvec (const char *name)
20 {
21         extern struct ia64_machine_vector machvec_start[];
22         extern struct ia64_machine_vector machvec_end[];
23         struct ia64_machine_vector *mv;
24
25         for (mv = machvec_start; mv < machvec_end; ++mv)
26                 if (strcmp (mv->name, name) == 0)
27                         return mv;
28
29         return 0;
30 }
31
32 void __init
33 machvec_init (const char *name)
34 {
35         struct ia64_machine_vector *mv;
36
37         if (!name)
38                 name = acpi_get_sysname();
39         mv = lookup_machvec(name);
40         if (!mv)
41                 panic("generic kernel failed to find machine vector for"
42                       " platform %s!", name);
43
44         ia64_mv = *mv;
45         printk(KERN_INFO "booting generic kernel on platform %s\n", name);
46 }
47
48 void __init
49 machvec_init_from_cmdline(const char *cmdline)
50 {
51         char str[64];
52         const char *start;
53         char *end;
54
55         if (! (start = strstr(cmdline, "machvec=")) )
56                 return machvec_init(NULL);
57
58         strlcpy(str, start + strlen("machvec="), sizeof(str));
59         if ( (end = strchr(str, ' ')) )
60                 *end = '\0';
61
62         return machvec_init(str);
63 }
64
65 #endif /* CONFIG_IA64_GENERIC */
66
67 void
68 machvec_setup (char **arg)
69 {
70 }
71 EXPORT_SYMBOL(machvec_setup);
72
73 void
74 machvec_timer_interrupt (int irq, void *dev_id)
75 {
76 }
77 EXPORT_SYMBOL(machvec_timer_interrupt);