es7000_32.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  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_wait_for_init_deassert(atomic_t *deassert)
  325. {
  326. while (!atomic_read(deassert))
  327. cpu_relax();
  328. }
  329. static unsigned int es7000_get_apic_id(unsigned long x)
  330. {
  331. return (x >> 24) & 0xFF;
  332. }
  333. static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
  334. {
  335. default_send_IPI_mask_sequence_phys(mask, vector);
  336. }
  337. static void es7000_send_IPI_allbutself(int vector)
  338. {
  339. default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
  340. }
  341. static void es7000_send_IPI_all(int vector)
  342. {
  343. es7000_send_IPI_mask(cpu_online_mask, vector);
  344. }
  345. static int es7000_apic_id_registered(void)
  346. {
  347. return 1;
  348. }
  349. static const struct cpumask *target_cpus_cluster(void)
  350. {
  351. return cpu_all_mask;
  352. }
  353. static const struct cpumask *es7000_target_cpus(void)
  354. {
  355. return cpumask_of(smp_processor_id());
  356. }
  357. static unsigned long es7000_check_apicid_used(physid_mask_t *map, int apicid)
  358. {
  359. return 0;
  360. }
  361. static unsigned long es7000_check_apicid_present(int bit)
  362. {
  363. return physid_isset(bit, phys_cpu_present_map);
  364. }
  365. static int es7000_early_logical_apicid(int cpu)
  366. {
  367. /* on es7000, logical apicid is the same as physical */
  368. return early_per_cpu(x86_bios_cpu_apicid, cpu);
  369. }
  370. static unsigned long calculate_ldr(int cpu)
  371. {
  372. unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu);
  373. return SET_APIC_LOGICAL_ID(id);
  374. }
  375. /*
  376. * Set up the logical destination ID.
  377. *
  378. * Intel recommends to set DFR, LdR and TPR before enabling
  379. * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
  380. * document number 292116). So here it goes...
  381. */
  382. static void es7000_init_apic_ldr_cluster(void)
  383. {
  384. unsigned long val;
  385. int cpu = smp_processor_id();
  386. apic_write(APIC_DFR, APIC_DFR_CLUSTER);
  387. val = calculate_ldr(cpu);
  388. apic_write(APIC_LDR, val);
  389. }
  390. static void es7000_init_apic_ldr(void)
  391. {
  392. unsigned long val;
  393. int cpu = smp_processor_id();
  394. apic_write(APIC_DFR, APIC_DFR_FLAT);
  395. val = calculate_ldr(cpu);
  396. apic_write(APIC_LDR, val);
  397. }
  398. static void es7000_setup_apic_routing(void)
  399. {
  400. int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
  401. pr_info("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
  402. (apic_version[apic] == 0x14) ?
  403. "Physical Cluster" : "Logical Cluster",
  404. nr_ioapics, cpumask_bits(es7000_target_cpus())[0]);
  405. }
  406. static int es7000_cpu_present_to_apicid(int mps_cpu)
  407. {
  408. if (!mps_cpu)
  409. return boot_cpu_physical_apicid;
  410. else if (mps_cpu < nr_cpu_ids)
  411. return per_cpu(x86_bios_cpu_apicid, mps_cpu);
  412. else
  413. return BAD_APICID;
  414. }
  415. static int cpu_id;
  416. static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap)
  417. {
  418. physid_set_mask_of_physid(cpu_id, retmap);
  419. ++cpu_id;
  420. }
  421. static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
  422. {
  423. /* For clustered we don't have a good way to do this yet - hack */
  424. physids_promote(0xFFL, retmap);
  425. }
  426. static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
  427. {
  428. boot_cpu_physical_apicid = read_apic_id();
  429. return 1;
  430. }
  431. static inline int
  432. es7000_cpu_mask_to_apicid(const struct cpumask *cpumask, unsigned int *dest_id)
  433. {
  434. unsigned int round = 0;
  435. unsigned int cpu, uninitialized_var(apicid);
  436. /*
  437. * The cpus in the mask must all be on the apic cluster.
  438. */
  439. for_each_cpu_and(cpu, cpumask, cpu_online_mask) {
  440. int new_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
  441. if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
  442. WARN(1, "Not a valid mask!");
  443. return -EINVAL;
  444. }
  445. apicid |= new_apicid;
  446. round++;
  447. }
  448. if (!round)
  449. return -EINVAL;
  450. *dest_id = apicid;
  451. return 0;
  452. }
  453. static int
  454. es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
  455. const struct cpumask *andmask,
  456. unsigned int *apicid)
  457. {
  458. cpumask_var_t cpumask;
  459. *apicid = early_per_cpu(x86_cpu_to_logical_apicid, 0);
  460. if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
  461. return 0;
  462. cpumask_and(cpumask, inmask, andmask);
  463. es7000_cpu_mask_to_apicid(cpumask, apicid);
  464. free_cpumask_var(cpumask);
  465. return 0;
  466. }
  467. static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
  468. {
  469. return cpuid_apic >> index_msb;
  470. }
  471. static int probe_es7000(void)
  472. {
  473. /* probed later in mptable/ACPI hooks */
  474. return 0;
  475. }
  476. static int es7000_mps_ret;
  477. static int es7000_mps_oem_check(struct mpc_table *mpc, char *oem,
  478. char *productid)
  479. {
  480. int ret = 0;
  481. if (mpc->oemptr) {
  482. struct mpc_oemtable *oem_table =
  483. (struct mpc_oemtable *)mpc->oemptr;
  484. if (!strncmp(oem, "UNISYS", 6))
  485. ret = parse_unisys_oem((char *)oem_table);
  486. }
  487. es7000_mps_ret = ret;
  488. return ret && !es7000_apic_is_cluster();
  489. }
  490. static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
  491. char *productid)
  492. {
  493. int ret = es7000_mps_ret;
  494. return ret && es7000_apic_is_cluster();
  495. }
  496. /* We've been warned by a false positive warning.Use __refdata to keep calm. */
  497. static struct apic __refdata apic_es7000_cluster = {
  498. .name = "es7000",
  499. .probe = probe_es7000,
  500. .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster,
  501. .apic_id_valid = default_apic_id_valid,
  502. .apic_id_registered = es7000_apic_id_registered,
  503. .irq_delivery_mode = dest_LowestPrio,
  504. /* logical delivery broadcast to all procs: */
  505. .irq_dest_mode = 1,
  506. .target_cpus = target_cpus_cluster,
  507. .disable_esr = 1,
  508. .dest_logical = 0,
  509. .check_apicid_used = es7000_check_apicid_used,
  510. .check_apicid_present = es7000_check_apicid_present,
  511. .vector_allocation_domain = flat_vector_allocation_domain,
  512. .init_apic_ldr = es7000_init_apic_ldr_cluster,
  513. .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
  514. .setup_apic_routing = es7000_setup_apic_routing,
  515. .multi_timer_check = NULL,
  516. .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
  517. .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
  518. .setup_portio_remap = NULL,
  519. .check_phys_apicid_present = es7000_check_phys_apicid_present,
  520. .enable_apic_mode = es7000_enable_apic_mode,
  521. .phys_pkg_id = es7000_phys_pkg_id,
  522. .mps_oem_check = es7000_mps_oem_check_cluster,
  523. .get_apic_id = es7000_get_apic_id,
  524. .set_apic_id = NULL,
  525. .apic_id_mask = 0xFF << 24,
  526. .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
  527. .send_IPI_mask = es7000_send_IPI_mask,
  528. .send_IPI_mask_allbutself = NULL,
  529. .send_IPI_allbutself = es7000_send_IPI_allbutself,
  530. .send_IPI_all = es7000_send_IPI_all,
  531. .send_IPI_self = default_send_IPI_self,
  532. .wakeup_secondary_cpu = wakeup_secondary_cpu_via_mip,
  533. .trampoline_phys_low = 0x467,
  534. .trampoline_phys_high = 0x469,
  535. .wait_for_init_deassert = NULL,
  536. /* Nothing to do for most platforms, since cleared by the INIT cycle: */
  537. .smp_callin_clear_local_apic = NULL,
  538. .inquire_remote_apic = default_inquire_remote_apic,
  539. .read = native_apic_mem_read,
  540. .write = native_apic_mem_write,
  541. .eoi_write = native_apic_mem_write,
  542. .icr_read = native_apic_icr_read,
  543. .icr_write = native_apic_icr_write,
  544. .wait_icr_idle = native_apic_wait_icr_idle,
  545. .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
  546. .x86_32_early_logical_apicid = es7000_early_logical_apicid,
  547. };
  548. static struct apic __refdata apic_es7000 = {
  549. .name = "es7000",
  550. .probe = probe_es7000,
  551. .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
  552. .apic_id_valid = default_apic_id_valid,
  553. .apic_id_registered = es7000_apic_id_registered,
  554. .irq_delivery_mode = dest_Fixed,
  555. /* phys delivery to target CPUs: */
  556. .irq_dest_mode = 0,
  557. .target_cpus = es7000_target_cpus,
  558. .disable_esr = 1,
  559. .dest_logical = 0,
  560. .check_apicid_used = es7000_check_apicid_used,
  561. .check_apicid_present = es7000_check_apicid_present,
  562. .vector_allocation_domain = flat_vector_allocation_domain,
  563. .init_apic_ldr = es7000_init_apic_ldr,
  564. .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
  565. .setup_apic_routing = es7000_setup_apic_routing,
  566. .multi_timer_check = NULL,
  567. .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
  568. .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
  569. .setup_portio_remap = NULL,
  570. .check_phys_apicid_present = es7000_check_phys_apicid_present,
  571. .enable_apic_mode = es7000_enable_apic_mode,
  572. .phys_pkg_id = es7000_phys_pkg_id,
  573. .mps_oem_check = es7000_mps_oem_check,
  574. .get_apic_id = es7000_get_apic_id,
  575. .set_apic_id = NULL,
  576. .apic_id_mask = 0xFF << 24,
  577. .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
  578. .send_IPI_mask = es7000_send_IPI_mask,
  579. .send_IPI_mask_allbutself = NULL,
  580. .send_IPI_allbutself = es7000_send_IPI_allbutself,
  581. .send_IPI_all = es7000_send_IPI_all,
  582. .send_IPI_self = default_send_IPI_self,
  583. .trampoline_phys_low = 0x467,
  584. .trampoline_phys_high = 0x469,
  585. .wait_for_init_deassert = es7000_wait_for_init_deassert,
  586. /* Nothing to do for most platforms, since cleared by the INIT cycle: */
  587. .smp_callin_clear_local_apic = NULL,
  588. .inquire_remote_apic = default_inquire_remote_apic,
  589. .read = native_apic_mem_read,
  590. .write = native_apic_mem_write,
  591. .eoi_write = native_apic_mem_write,
  592. .icr_read = native_apic_icr_read,
  593. .icr_write = native_apic_icr_write,
  594. .wait_icr_idle = native_apic_wait_icr_idle,
  595. .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
  596. .x86_32_early_logical_apicid = es7000_early_logical_apicid,
  597. };
  598. /*
  599. * Need to check for es7000 followed by es7000_cluster, so this order
  600. * in apic_drivers is important.
  601. */
  602. apic_drivers(apic_es7000, apic_es7000_cluster);