This source file includes following definitions.
- supermicro_old_pre_start
- supermicro_old_pre_stop
- broken_bios_start
- broken_bios_stop
- iTCO_vendor_pre_start
- iTCO_vendor_pre_stop
- iTCO_vendor_check_noreboot_on
- iTCO_vendor_init_module
- iTCO_vendor_exit_module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
18
19 #define DRV_NAME "iTCO_vendor_support"
20 #define DRV_VERSION "1.04"
21
22
23 #include <linux/module.h>
24 #include <linux/moduleparam.h>
25 #include <linux/types.h>
26 #include <linux/errno.h>
27 #include <linux/kernel.h>
28 #include <linux/init.h>
29 #include <linux/ioport.h>
30 #include <linux/io.h>
31
32 #include "iTCO_vendor.h"
33
34
35
36 #define SUPERMICRO_OLD_BOARD 1
37
38 #define SUPERMICRO_NEW_BOARD 2
39
40 #define BROKEN_BIOS 911
41
42 int iTCO_vendorsupport;
43 EXPORT_SYMBOL(iTCO_vendorsupport);
44
45 module_param_named(vendorsupport, iTCO_vendorsupport, int, 0);
46 MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default="
47 "0 (none), 1=SuperMicro Pent3, 911=Broken SMI BIOS");
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 static void supermicro_old_pre_start(struct resource *smires)
78 {
79 unsigned long val32;
80
81
82 val32 = inl(smires->start);
83 val32 &= 0xffffdfff;
84 outl(val32, smires->start);
85 }
86
87 static void supermicro_old_pre_stop(struct resource *smires)
88 {
89 unsigned long val32;
90
91
92 val32 = inl(smires->start);
93 val32 |= 0x00002000;
94 outl(val32, smires->start);
95 }
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128 static void broken_bios_start(struct resource *smires)
129 {
130 unsigned long val32;
131
132 val32 = inl(smires->start);
133
134
135 val32 &= 0xffffdffe;
136 outl(val32, smires->start);
137 }
138
139 static void broken_bios_stop(struct resource *smires)
140 {
141 unsigned long val32;
142
143 val32 = inl(smires->start);
144
145
146 val32 |= 0x00002001;
147 outl(val32, smires->start);
148 }
149
150
151
152
153
154 void iTCO_vendor_pre_start(struct resource *smires,
155 unsigned int heartbeat)
156 {
157 switch (iTCO_vendorsupport) {
158 case SUPERMICRO_OLD_BOARD:
159 supermicro_old_pre_start(smires);
160 break;
161 case BROKEN_BIOS:
162 broken_bios_start(smires);
163 break;
164 }
165 }
166 EXPORT_SYMBOL(iTCO_vendor_pre_start);
167
168 void iTCO_vendor_pre_stop(struct resource *smires)
169 {
170 switch (iTCO_vendorsupport) {
171 case SUPERMICRO_OLD_BOARD:
172 supermicro_old_pre_stop(smires);
173 break;
174 case BROKEN_BIOS:
175 broken_bios_stop(smires);
176 break;
177 }
178 }
179 EXPORT_SYMBOL(iTCO_vendor_pre_stop);
180
181 int iTCO_vendor_check_noreboot_on(void)
182 {
183 switch (iTCO_vendorsupport) {
184 case SUPERMICRO_OLD_BOARD:
185 return 0;
186 default:
187 return 1;
188 }
189 }
190 EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on);
191
192 static int __init iTCO_vendor_init_module(void)
193 {
194 if (iTCO_vendorsupport == SUPERMICRO_NEW_BOARD) {
195 pr_warn("Option vendorsupport=%d is no longer supported, "
196 "please use the w83627hf_wdt driver instead\n",
197 SUPERMICRO_NEW_BOARD);
198 return -EINVAL;
199 }
200 pr_info("vendor-support=%d\n", iTCO_vendorsupport);
201 return 0;
202 }
203
204 static void __exit iTCO_vendor_exit_module(void)
205 {
206 pr_info("Module Unloaded\n");
207 }
208
209 module_init(iTCO_vendor_init_module);
210 module_exit(iTCO_vendor_exit_module);
211
212 MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, "
213 "R. Seretny <lkpatches@paypc.com>");
214 MODULE_DESCRIPTION("Intel TCO Vendor Specific WatchDog Timer Driver Support");
215 MODULE_VERSION(DRV_VERSION);
216 MODULE_LICENSE("GPL");