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