blob: ebd82535f51b7dc29af27a89258a0b683b472475 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#include <linux/module.h>
FUJITA Tomonori160c1d82009-01-05 23:59:02 +09003#include <linux/dma-mapping.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <asm/machvec.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
6#ifdef CONFIG_IA64_GENERIC
7
8#include <linux/kernel.h>
9#include <linux/string.h>
10
11#include <asm/page.h>
12
Tony Luck8a635ff2019-05-15 18:04:14 -070013struct ia64_machine_vector ia64_mv = {
14 .mmiowb = ___ia64_mmiowb
15};
Linus Torvalds1da177e2005-04-16 15:20:36 -070016EXPORT_SYMBOL(ia64_mv);
17
Hormsa5b00bb2006-03-23 14:27:12 -080018static struct ia64_machine_vector * __init
Linus Torvalds1da177e2005-04-16 15:20:36 -070019lookup_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
Tony Luck9a86bbb2007-05-10 11:57:58 -070032void __init
Linus Torvalds1da177e2005-04-16 15:20:36 -070033machvec_init (const char *name)
34{
35 struct ia64_machine_vector *mv;
36
Hormsa5b00bb2006-03-23 14:27:12 -080037 if (!name)
Hormsa07ee862007-07-25 16:06:25 +090038 name = acpi_get_sysname();
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 mv = lookup_machvec(name);
Hormsa5b00bb2006-03-23 14:27:12 -080040 if (!mv)
41 panic("generic kernel failed to find machine vector for"
42 " platform %s!", name);
43
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 ia64_mv = *mv;
45 printk(KERN_INFO "booting generic kernel on platform %s\n", name);
46}
47
Hormsa07ee862007-07-25 16:06:25 +090048void __init
49machvec_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
Linus Torvalds1da177e2005-04-16 15:20:36 -070065#endif /* CONFIG_IA64_GENERIC */
66
67void
68machvec_setup (char **arg)
69{
70}
71EXPORT_SYMBOL(machvec_setup);
72
73void
David Howells7d12e782006-10-05 14:55:46 +010074machvec_timer_interrupt (int irq, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075{
76}
77EXPORT_SYMBOL(machvec_timer_interrupt);