boot.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321
  1. /*
  2. * boot.c - Architecture-Specific Low-Level ACPI Boot Support
  3. *
  4. * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
  5. * Copyright (C) 2001 Jun Nakajima <jun.nakajima@intel.com>
  6. *
  7. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. *
  23. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. */
  25. #include <linux/init.h>
  26. #include <linux/acpi.h>
  27. #include <linux/efi.h>
  28. #include <linux/cpumask.h>
  29. #include <linux/module.h>
  30. #include <linux/dmi.h>
  31. #include <linux/irq.h>
  32. #include <linux/bootmem.h>
  33. #include <linux/ioport.h>
  34. #include <asm/pgtable.h>
  35. #include <asm/io_apic.h>
  36. #include <asm/apic.h>
  37. #include <asm/io.h>
  38. #include <asm/mpspec.h>
  39. static int __initdata acpi_force = 0;
  40. #ifdef CONFIG_ACPI
  41. int acpi_disabled = 0;
  42. #else
  43. int acpi_disabled = 1;
  44. #endif
  45. EXPORT_SYMBOL(acpi_disabled);
  46. #ifdef CONFIG_X86_64
  47. #include <asm/proto.h>
  48. static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return 0; }
  49. #else /* X86 */
  50. #ifdef CONFIG_X86_LOCAL_APIC
  51. #include <mach_apic.h>
  52. #include <mach_mpparse.h>
  53. #endif /* CONFIG_X86_LOCAL_APIC */
  54. #endif /* X86 */
  55. #define BAD_MADT_ENTRY(entry, end) ( \
  56. (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
  57. ((acpi_table_entry_header *)entry)->length < sizeof(*entry))
  58. #define PREFIX "ACPI: "
  59. int acpi_noirq __initdata; /* skip ACPI IRQ initialization */
  60. int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */
  61. int acpi_ht __initdata = 1; /* enable HT */
  62. int acpi_lapic;
  63. int acpi_ioapic;
  64. int acpi_strict;
  65. EXPORT_SYMBOL(acpi_strict);
  66. acpi_interrupt_flags acpi_sci_flags __initdata;
  67. int acpi_sci_override_gsi __initdata;
  68. int acpi_skip_timer_override __initdata;
  69. #ifdef CONFIG_X86_LOCAL_APIC
  70. static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
  71. #endif
  72. #ifndef __HAVE_ARCH_CMPXCHG
  73. #warning ACPI uses CMPXCHG, i486 and later hardware
  74. #endif
  75. #define MAX_MADT_ENTRIES 256
  76. u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
  77. {[0 ... MAX_MADT_ENTRIES - 1] = 0xff };
  78. EXPORT_SYMBOL(x86_acpiid_to_apicid);
  79. /* --------------------------------------------------------------------------
  80. Boot-time Configuration
  81. -------------------------------------------------------------------------- */
  82. /*
  83. * The default interrupt routing model is PIC (8259). This gets
  84. * overriden if IOAPICs are enumerated (below).
  85. */
  86. enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
  87. #ifdef CONFIG_X86_64
  88. /* rely on all ACPI tables being in the direct mapping */
  89. char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
  90. {
  91. if (!phys_addr || !size)
  92. return NULL;
  93. if (phys_addr+size <= (end_pfn_map << PAGE_SHIFT) + PAGE_SIZE)
  94. return __va(phys_addr);
  95. return NULL;
  96. }
  97. #else
  98. /*
  99. * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END,
  100. * to map the target physical address. The problem is that set_fixmap()
  101. * provides a single page, and it is possible that the page is not
  102. * sufficient.
  103. * By using this area, we can map up to MAX_IO_APICS pages temporarily,
  104. * i.e. until the next __va_range() call.
  105. *
  106. * Important Safety Note: The fixed I/O APIC page numbers are *subtracted*
  107. * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and
  108. * count idx down while incrementing the phys address.
  109. */
  110. char *__acpi_map_table(unsigned long phys, unsigned long size)
  111. {
  112. unsigned long base, offset, mapped_size;
  113. int idx;
  114. if (phys + size < 8 * 1024 * 1024)
  115. return __va(phys);
  116. offset = phys & (PAGE_SIZE - 1);
  117. mapped_size = PAGE_SIZE - offset;
  118. set_fixmap(FIX_ACPI_END, phys);
  119. base = fix_to_virt(FIX_ACPI_END);
  120. /*
  121. * Most cases can be covered by the below.
  122. */
  123. idx = FIX_ACPI_END;
  124. while (mapped_size < size) {
  125. if (--idx < FIX_ACPI_BEGIN)
  126. return NULL; /* cannot handle this */
  127. phys += PAGE_SIZE;
  128. set_fixmap(idx, phys);
  129. mapped_size += PAGE_SIZE;
  130. }
  131. return ((unsigned char *)base + offset);
  132. }
  133. #endif
  134. #ifdef CONFIG_PCI_MMCONFIG
  135. /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
  136. struct acpi_table_mcfg_config *pci_mmcfg_config;
  137. int pci_mmcfg_config_num;
  138. int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
  139. {
  140. struct acpi_table_mcfg *mcfg;
  141. unsigned long i;
  142. int config_size;
  143. if (!phys_addr || !size)
  144. return -EINVAL;
  145. mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
  146. if (!mcfg) {
  147. printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
  148. return -ENODEV;
  149. }
  150. /* how many config structures do we have */
  151. pci_mmcfg_config_num = 0;
  152. i = size - sizeof(struct acpi_table_mcfg);
  153. while (i >= sizeof(struct acpi_table_mcfg_config)) {
  154. ++pci_mmcfg_config_num;
  155. i -= sizeof(struct acpi_table_mcfg_config);
  156. };
  157. if (pci_mmcfg_config_num == 0) {
  158. printk(KERN_ERR PREFIX "MMCONFIG has no entries\n");
  159. return -ENODEV;
  160. }
  161. config_size = pci_mmcfg_config_num * sizeof(*pci_mmcfg_config);
  162. pci_mmcfg_config = kmalloc(config_size, GFP_KERNEL);
  163. if (!pci_mmcfg_config) {
  164. printk(KERN_WARNING PREFIX
  165. "No memory for MCFG config tables\n");
  166. return -ENOMEM;
  167. }
  168. memcpy(pci_mmcfg_config, &mcfg->config, config_size);
  169. for (i = 0; i < pci_mmcfg_config_num; ++i) {
  170. if (mcfg->config[i].base_reserved) {
  171. printk(KERN_ERR PREFIX
  172. "MMCONFIG not in low 4GB of memory\n");
  173. kfree(pci_mmcfg_config);
  174. pci_mmcfg_config_num = 0;
  175. return -ENODEV;
  176. }
  177. }
  178. return 0;
  179. }
  180. #endif /* CONFIG_PCI_MMCONFIG */
  181. #ifdef CONFIG_X86_LOCAL_APIC
  182. static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
  183. {
  184. struct acpi_table_madt *madt = NULL;
  185. if (!phys_addr || !size || !cpu_has_apic)
  186. return -EINVAL;
  187. madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
  188. if (!madt) {
  189. printk(KERN_WARNING PREFIX "Unable to map MADT\n");
  190. return -ENODEV;
  191. }
  192. if (madt->lapic_address) {
  193. acpi_lapic_addr = (u64) madt->lapic_address;
  194. printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
  195. madt->lapic_address);
  196. }
  197. acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
  198. return 0;
  199. }
  200. static int __init
  201. acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
  202. {
  203. struct acpi_table_lapic *processor = NULL;
  204. processor = (struct acpi_table_lapic *)header;
  205. if (BAD_MADT_ENTRY(processor, end))
  206. return -EINVAL;
  207. acpi_table_print_madt_entry(header);
  208. /* Record local apic id only when enabled */
  209. if (processor->flags.enabled)
  210. x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
  211. /*
  212. * We need to register disabled CPU as well to permit
  213. * counting disabled CPUs. This allows us to size
  214. * cpus_possible_map more accurately, to permit
  215. * to not preallocating memory for all NR_CPUS
  216. * when we use CPU hotplug.
  217. */
  218. mp_register_lapic(processor->id, /* APIC ID */
  219. processor->flags.enabled); /* Enabled? */
  220. return 0;
  221. }
  222. static int __init
  223. acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
  224. const unsigned long end)
  225. {
  226. struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
  227. lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header;
  228. if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
  229. return -EINVAL;
  230. acpi_lapic_addr = lapic_addr_ovr->address;
  231. return 0;
  232. }
  233. static int __init
  234. acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
  235. {
  236. struct acpi_table_lapic_nmi *lapic_nmi = NULL;
  237. lapic_nmi = (struct acpi_table_lapic_nmi *)header;
  238. if (BAD_MADT_ENTRY(lapic_nmi, end))
  239. return -EINVAL;
  240. acpi_table_print_madt_entry(header);
  241. if (lapic_nmi->lint != 1)
  242. printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n");
  243. return 0;
  244. }
  245. #endif /*CONFIG_X86_LOCAL_APIC */
  246. #ifdef CONFIG_X86_IO_APIC
  247. static int __init
  248. acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
  249. {
  250. struct acpi_table_ioapic *ioapic = NULL;
  251. ioapic = (struct acpi_table_ioapic *)header;
  252. if (BAD_MADT_ENTRY(ioapic, end))
  253. return -EINVAL;
  254. acpi_table_print_madt_entry(header);
  255. mp_register_ioapic(ioapic->id,
  256. ioapic->address, ioapic->global_irq_base);
  257. return 0;
  258. }
  259. /*
  260. * Parse Interrupt Source Override for the ACPI SCI
  261. */
  262. static void acpi_sci_ioapic_setup(u32 bus_irq, u32 gsi, u16 polarity, u16 trigger)
  263. {
  264. if (trigger == 0) /* compatible SCI trigger is level */
  265. trigger = 3;
  266. if (polarity == 0) /* compatible SCI polarity is low */
  267. polarity = 3;
  268. /* Command-line over-ride via acpi_sci= */
  269. if (acpi_sci_flags.trigger)
  270. trigger = acpi_sci_flags.trigger;
  271. if (acpi_sci_flags.polarity)
  272. polarity = acpi_sci_flags.polarity;
  273. /*
  274. * mp_config_acpi_legacy_irqs() already setup IRQs < 16
  275. * If GSI is < 16, this will update its flags,
  276. * else it will create a new mp_irqs[] entry.
  277. */
  278. mp_override_legacy_irq(bus_irq, polarity, trigger, gsi);
  279. /*
  280. * stash over-ride to indicate we've been here
  281. * and for later update of acpi_fadt
  282. */
  283. acpi_sci_override_gsi = bus_irq;
  284. return;
  285. }
  286. static int __init
  287. acpi_parse_int_src_ovr(acpi_table_entry_header * header,
  288. const unsigned long end)
  289. {
  290. struct acpi_table_int_src_ovr *intsrc = NULL;
  291. intsrc = (struct acpi_table_int_src_ovr *)header;
  292. if (BAD_MADT_ENTRY(intsrc, end))
  293. return -EINVAL;
  294. acpi_table_print_madt_entry(header);
  295. if (intsrc->bus_irq == acpi_fadt.sci_int) {
  296. acpi_sci_ioapic_setup(intsrc->bus_irq, intsrc->global_irq,
  297. intsrc->flags.polarity,
  298. intsrc->flags.trigger);
  299. return 0;
  300. }
  301. if (acpi_skip_timer_override &&
  302. intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
  303. printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
  304. return 0;
  305. }
  306. mp_override_legacy_irq(intsrc->bus_irq,
  307. intsrc->flags.polarity,
  308. intsrc->flags.trigger, intsrc->global_irq);
  309. return 0;
  310. }
  311. static int __init
  312. acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
  313. {
  314. struct acpi_table_nmi_src *nmi_src = NULL;
  315. nmi_src = (struct acpi_table_nmi_src *)header;
  316. if (BAD_MADT_ENTRY(nmi_src, end))
  317. return -EINVAL;
  318. acpi_table_print_madt_entry(header);
  319. /* TBD: Support nimsrc entries? */
  320. return 0;
  321. }
  322. #endif /* CONFIG_X86_IO_APIC */
  323. /*
  324. * acpi_pic_sci_set_trigger()
  325. *
  326. * use ELCR to set PIC-mode trigger type for SCI
  327. *
  328. * If a PIC-mode SCI is not recognized or gives spurious IRQ7's
  329. * it may require Edge Trigger -- use "acpi_sci=edge"
  330. *
  331. * Port 0x4d0-4d1 are ECLR1 and ECLR2, the Edge/Level Control Registers
  332. * for the 8259 PIC. bit[n] = 1 means irq[n] is Level, otherwise Edge.
  333. * ECLR1 is IRQ's 0-7 (IRQ 0, 1, 2 must be 0)
  334. * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
  335. */
  336. void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
  337. {
  338. unsigned int mask = 1 << irq;
  339. unsigned int old, new;
  340. /* Real old ELCR mask */
  341. old = inb(0x4d0) | (inb(0x4d1) << 8);
  342. /*
  343. * If we use ACPI to set PCI irq's, then we should clear ELCR
  344. * since we will set it correctly as we enable the PCI irq
  345. * routing.
  346. */
  347. new = acpi_noirq ? old : 0;
  348. /*
  349. * Update SCI information in the ELCR, it isn't in the PCI
  350. * routing tables..
  351. */
  352. switch (trigger) {
  353. case 1: /* Edge - clear */
  354. new &= ~mask;
  355. break;
  356. case 3: /* Level - set */
  357. new |= mask;
  358. break;
  359. }
  360. if (old == new)
  361. return;
  362. printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old);
  363. outb(new, 0x4d0);
  364. outb(new >> 8, 0x4d1);
  365. }
  366. int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
  367. {
  368. *irq = gsi;
  369. return 0;
  370. }
  371. /*
  372. * success: return IRQ number (>=0)
  373. * failure: return < 0
  374. */
  375. int acpi_register_gsi(u32 gsi, int triggering, int polarity)
  376. {
  377. unsigned int irq;
  378. unsigned int plat_gsi = gsi;
  379. #ifdef CONFIG_PCI
  380. /*
  381. * Make sure all (legacy) PCI IRQs are set as level-triggered.
  382. */
  383. if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
  384. extern void eisa_set_level_irq(unsigned int irq);
  385. if (triggering == ACPI_LEVEL_SENSITIVE)
  386. eisa_set_level_irq(gsi);
  387. }
  388. #endif
  389. #ifdef CONFIG_X86_IO_APIC
  390. if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) {
  391. plat_gsi = mp_register_gsi(gsi, triggering, polarity);
  392. }
  393. #endif
  394. acpi_gsi_to_irq(plat_gsi, &irq);
  395. return irq;
  396. }
  397. EXPORT_SYMBOL(acpi_register_gsi);
  398. /*
  399. * ACPI based hotplug support for CPU
  400. */
  401. #ifdef CONFIG_ACPI_HOTPLUG_CPU
  402. int acpi_map_lsapic(acpi_handle handle, int *pcpu)
  403. {
  404. struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
  405. union acpi_object *obj;
  406. struct acpi_table_lapic *lapic;
  407. cpumask_t tmp_map, new_map;
  408. u8 physid;
  409. int cpu;
  410. if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
  411. return -EINVAL;
  412. if (!buffer.length || !buffer.pointer)
  413. return -EINVAL;
  414. obj = buffer.pointer;
  415. if (obj->type != ACPI_TYPE_BUFFER ||
  416. obj->buffer.length < sizeof(*lapic)) {
  417. kfree(buffer.pointer);
  418. return -EINVAL;
  419. }
  420. lapic = (struct acpi_table_lapic *)obj->buffer.pointer;
  421. if ((lapic->header.type != ACPI_MADT_LAPIC) ||
  422. (!lapic->flags.enabled)) {
  423. kfree(buffer.pointer);
  424. return -EINVAL;
  425. }
  426. physid = lapic->id;
  427. kfree(buffer.pointer);
  428. buffer.length = ACPI_ALLOCATE_BUFFER;
  429. buffer.pointer = NULL;
  430. tmp_map = cpu_present_map;
  431. mp_register_lapic(physid, lapic->flags.enabled);
  432. /*
  433. * If mp_register_lapic successfully generates a new logical cpu
  434. * number, then the following will get us exactly what was mapped
  435. */
  436. cpus_andnot(new_map, cpu_present_map, tmp_map);
  437. if (cpus_empty(new_map)) {
  438. printk ("Unable to map lapic to logical cpu number\n");
  439. return -EINVAL;
  440. }
  441. cpu = first_cpu(new_map);
  442. *pcpu = cpu;
  443. return 0;
  444. }
  445. EXPORT_SYMBOL(acpi_map_lsapic);
  446. int acpi_unmap_lsapic(int cpu)
  447. {
  448. int i;
  449. for_each_possible_cpu(i) {
  450. if (x86_acpiid_to_apicid[i] == x86_cpu_to_apicid[cpu]) {
  451. x86_acpiid_to_apicid[i] = -1;
  452. break;
  453. }
  454. }
  455. x86_cpu_to_apicid[cpu] = -1;
  456. cpu_clear(cpu, cpu_present_map);
  457. num_processors--;
  458. return (0);
  459. }
  460. EXPORT_SYMBOL(acpi_unmap_lsapic);
  461. #endif /* CONFIG_ACPI_HOTPLUG_CPU */
  462. int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
  463. {
  464. /* TBD */
  465. return -EINVAL;
  466. }
  467. EXPORT_SYMBOL(acpi_register_ioapic);
  468. int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
  469. {
  470. /* TBD */
  471. return -EINVAL;
  472. }
  473. EXPORT_SYMBOL(acpi_unregister_ioapic);
  474. static unsigned long __init
  475. acpi_scan_rsdp(unsigned long start, unsigned long length)
  476. {
  477. unsigned long offset = 0;
  478. unsigned long sig_len = sizeof("RSD PTR ") - 1;
  479. /*
  480. * Scan all 16-byte boundaries of the physical memory region for the
  481. * RSDP signature.
  482. */
  483. for (offset = 0; offset < length; offset += 16) {
  484. if (strncmp((char *)(phys_to_virt(start) + offset), "RSD PTR ", sig_len))
  485. continue;
  486. return (start + offset);
  487. }
  488. return 0;
  489. }
  490. static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
  491. {
  492. struct acpi_table_sbf *sb;
  493. if (!phys_addr || !size)
  494. return -EINVAL;
  495. sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size);
  496. if (!sb) {
  497. printk(KERN_WARNING PREFIX "Unable to map SBF\n");
  498. return -ENODEV;
  499. }
  500. sbf_port = sb->sbf_cmos; /* Save CMOS port */
  501. return 0;
  502. }
  503. #ifdef CONFIG_HPET_TIMER
  504. static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
  505. {
  506. struct acpi_table_hpet *hpet_tbl;
  507. struct resource *hpet_res;
  508. resource_size_t res_start;
  509. if (!phys || !size)
  510. return -EINVAL;
  511. hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size);
  512. if (!hpet_tbl) {
  513. printk(KERN_WARNING PREFIX "Unable to map HPET\n");
  514. return -ENODEV;
  515. }
  516. if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) {
  517. printk(KERN_WARNING PREFIX "HPET timers must be located in "
  518. "memory.\n");
  519. return -1;
  520. }
  521. #define HPET_RESOURCE_NAME_SIZE 9
  522. hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE);
  523. if (hpet_res) {
  524. memset(hpet_res, 0, sizeof(*hpet_res));
  525. hpet_res->name = (void *)&hpet_res[1];
  526. hpet_res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
  527. snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE,
  528. "HPET %u", hpet_tbl->number);
  529. hpet_res->end = (1 * 1024) - 1;
  530. }
  531. #ifdef CONFIG_X86_64
  532. vxtime.hpet_address = hpet_tbl->addr.addrl |
  533. ((long)hpet_tbl->addr.addrh << 32);
  534. printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
  535. hpet_tbl->id, vxtime.hpet_address);
  536. res_start = vxtime.hpet_address;
  537. #else /* X86 */
  538. {
  539. extern unsigned long hpet_address;
  540. hpet_address = hpet_tbl->addr.addrl;
  541. printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
  542. hpet_tbl->id, hpet_address);
  543. res_start = hpet_address;
  544. }
  545. #endif /* X86 */
  546. if (hpet_res) {
  547. hpet_res->start = res_start;
  548. hpet_res->end += res_start;
  549. insert_resource(&iomem_resource, hpet_res);
  550. }
  551. return 0;
  552. }
  553. #else
  554. #define acpi_parse_hpet NULL
  555. #endif
  556. #ifdef CONFIG_X86_PM_TIMER
  557. extern u32 pmtmr_ioport;
  558. #endif
  559. static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
  560. {
  561. struct fadt_descriptor *fadt = NULL;
  562. fadt = (struct fadt_descriptor *)__acpi_map_table(phys, size);
  563. if (!fadt) {
  564. printk(KERN_WARNING PREFIX "Unable to map FADT\n");
  565. return 0;
  566. }
  567. /* initialize sci_int early for INT_SRC_OVR MADT parsing */
  568. acpi_fadt.sci_int = fadt->sci_int;
  569. /* initialize rev and apic_phys_dest_mode for x86_64 genapic */
  570. acpi_fadt.revision = fadt->revision;
  571. acpi_fadt.force_apic_physical_destination_mode =
  572. fadt->force_apic_physical_destination_mode;
  573. #ifdef CONFIG_X86_PM_TIMER
  574. /* detect the location of the ACPI PM Timer */
  575. if (fadt->revision >= FADT2_REVISION_ID) {
  576. /* FADT rev. 2 */
  577. if (fadt->xpm_tmr_blk.address_space_id !=
  578. ACPI_ADR_SPACE_SYSTEM_IO)
  579. return 0;
  580. pmtmr_ioport = fadt->xpm_tmr_blk.address;
  581. /*
  582. * "X" fields are optional extensions to the original V1.0
  583. * fields, so we must selectively expand V1.0 fields if the
  584. * corresponding X field is zero.
  585. */
  586. if (!pmtmr_ioport)
  587. pmtmr_ioport = fadt->V1_pm_tmr_blk;
  588. } else {
  589. /* FADT rev. 1 */
  590. pmtmr_ioport = fadt->V1_pm_tmr_blk;
  591. }
  592. if (pmtmr_ioport)
  593. printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
  594. pmtmr_ioport);
  595. #endif
  596. return 0;
  597. }
  598. unsigned long __init acpi_find_rsdp(void)
  599. {
  600. unsigned long rsdp_phys = 0;
  601. if (efi_enabled) {
  602. if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
  603. return efi.acpi20;
  604. else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
  605. return efi.acpi;
  606. }
  607. /*
  608. * Scan memory looking for the RSDP signature. First search EBDA (low
  609. * memory) paragraphs and then search upper memory (E0000-FFFFF).
  610. */
  611. rsdp_phys = acpi_scan_rsdp(0, 0x400);
  612. if (!rsdp_phys)
  613. rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000);
  614. return rsdp_phys;
  615. }
  616. #ifdef CONFIG_X86_LOCAL_APIC
  617. /*
  618. * Parse LAPIC entries in MADT
  619. * returns 0 on success, < 0 on error
  620. */
  621. static int __init acpi_parse_madt_lapic_entries(void)
  622. {
  623. int count;
  624. if (!cpu_has_apic)
  625. return -ENODEV;
  626. /*
  627. * Note that the LAPIC address is obtained from the MADT (32-bit value)
  628. * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
  629. */
  630. count =
  631. acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR,
  632. acpi_parse_lapic_addr_ovr, 0);
  633. if (count < 0) {
  634. printk(KERN_ERR PREFIX
  635. "Error parsing LAPIC address override entry\n");
  636. return count;
  637. }
  638. mp_register_lapic_address(acpi_lapic_addr);
  639. count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
  640. MAX_APICS);
  641. if (!count) {
  642. printk(KERN_ERR PREFIX "No LAPIC entries present\n");
  643. /* TBD: Cleanup to allow fallback to MPS */
  644. return -ENODEV;
  645. } else if (count < 0) {
  646. printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
  647. /* TBD: Cleanup to allow fallback to MPS */
  648. return count;
  649. }
  650. count =
  651. acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
  652. if (count < 0) {
  653. printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
  654. /* TBD: Cleanup to allow fallback to MPS */
  655. return count;
  656. }
  657. return 0;
  658. }
  659. #endif /* CONFIG_X86_LOCAL_APIC */
  660. #ifdef CONFIG_X86_IO_APIC
  661. /*
  662. * Parse IOAPIC related entries in MADT
  663. * returns 0 on success, < 0 on error
  664. */
  665. static int __init acpi_parse_madt_ioapic_entries(void)
  666. {
  667. int count;
  668. /*
  669. * ACPI interpreter is required to complete interrupt setup,
  670. * so if it is off, don't enumerate the io-apics with ACPI.
  671. * If MPS is present, it will handle them,
  672. * otherwise the system will stay in PIC mode
  673. */
  674. if (acpi_disabled || acpi_noirq) {
  675. return -ENODEV;
  676. }
  677. if (!cpu_has_apic)
  678. return -ENODEV;
  679. /*
  680. * if "noapic" boot option, don't look for IO-APICs
  681. */
  682. if (skip_ioapic_setup) {
  683. printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
  684. "due to 'noapic' option.\n");
  685. return -ENODEV;
  686. }
  687. count =
  688. acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic,
  689. MAX_IO_APICS);
  690. if (!count) {
  691. printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
  692. return -ENODEV;
  693. } else if (count < 0) {
  694. printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
  695. return count;
  696. }
  697. count =
  698. acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr,
  699. NR_IRQ_VECTORS);
  700. if (count < 0) {
  701. printk(KERN_ERR PREFIX
  702. "Error parsing interrupt source overrides entry\n");
  703. /* TBD: Cleanup to allow fallback to MPS */
  704. return count;
  705. }
  706. /*
  707. * If BIOS did not supply an INT_SRC_OVR for the SCI
  708. * pretend we got one so we can set the SCI flags.
  709. */
  710. if (!acpi_sci_override_gsi)
  711. acpi_sci_ioapic_setup(acpi_fadt.sci_int, acpi_fadt.sci_int, 0, 0);
  712. /* Fill in identity legacy mapings where no override */
  713. mp_config_acpi_legacy_irqs();
  714. count =
  715. acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src,
  716. NR_IRQ_VECTORS);
  717. if (count < 0) {
  718. printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
  719. /* TBD: Cleanup to allow fallback to MPS */
  720. return count;
  721. }
  722. return 0;
  723. }
  724. #else
  725. static inline int acpi_parse_madt_ioapic_entries(void)
  726. {
  727. return -1;
  728. }
  729. #endif /* !CONFIG_X86_IO_APIC */
  730. static void __init acpi_process_madt(void)
  731. {
  732. #ifdef CONFIG_X86_LOCAL_APIC
  733. int count, error;
  734. count = acpi_table_parse(ACPI_APIC, acpi_parse_madt);
  735. if (count >= 1) {
  736. /*
  737. * Parse MADT LAPIC entries
  738. */
  739. error = acpi_parse_madt_lapic_entries();
  740. if (!error) {
  741. acpi_lapic = 1;
  742. #ifdef CONFIG_X86_GENERICARCH
  743. generic_bigsmp_probe();
  744. #endif
  745. /*
  746. * Parse MADT IO-APIC entries
  747. */
  748. error = acpi_parse_madt_ioapic_entries();
  749. if (!error) {
  750. acpi_irq_model = ACPI_IRQ_MODEL_IOAPIC;
  751. acpi_irq_balance_set(NULL);
  752. acpi_ioapic = 1;
  753. smp_found_config = 1;
  754. clustered_apic_check();
  755. }
  756. }
  757. if (error == -EINVAL) {
  758. /*
  759. * Dell Precision Workstation 410, 610 come here.
  760. */
  761. printk(KERN_ERR PREFIX
  762. "Invalid BIOS MADT, disabling ACPI\n");
  763. disable_acpi();
  764. }
  765. }
  766. #endif
  767. return;
  768. }
  769. #ifdef __i386__
  770. static int __init disable_acpi_irq(struct dmi_system_id *d)
  771. {
  772. if (!acpi_force) {
  773. printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
  774. d->ident);
  775. acpi_noirq_set();
  776. }
  777. return 0;
  778. }
  779. static int __init disable_acpi_pci(struct dmi_system_id *d)
  780. {
  781. if (!acpi_force) {
  782. printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n",
  783. d->ident);
  784. acpi_disable_pci();
  785. }
  786. return 0;
  787. }
  788. static int __init dmi_disable_acpi(struct dmi_system_id *d)
  789. {
  790. if (!acpi_force) {
  791. printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
  792. disable_acpi();
  793. } else {
  794. printk(KERN_NOTICE
  795. "Warning: DMI blacklist says broken, but acpi forced\n");
  796. }
  797. return 0;
  798. }
  799. /*
  800. * Limit ACPI to CPU enumeration for HT
  801. */
  802. static int __init force_acpi_ht(struct dmi_system_id *d)
  803. {
  804. if (!acpi_force) {
  805. printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
  806. d->ident);
  807. disable_acpi();
  808. acpi_ht = 1;
  809. } else {
  810. printk(KERN_NOTICE
  811. "Warning: acpi=force overrules DMI blacklist: acpi=ht\n");
  812. }
  813. return 0;
  814. }
  815. /*
  816. * If your system is blacklisted here, but you find that acpi=force
  817. * works for you, please contact acpi-devel@sourceforge.net
  818. */
  819. static struct dmi_system_id __initdata acpi_dmi_table[] = {
  820. /*
  821. * Boxes that need ACPI disabled
  822. */
  823. {
  824. .callback = dmi_disable_acpi,
  825. .ident = "IBM Thinkpad",
  826. .matches = {
  827. DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
  828. DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
  829. },
  830. },
  831. /*
  832. * Boxes that need acpi=ht
  833. */
  834. {
  835. .callback = force_acpi_ht,
  836. .ident = "FSC Primergy T850",
  837. .matches = {
  838. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  839. DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
  840. },
  841. },
  842. {
  843. .callback = force_acpi_ht,
  844. .ident = "DELL GX240",
  845. .matches = {
  846. DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
  847. DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
  848. },
  849. },
  850. {
  851. .callback = force_acpi_ht,
  852. .ident = "HP VISUALIZE NT Workstation",
  853. .matches = {
  854. DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
  855. DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
  856. },
  857. },
  858. {
  859. .callback = force_acpi_ht,
  860. .ident = "Compaq Workstation W8000",
  861. .matches = {
  862. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  863. DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
  864. },
  865. },
  866. {
  867. .callback = force_acpi_ht,
  868. .ident = "ASUS P4B266",
  869. .matches = {
  870. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  871. DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
  872. },
  873. },
  874. {
  875. .callback = force_acpi_ht,
  876. .ident = "ASUS P2B-DS",
  877. .matches = {
  878. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  879. DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
  880. },
  881. },
  882. {
  883. .callback = force_acpi_ht,
  884. .ident = "ASUS CUR-DLS",
  885. .matches = {
  886. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  887. DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
  888. },
  889. },
  890. {
  891. .callback = force_acpi_ht,
  892. .ident = "ABIT i440BX-W83977",
  893. .matches = {
  894. DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
  895. DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
  896. },
  897. },
  898. {
  899. .callback = force_acpi_ht,
  900. .ident = "IBM Bladecenter",
  901. .matches = {
  902. DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
  903. DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
  904. },
  905. },
  906. {
  907. .callback = force_acpi_ht,
  908. .ident = "IBM eServer xSeries 360",
  909. .matches = {
  910. DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
  911. DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
  912. },
  913. },
  914. {
  915. .callback = force_acpi_ht,
  916. .ident = "IBM eserver xSeries 330",
  917. .matches = {
  918. DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
  919. DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
  920. },
  921. },
  922. {
  923. .callback = force_acpi_ht,
  924. .ident = "IBM eserver xSeries 440",
  925. .matches = {
  926. DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
  927. DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
  928. },
  929. },
  930. /*
  931. * Boxes that need ACPI PCI IRQ routing disabled
  932. */
  933. {
  934. .callback = disable_acpi_irq,
  935. .ident = "ASUS A7V",
  936. .matches = {
  937. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
  938. DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
  939. /* newer BIOS, Revision 1011, does work */
  940. DMI_MATCH(DMI_BIOS_VERSION,
  941. "ASUS A7V ACPI BIOS Revision 1007"),
  942. },
  943. },
  944. /*
  945. * Boxes that need ACPI PCI IRQ routing and PCI scan disabled
  946. */
  947. { /* _BBN 0 bug */
  948. .callback = disable_acpi_pci,
  949. .ident = "ASUS PR-DLS",
  950. .matches = {
  951. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  952. DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
  953. DMI_MATCH(DMI_BIOS_VERSION,
  954. "ASUS PR-DLS ACPI BIOS Revision 1010"),
  955. DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
  956. },
  957. },
  958. {
  959. .callback = disable_acpi_pci,
  960. .ident = "Acer TravelMate 36x Laptop",
  961. .matches = {
  962. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  963. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
  964. },
  965. },
  966. {}
  967. };
  968. #endif /* __i386__ */
  969. /*
  970. * acpi_boot_table_init() and acpi_boot_init()
  971. * called from setup_arch(), always.
  972. * 1. checksums all tables
  973. * 2. enumerates lapics
  974. * 3. enumerates io-apics
  975. *
  976. * acpi_table_init() is separate to allow reading SRAT without
  977. * other side effects.
  978. *
  979. * side effects of acpi_boot_init:
  980. * acpi_lapic = 1 if LAPIC found
  981. * acpi_ioapic = 1 if IOAPIC found
  982. * if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
  983. * if acpi_blacklisted() acpi_disabled = 1;
  984. * acpi_irq_model=...
  985. * ...
  986. *
  987. * return value: (currently ignored)
  988. * 0: success
  989. * !0: failure
  990. */
  991. int __init acpi_boot_table_init(void)
  992. {
  993. int error;
  994. #ifdef __i386__
  995. dmi_check_system(acpi_dmi_table);
  996. #endif
  997. /*
  998. * If acpi_disabled, bail out
  999. * One exception: acpi=ht continues far enough to enumerate LAPICs
  1000. */
  1001. if (acpi_disabled && !acpi_ht)
  1002. return 1;
  1003. /*
  1004. * Initialize the ACPI boot-time table parser.
  1005. */
  1006. error = acpi_table_init();
  1007. if (error) {
  1008. disable_acpi();
  1009. return error;
  1010. }
  1011. acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
  1012. /*
  1013. * blacklist may disable ACPI entirely
  1014. */
  1015. error = acpi_blacklisted();
  1016. if (error) {
  1017. if (acpi_force) {
  1018. printk(KERN_WARNING PREFIX "acpi=force override\n");
  1019. } else {
  1020. printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
  1021. disable_acpi();
  1022. return error;
  1023. }
  1024. }
  1025. return 0;
  1026. }
  1027. int __init acpi_boot_init(void)
  1028. {
  1029. /*
  1030. * If acpi_disabled, bail out
  1031. * One exception: acpi=ht continues far enough to enumerate LAPICs
  1032. */
  1033. if (acpi_disabled && !acpi_ht)
  1034. return 1;
  1035. acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
  1036. /*
  1037. * set sci_int and PM timer address
  1038. */
  1039. acpi_table_parse(ACPI_FADT, acpi_parse_fadt);
  1040. /*
  1041. * Process the Multiple APIC Description Table (MADT), if present
  1042. */
  1043. acpi_process_madt();
  1044. acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
  1045. return 0;
  1046. }
  1047. static int __init parse_acpi(char *arg)
  1048. {
  1049. if (!arg)
  1050. return -EINVAL;
  1051. /* "acpi=off" disables both ACPI table parsing and interpreter */
  1052. if (strcmp(arg, "off") == 0) {
  1053. disable_acpi();
  1054. }
  1055. /* acpi=force to over-ride black-list */
  1056. else if (strcmp(arg, "force") == 0) {
  1057. acpi_force = 1;
  1058. acpi_ht = 1;
  1059. acpi_disabled = 0;
  1060. }
  1061. /* acpi=strict disables out-of-spec workarounds */
  1062. else if (strcmp(arg, "strict") == 0) {
  1063. acpi_strict = 1;
  1064. }
  1065. /* Limit ACPI just to boot-time to enable HT */
  1066. else if (strcmp(arg, "ht") == 0) {
  1067. if (!acpi_force)
  1068. disable_acpi();
  1069. acpi_ht = 1;
  1070. }
  1071. /* "acpi=noirq" disables ACPI interrupt routing */
  1072. else if (strcmp(arg, "noirq") == 0) {
  1073. acpi_noirq_set();
  1074. } else {
  1075. /* Core will printk when we return error. */
  1076. return -EINVAL;
  1077. }
  1078. return 0;
  1079. }
  1080. early_param("acpi", parse_acpi);
  1081. /* FIXME: Using pci= for an ACPI parameter is a travesty. */
  1082. static int __init parse_pci(char *arg)
  1083. {
  1084. if (arg && strcmp(arg, "noacpi") == 0)
  1085. acpi_disable_pci();
  1086. return 0;
  1087. }
  1088. early_param("pci", parse_pci);
  1089. #ifdef CONFIG_X86_IO_APIC
  1090. static int __init parse_acpi_skip_timer_override(char *arg)
  1091. {
  1092. acpi_skip_timer_override = 1;
  1093. return 0;
  1094. }
  1095. early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override);
  1096. #endif /* CONFIG_X86_IO_APIC */
  1097. static int __init setup_acpi_sci(char *s)
  1098. {
  1099. if (!s)
  1100. return -EINVAL;
  1101. if (!strcmp(s, "edge"))
  1102. acpi_sci_flags.trigger = 1;
  1103. else if (!strcmp(s, "level"))
  1104. acpi_sci_flags.trigger = 3;
  1105. else if (!strcmp(s, "high"))
  1106. acpi_sci_flags.polarity = 1;
  1107. else if (!strcmp(s, "low"))
  1108. acpi_sci_flags.polarity = 3;
  1109. else
  1110. return -EINVAL;
  1111. return 0;
  1112. }
  1113. early_param("acpi_sci", setup_acpi_sci);