es7000_32.c 18 KB

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