es7000_32.c 18 KB

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