es7000_32.c 18 KB

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