es7000_32.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. /*
  2. * Written by: Garry Forsgren, Unisys Corporation
  3. * Natalie Protasevich, Unisys Corporation
  4. *
  5. * This file contains the code to configure and interface
  6. * with Unisys ES7000 series hardware system manager.
  7. *
  8. * Copyright (c) 2003 Unisys Corporation.
  9. * Copyright (C) 2009, Red Hat, Inc., Ingo Molnar
  10. *
  11. * All Rights Reserved.
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of version 2 of the GNU General Public License as
  15. * published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it would be useful, but
  18. * WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. *
  21. * You should have received a copy of the GNU General Public License along
  22. * with this program; if not, write the Free Software Foundation, Inc., 59
  23. * Temple Place - Suite 330, Boston MA 02111-1307, USA.
  24. *
  25. * Contact information: Unisys Corporation, Township Line & Union Meeting
  26. * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
  27. *
  28. * http://www.unisys.com
  29. */
  30. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  31. #include <linux/notifier.h>
  32. #include <linux/spinlock.h>
  33. #include <linux/cpumask.h>
  34. #include <linux/threads.h>
  35. #include <linux/kernel.h>
  36. #include <linux/module.h>
  37. #include <linux/reboot.h>
  38. #include <linux/string.h>
  39. #include <linux/types.h>
  40. #include <linux/errno.h>
  41. #include <linux/acpi.h>
  42. #include <linux/init.h>
  43. #include <linux/gfp.h>
  44. #include <linux/nmi.h>
  45. #include <linux/smp.h>
  46. #include <linux/io.h>
  47. #include <asm/apicdef.h>
  48. #include <linux/atomic.h>
  49. #include <asm/fixmap.h>
  50. #include <asm/mpspec.h>
  51. #include <asm/setup.h>
  52. #include <asm/apic.h>
  53. #include <asm/ipi.h>
  54. /*
  55. * ES7000 chipsets
  56. */
  57. #define NON_UNISYS 0
  58. #define ES7000_CLASSIC 1
  59. #define ES7000_ZORRO 2
  60. #define MIP_REG 1
  61. #define MIP_PSAI_REG 4
  62. #define MIP_BUSY 1
  63. #define MIP_SPIN 0xf0000
  64. #define MIP_VALID 0x0100000000000000ULL
  65. #define MIP_SW_APIC 0x1020b
  66. #define MIP_PORT(val) ((val >> 32) & 0xffff)
  67. #define MIP_RD_LO(val) (val & 0xffffffff)
  68. struct mip_reg {
  69. unsigned long long off_0x00;
  70. unsigned long long off_0x08;
  71. unsigned long long off_0x10;
  72. unsigned long long off_0x18;
  73. unsigned long long off_0x20;
  74. unsigned long long off_0x28;
  75. unsigned long long off_0x30;
  76. unsigned long long off_0x38;
  77. };
  78. struct mip_reg_info {
  79. unsigned long long mip_info;
  80. unsigned long long delivery_info;
  81. unsigned long long host_reg;
  82. unsigned long long mip_reg;
  83. };
  84. struct psai {
  85. unsigned long long entry_type;
  86. unsigned long long addr;
  87. unsigned long long bep_addr;
  88. };
  89. #ifdef CONFIG_ACPI
  90. struct es7000_oem_table {
  91. struct acpi_table_header Header;
  92. u32 OEMTableAddr;
  93. u32 OEMTableSize;
  94. };
  95. static unsigned long oem_addrX;
  96. static unsigned long oem_size;
  97. #endif
  98. /*
  99. * ES7000 Globals
  100. */
  101. static volatile unsigned long *psai;
  102. static struct mip_reg *mip_reg;
  103. static struct mip_reg *host_reg;
  104. static int mip_port;
  105. static unsigned long mip_addr;
  106. static unsigned long host_addr;
  107. int es7000_plat;
  108. /*
  109. * GSI override for ES7000 platforms.
  110. */
  111. static int __cpuinit wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
  112. {
  113. unsigned long vect = 0, psaival = 0;
  114. if (psai == NULL)
  115. return -1;
  116. vect = ((unsigned long)__pa(eip)/0x1000) << 16;
  117. psaival = (0x1000000 | vect | cpu);
  118. while (*psai & 0x1000000)
  119. ;
  120. *psai = psaival;
  121. return 0;
  122. }
  123. static int es7000_apic_is_cluster(void)
  124. {
  125. /* MPENTIUMIII */
  126. if (boot_cpu_data.x86 == 6 &&
  127. (boot_cpu_data.x86_model >= 7 && boot_cpu_data.x86_model <= 11))
  128. return 1;
  129. return 0;
  130. }
  131. static void setup_unisys(void)
  132. {
  133. /*
  134. * Determine the generation of the ES7000 currently running.
  135. *
  136. * es7000_plat = 1 if the machine is a 5xx ES7000 box
  137. * es7000_plat = 2 if the machine is a x86_64 ES7000 box
  138. *
  139. */
  140. if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
  141. es7000_plat = ES7000_ZORRO;
  142. else
  143. es7000_plat = ES7000_CLASSIC;
  144. }
  145. /*
  146. * Parse the OEM Table:
  147. */
  148. static int parse_unisys_oem(char *oemptr)
  149. {
  150. int i;
  151. int success = 0;
  152. unsigned char type, size;
  153. unsigned long val;
  154. char *tp = NULL;
  155. struct psai *psaip = NULL;
  156. struct mip_reg_info *mi;
  157. struct mip_reg *host, *mip;
  158. tp = oemptr;
  159. tp += 8;
  160. for (i = 0; i <= 6; i++) {
  161. type = *tp++;
  162. size = *tp++;
  163. tp -= 2;
  164. switch (type) {
  165. case MIP_REG:
  166. mi = (struct mip_reg_info *)tp;
  167. val = MIP_RD_LO(mi->host_reg);
  168. host_addr = val;
  169. host = (struct mip_reg *)val;
  170. host_reg = __va(host);
  171. val = MIP_RD_LO(mi->mip_reg);
  172. mip_port = MIP_PORT(mi->mip_info);
  173. mip_addr = val;
  174. mip = (struct mip_reg *)val;
  175. mip_reg = __va(mip);
  176. pr_debug("host_reg = 0x%lx\n",
  177. (unsigned long)host_reg);
  178. pr_debug("mip_reg = 0x%lx\n",
  179. (unsigned long)mip_reg);
  180. success++;
  181. break;
  182. case MIP_PSAI_REG:
  183. psaip = (struct psai *)tp;
  184. if (tp != NULL) {
  185. if (psaip->addr)
  186. psai = __va(psaip->addr);
  187. else
  188. psai = NULL;
  189. success++;
  190. }
  191. break;
  192. default:
  193. break;
  194. }
  195. tp += size;
  196. }
  197. if (success < 2)
  198. es7000_plat = NON_UNISYS;
  199. else
  200. setup_unisys();
  201. return es7000_plat;
  202. }
  203. #ifdef CONFIG_ACPI
  204. static int __init find_unisys_acpi_oem_table(unsigned long *oem_addr)
  205. {
  206. struct acpi_table_header *header = NULL;
  207. struct es7000_oem_table *table;
  208. acpi_size tbl_size;
  209. acpi_status ret;
  210. int i = 0;
  211. for (;;) {
  212. ret = acpi_get_table_with_size("OEM1", i++, &header, &tbl_size);
  213. if (!ACPI_SUCCESS(ret))
  214. return -1;
  215. if (!memcmp((char *) &header->oem_id, "UNISYS", 6))
  216. break;
  217. early_acpi_os_unmap_memory(header, tbl_size);
  218. }
  219. table = (void *)header;
  220. oem_addrX = table->OEMTableAddr;
  221. oem_size = table->OEMTableSize;
  222. early_acpi_os_unmap_memory(header, tbl_size);
  223. *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, oem_size);
  224. return 0;
  225. }
  226. static void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr)
  227. {
  228. if (!oem_addr)
  229. return;
  230. __acpi_unmap_table((char *)oem_addr, oem_size);
  231. }
  232. static int es7000_check_dsdt(void)
  233. {
  234. struct acpi_table_header header;
  235. if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
  236. !strncmp(header.oem_id, "UNISYS", 6))
  237. return 1;
  238. return 0;
  239. }
  240. static int es7000_acpi_ret;
  241. /* Hook from generic ACPI tables.c */
  242. static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
  243. {
  244. unsigned long oem_addr = 0;
  245. int check_dsdt;
  246. int ret = 0;
  247. /* check dsdt at first to avoid clear fix_map for oem_addr */
  248. check_dsdt = es7000_check_dsdt();
  249. if (!find_unisys_acpi_oem_table(&oem_addr)) {
  250. if (check_dsdt) {
  251. ret = parse_unisys_oem((char *)oem_addr);
  252. } else {
  253. setup_unisys();
  254. ret = 1;
  255. }
  256. /*
  257. * we need to unmap it
  258. */
  259. unmap_unisys_acpi_oem_table(oem_addr);
  260. }
  261. es7000_acpi_ret = ret;
  262. return ret && !es7000_apic_is_cluster();
  263. }
  264. static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
  265. {
  266. int ret = es7000_acpi_ret;
  267. return ret && es7000_apic_is_cluster();
  268. }
  269. #else /* !CONFIG_ACPI: */
  270. static int es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
  271. {
  272. return 0;
  273. }
  274. static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
  275. {
  276. return 0;
  277. }
  278. #endif /* !CONFIG_ACPI */
  279. static void es7000_spin(int n)
  280. {
  281. int i = 0;
  282. while (i++ < n)
  283. rep_nop();
  284. }
  285. static int es7000_mip_write(struct mip_reg *mip_reg)
  286. {
  287. int status = 0;
  288. int spin;
  289. spin = MIP_SPIN;
  290. while ((host_reg->off_0x38 & MIP_VALID) != 0) {
  291. if (--spin <= 0) {
  292. WARN(1, "Timeout waiting for Host Valid Flag\n");
  293. return -1;
  294. }
  295. es7000_spin(MIP_SPIN);
  296. }
  297. memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
  298. outb(1, mip_port);
  299. spin = MIP_SPIN;
  300. while ((mip_reg->off_0x38 & MIP_VALID) == 0) {
  301. if (--spin <= 0) {
  302. WARN(1, "Timeout waiting for MIP Valid Flag\n");
  303. return -1;
  304. }
  305. es7000_spin(MIP_SPIN);
  306. }
  307. status = (mip_reg->off_0x00 & 0xffff0000000000ULL) >> 48;
  308. mip_reg->off_0x38 &= ~MIP_VALID;
  309. return status;
  310. }
  311. static void es7000_enable_apic_mode(void)
  312. {
  313. struct mip_reg es7000_mip_reg;
  314. int mip_status;
  315. if (!es7000_plat)
  316. return;
  317. pr_info("Enabling APIC mode.\n");
  318. memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
  319. es7000_mip_reg.off_0x00 = MIP_SW_APIC;
  320. es7000_mip_reg.off_0x38 = MIP_VALID;
  321. while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
  322. WARN(1, "Command failed, status = %x\n", mip_status);
  323. }
  324. static void es7000_vector_allocation_domain(int cpu, struct cpumask *retmask)
  325. {
  326. /* Careful. Some cpus do not strictly honor the set of cpus
  327. * specified in the interrupt destination when using lowest
  328. * priority interrupt delivery mode.
  329. *
  330. * In particular there was a hyperthreading cpu observed to
  331. * deliver interrupts to the wrong hyperthread when only one
  332. * hyperthread was specified in the interrupt desitination.
  333. */
  334. cpumask_clear(retmask);
  335. cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
  336. }
  337. static void es7000_wait_for_init_deassert(atomic_t *deassert)
  338. {
  339. while (!atomic_read(deassert))
  340. cpu_relax();
  341. }
  342. static unsigned int es7000_get_apic_id(unsigned long x)
  343. {
  344. return (x >> 24) & 0xFF;
  345. }
  346. static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
  347. {
  348. default_send_IPI_mask_sequence_phys(mask, vector);
  349. }
  350. static void es7000_send_IPI_allbutself(int vector)
  351. {
  352. default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
  353. }
  354. static void es7000_send_IPI_all(int vector)
  355. {
  356. es7000_send_IPI_mask(cpu_online_mask, vector);
  357. }
  358. static int es7000_apic_id_registered(void)
  359. {
  360. return 1;
  361. }
  362. static const struct cpumask *target_cpus_cluster(void)
  363. {
  364. return cpu_all_mask;
  365. }
  366. static const struct cpumask *es7000_target_cpus(void)
  367. {
  368. return cpumask_of(smp_processor_id());
  369. }
  370. static unsigned long es7000_check_apicid_used(physid_mask_t *map, int apicid)
  371. {
  372. return 0;
  373. }
  374. static unsigned long es7000_check_apicid_present(int bit)
  375. {
  376. return physid_isset(bit, phys_cpu_present_map);
  377. }
  378. static int es7000_early_logical_apicid(int cpu)
  379. {
  380. /* on es7000, logical apicid is the same as physical */
  381. return early_per_cpu(x86_bios_cpu_apicid, cpu);
  382. }
  383. static unsigned long calculate_ldr(int cpu)
  384. {
  385. unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu);
  386. return SET_APIC_LOGICAL_ID(id);
  387. }
  388. /*
  389. * Set up the logical destination ID.
  390. *
  391. * Intel recommends to set DFR, LdR and TPR before enabling
  392. * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
  393. * document number 292116). So here it goes...
  394. */
  395. static void es7000_init_apic_ldr_cluster(void)
  396. {
  397. unsigned long val;
  398. int cpu = smp_processor_id();
  399. apic_write(APIC_DFR, APIC_DFR_CLUSTER);
  400. val = calculate_ldr(cpu);
  401. apic_write(APIC_LDR, val);
  402. }
  403. static void es7000_init_apic_ldr(void)
  404. {
  405. unsigned long val;
  406. int cpu = smp_processor_id();
  407. apic_write(APIC_DFR, APIC_DFR_FLAT);
  408. val = calculate_ldr(cpu);
  409. apic_write(APIC_LDR, val);
  410. }
  411. static void es7000_setup_apic_routing(void)
  412. {
  413. int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
  414. pr_info("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
  415. (apic_version[apic] == 0x14) ?
  416. "Physical Cluster" : "Logical Cluster",
  417. nr_ioapics, cpumask_bits(es7000_target_cpus())[0]);
  418. }
  419. static int es7000_cpu_present_to_apicid(int mps_cpu)
  420. {
  421. if (!mps_cpu)
  422. return boot_cpu_physical_apicid;
  423. else if (mps_cpu < nr_cpu_ids)
  424. return per_cpu(x86_bios_cpu_apicid, mps_cpu);
  425. else
  426. return BAD_APICID;
  427. }
  428. static int cpu_id;
  429. static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap)
  430. {
  431. physid_set_mask_of_physid(cpu_id, retmap);
  432. ++cpu_id;
  433. }
  434. static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
  435. {
  436. /* For clustered we don't have a good way to do this yet - hack */
  437. physids_promote(0xFFL, retmap);
  438. }
  439. static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
  440. {
  441. boot_cpu_physical_apicid = read_apic_id();
  442. return 1;
  443. }
  444. static unsigned int es7000_cpu_mask_to_apicid(const struct cpumask *cpumask)
  445. {
  446. unsigned int round = 0;
  447. int cpu, uninitialized_var(apicid);
  448. /*
  449. * The cpus in the mask must all be on the apic cluster.
  450. */
  451. for_each_cpu(cpu, cpumask) {
  452. int new_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
  453. if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
  454. WARN(1, "Not a valid mask!");
  455. return BAD_APICID;
  456. }
  457. apicid = new_apicid;
  458. round++;
  459. }
  460. return apicid;
  461. }
  462. static unsigned int
  463. es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
  464. const struct cpumask *andmask)
  465. {
  466. int apicid = early_per_cpu(x86_cpu_to_logical_apicid, 0);
  467. cpumask_var_t cpumask;
  468. if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
  469. return apicid;
  470. cpumask_and(cpumask, inmask, andmask);
  471. cpumask_and(cpumask, cpumask, cpu_online_mask);
  472. apicid = es7000_cpu_mask_to_apicid(cpumask);
  473. free_cpumask_var(cpumask);
  474. return apicid;
  475. }
  476. static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
  477. {
  478. return cpuid_apic >> index_msb;
  479. }
  480. static int probe_es7000(void)
  481. {
  482. /* probed later in mptable/ACPI hooks */
  483. return 0;
  484. }
  485. static int es7000_mps_ret;
  486. static int es7000_mps_oem_check(struct mpc_table *mpc, char *oem,
  487. char *productid)
  488. {
  489. int ret = 0;
  490. if (mpc->oemptr) {
  491. struct mpc_oemtable *oem_table =
  492. (struct mpc_oemtable *)mpc->oemptr;
  493. if (!strncmp(oem, "UNISYS", 6))
  494. ret = parse_unisys_oem((char *)oem_table);
  495. }
  496. es7000_mps_ret = ret;
  497. return ret && !es7000_apic_is_cluster();
  498. }
  499. static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
  500. char *productid)
  501. {
  502. int ret = es7000_mps_ret;
  503. return ret && es7000_apic_is_cluster();
  504. }
  505. /* We've been warned by a false positive warning.Use __refdata to keep calm. */
  506. static struct apic __refdata apic_es7000_cluster = {
  507. .name = "es7000",
  508. .probe = probe_es7000,
  509. .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster,
  510. .apic_id_registered = es7000_apic_id_registered,
  511. .irq_delivery_mode = dest_LowestPrio,
  512. /* logical delivery broadcast to all procs: */
  513. .irq_dest_mode = 1,
  514. .target_cpus = target_cpus_cluster,
  515. .disable_esr = 1,
  516. .dest_logical = 0,
  517. .check_apicid_used = es7000_check_apicid_used,
  518. .check_apicid_present = es7000_check_apicid_present,
  519. .vector_allocation_domain = es7000_vector_allocation_domain,
  520. .init_apic_ldr = es7000_init_apic_ldr_cluster,
  521. .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
  522. .setup_apic_routing = es7000_setup_apic_routing,
  523. .multi_timer_check = NULL,
  524. .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
  525. .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
  526. .setup_portio_remap = NULL,
  527. .check_phys_apicid_present = es7000_check_phys_apicid_present,
  528. .enable_apic_mode = es7000_enable_apic_mode,
  529. .phys_pkg_id = es7000_phys_pkg_id,
  530. .mps_oem_check = es7000_mps_oem_check_cluster,
  531. .get_apic_id = es7000_get_apic_id,
  532. .set_apic_id = NULL,
  533. .apic_id_mask = 0xFF << 24,
  534. .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
  535. .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
  536. .send_IPI_mask = es7000_send_IPI_mask,
  537. .send_IPI_mask_allbutself = NULL,
  538. .send_IPI_allbutself = es7000_send_IPI_allbutself,
  539. .send_IPI_all = es7000_send_IPI_all,
  540. .send_IPI_self = default_send_IPI_self,
  541. .wakeup_secondary_cpu = wakeup_secondary_cpu_via_mip,
  542. .trampoline_phys_low = 0x467,
  543. .trampoline_phys_high = 0x469,
  544. .wait_for_init_deassert = NULL,
  545. /* Nothing to do for most platforms, since cleared by the INIT cycle: */
  546. .smp_callin_clear_local_apic = NULL,
  547. .inquire_remote_apic = default_inquire_remote_apic,
  548. .read = native_apic_mem_read,
  549. .write = native_apic_mem_write,
  550. .icr_read = native_apic_icr_read,
  551. .icr_write = native_apic_icr_write,
  552. .wait_icr_idle = native_apic_wait_icr_idle,
  553. .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
  554. .x86_32_early_logical_apicid = es7000_early_logical_apicid,
  555. };
  556. static struct apic __refdata apic_es7000 = {
  557. .name = "es7000",
  558. .probe = probe_es7000,
  559. .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
  560. .apic_id_registered = es7000_apic_id_registered,
  561. .irq_delivery_mode = dest_Fixed,
  562. /* phys delivery to target CPUs: */
  563. .irq_dest_mode = 0,
  564. .target_cpus = es7000_target_cpus,
  565. .disable_esr = 1,
  566. .dest_logical = 0,
  567. .check_apicid_used = es7000_check_apicid_used,
  568. .check_apicid_present = es7000_check_apicid_present,
  569. .vector_allocation_domain = es7000_vector_allocation_domain,
  570. .init_apic_ldr = es7000_init_apic_ldr,
  571. .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
  572. .setup_apic_routing = es7000_setup_apic_routing,
  573. .multi_timer_check = NULL,
  574. .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
  575. .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
  576. .setup_portio_remap = NULL,
  577. .check_phys_apicid_present = es7000_check_phys_apicid_present,
  578. .enable_apic_mode = es7000_enable_apic_mode,
  579. .phys_pkg_id = es7000_phys_pkg_id,
  580. .mps_oem_check = es7000_mps_oem_check,
  581. .get_apic_id = es7000_get_apic_id,
  582. .set_apic_id = NULL,
  583. .apic_id_mask = 0xFF << 24,
  584. .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
  585. .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
  586. .send_IPI_mask = es7000_send_IPI_mask,
  587. .send_IPI_mask_allbutself = NULL,
  588. .send_IPI_allbutself = es7000_send_IPI_allbutself,
  589. .send_IPI_all = es7000_send_IPI_all,
  590. .send_IPI_self = default_send_IPI_self,
  591. .trampoline_phys_low = 0x467,
  592. .trampoline_phys_high = 0x469,
  593. .wait_for_init_deassert = es7000_wait_for_init_deassert,
  594. /* Nothing to do for most platforms, since cleared by the INIT cycle: */
  595. .smp_callin_clear_local_apic = NULL,
  596. .inquire_remote_apic = default_inquire_remote_apic,
  597. .read = native_apic_mem_read,
  598. .write = native_apic_mem_write,
  599. .icr_read = native_apic_icr_read,
  600. .icr_write = native_apic_icr_write,
  601. .wait_icr_idle = native_apic_wait_icr_idle,
  602. .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
  603. .x86_32_early_logical_apicid = es7000_early_logical_apicid,
  604. };
  605. /*
  606. * Need to check for es7000 followed by es7000_cluster, so this order
  607. * in apic_drivers is important.
  608. */
  609. apic_drivers(apic_es7000, apic_es7000_cluster);