es7000_32.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  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 __init 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 __init 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 __init 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 __init 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 __init 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 __initdata es7000_acpi_ret;
  255. /* Hook from generic ACPI tables.c */
  256. static int __init 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 __init
  279. 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 __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
  286. {
  287. return 0;
  288. }
  289. static int __init
  290. 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 __init
  302. es7000_mip_write(struct mip_reg *mip_reg)
  303. {
  304. int status = 0;
  305. int spin;
  306. spin = MIP_SPIN;
  307. while ((host_reg->off_0x38 & MIP_VALID) != 0) {
  308. if (--spin <= 0) {
  309. WARN(1, "Timeout waiting for Host Valid Flag\n");
  310. return -1;
  311. }
  312. es7000_spin(MIP_SPIN);
  313. }
  314. memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
  315. outb(1, mip_port);
  316. spin = MIP_SPIN;
  317. while ((mip_reg->off_0x38 & MIP_VALID) == 0) {
  318. if (--spin <= 0) {
  319. WARN(1, "Timeout waiting for MIP Valid Flag\n");
  320. return -1;
  321. }
  322. es7000_spin(MIP_SPIN);
  323. }
  324. status = (mip_reg->off_0x00 & 0xffff0000000000ULL) >> 48;
  325. mip_reg->off_0x38 &= ~MIP_VALID;
  326. return status;
  327. }
  328. static void __init es7000_enable_apic_mode(void)
  329. {
  330. struct mip_reg es7000_mip_reg;
  331. int mip_status;
  332. if (!es7000_plat)
  333. return;
  334. printk(KERN_INFO "ES7000: Enabling APIC mode.\n");
  335. memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
  336. es7000_mip_reg.off_0x00 = MIP_SW_APIC;
  337. es7000_mip_reg.off_0x38 = MIP_VALID;
  338. while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
  339. WARN(1, "Command failed, status = %x\n", mip_status);
  340. }
  341. static void es7000_vector_allocation_domain(int cpu, cpumask_t *retmask)
  342. {
  343. /* Careful. Some cpus do not strictly honor the set of cpus
  344. * specified in the interrupt destination when using lowest
  345. * priority interrupt delivery mode.
  346. *
  347. * In particular there was a hyperthreading cpu observed to
  348. * deliver interrupts to the wrong hyperthread when only one
  349. * hyperthread was specified in the interrupt desitination.
  350. */
  351. *retmask = (cpumask_t){ { [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 cpumask_t *target_cpus_cluster(void)
  379. {
  380. return &CPU_MASK_ALL;
  381. }
  382. static const cpumask_t *es7000_target_cpus(void)
  383. {
  384. return &cpumask_of_cpu(smp_processor_id());
  385. }
  386. static unsigned long
  387. es7000_check_apicid_used(physid_mask_t bitmap, int apicid)
  388. {
  389. return 0;
  390. }
  391. static unsigned long es7000_check_apicid_present(int bit)
  392. {
  393. return physid_isset(bit, phys_cpu_present_map);
  394. }
  395. static unsigned long calculate_ldr(int cpu)
  396. {
  397. unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu);
  398. return SET_APIC_LOGICAL_ID(id);
  399. }
  400. /*
  401. * Set up the logical destination ID.
  402. *
  403. * Intel recommends to set DFR, LdR and TPR before enabling
  404. * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
  405. * document number 292116). So here it goes...
  406. */
  407. static void es7000_init_apic_ldr_cluster(void)
  408. {
  409. unsigned long val;
  410. int cpu = smp_processor_id();
  411. apic_write(APIC_DFR, APIC_DFR_CLUSTER);
  412. val = calculate_ldr(cpu);
  413. apic_write(APIC_LDR, val);
  414. }
  415. static void es7000_init_apic_ldr(void)
  416. {
  417. unsigned long val;
  418. int cpu = smp_processor_id();
  419. apic_write(APIC_DFR, APIC_DFR_FLAT);
  420. val = calculate_ldr(cpu);
  421. apic_write(APIC_LDR, val);
  422. }
  423. static void es7000_setup_apic_routing(void)
  424. {
  425. int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
  426. printk(KERN_INFO
  427. "Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
  428. (apic_version[apic] == 0x14) ?
  429. "Physical Cluster" : "Logical Cluster",
  430. nr_ioapics, cpus_addr(*es7000_target_cpus())[0]);
  431. }
  432. static int es7000_apicid_to_node(int logical_apicid)
  433. {
  434. return 0;
  435. }
  436. static int es7000_cpu_present_to_apicid(int mps_cpu)
  437. {
  438. if (!mps_cpu)
  439. return boot_cpu_physical_apicid;
  440. else if (mps_cpu < nr_cpu_ids)
  441. return per_cpu(x86_bios_cpu_apicid, mps_cpu);
  442. else
  443. return BAD_APICID;
  444. }
  445. static int cpu_id;
  446. static physid_mask_t es7000_apicid_to_cpu_present(int phys_apicid)
  447. {
  448. physid_mask_t mask;
  449. mask = physid_mask_of_physid(cpu_id);
  450. ++cpu_id;
  451. return mask;
  452. }
  453. /* Mapping from cpu number to logical apicid */
  454. static int es7000_cpu_to_logical_apicid(int cpu)
  455. {
  456. #ifdef CONFIG_SMP
  457. if (cpu >= nr_cpu_ids)
  458. return BAD_APICID;
  459. return cpu_2_logical_apicid[cpu];
  460. #else
  461. return logical_smp_processor_id();
  462. #endif
  463. }
  464. static physid_mask_t es7000_ioapic_phys_id_map(physid_mask_t phys_map)
  465. {
  466. /* For clustered we don't have a good way to do this yet - hack */
  467. return physids_promote(0xff);
  468. }
  469. static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
  470. {
  471. boot_cpu_physical_apicid = read_apic_id();
  472. return 1;
  473. }
  474. static unsigned int
  475. es7000_cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
  476. {
  477. int cpus_found = 0;
  478. int num_bits_set;
  479. int apicid;
  480. int cpu;
  481. num_bits_set = cpumask_weight(cpumask);
  482. /* Return id to all */
  483. if (num_bits_set == nr_cpu_ids)
  484. return 0xFF;
  485. /*
  486. * The cpus in the mask must all be on the apic cluster. If are not
  487. * on the same apicid cluster return default value of target_cpus():
  488. */
  489. cpu = cpumask_first(cpumask);
  490. apicid = es7000_cpu_to_logical_apicid(cpu);
  491. while (cpus_found < num_bits_set) {
  492. if (cpumask_test_cpu(cpu, cpumask)) {
  493. int new_apicid = es7000_cpu_to_logical_apicid(cpu);
  494. if (APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
  495. WARN(1, "Not a valid mask!");
  496. return 0xFF;
  497. }
  498. apicid = new_apicid;
  499. cpus_found++;
  500. }
  501. cpu++;
  502. }
  503. return apicid;
  504. }
  505. static unsigned int es7000_cpu_mask_to_apicid(const cpumask_t *cpumask)
  506. {
  507. int cpus_found = 0;
  508. int num_bits_set;
  509. int apicid;
  510. int cpu;
  511. num_bits_set = cpus_weight(*cpumask);
  512. /* Return id to all */
  513. if (num_bits_set == nr_cpu_ids)
  514. return es7000_cpu_to_logical_apicid(0);
  515. /*
  516. * The cpus in the mask must all be on the apic cluster. If are not
  517. * on the same apicid cluster return default value of target_cpus():
  518. */
  519. cpu = first_cpu(*cpumask);
  520. apicid = es7000_cpu_to_logical_apicid(cpu);
  521. while (cpus_found < num_bits_set) {
  522. if (cpu_isset(cpu, *cpumask)) {
  523. int new_apicid = es7000_cpu_to_logical_apicid(cpu);
  524. if (APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
  525. printk("%s: Not a valid mask!\n", __func__);
  526. return es7000_cpu_to_logical_apicid(0);
  527. }
  528. apicid = new_apicid;
  529. cpus_found++;
  530. }
  531. cpu++;
  532. }
  533. return apicid;
  534. }
  535. static unsigned int
  536. es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
  537. const struct cpumask *andmask)
  538. {
  539. int apicid = es7000_cpu_to_logical_apicid(0);
  540. cpumask_var_t cpumask;
  541. if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
  542. return apicid;
  543. cpumask_and(cpumask, inmask, andmask);
  544. cpumask_and(cpumask, cpumask, cpu_online_mask);
  545. apicid = es7000_cpu_mask_to_apicid(cpumask);
  546. free_cpumask_var(cpumask);
  547. return apicid;
  548. }
  549. static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
  550. {
  551. return cpuid_apic >> index_msb;
  552. }
  553. static int probe_es7000(void)
  554. {
  555. /* probed later in mptable/ACPI hooks */
  556. return 0;
  557. }
  558. static int __initdata es7000_mps_ret;
  559. static __init int
  560. es7000_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
  561. {
  562. int ret = 0;
  563. if (mpc->oemptr) {
  564. struct mpc_oemtable *oem_table =
  565. (struct mpc_oemtable *)mpc->oemptr;
  566. if (!strncmp(oem, "UNISYS", 6))
  567. ret = parse_unisys_oem((char *)oem_table);
  568. }
  569. es7000_mps_ret = ret;
  570. return ret && !es7000_apic_is_cluster();
  571. }
  572. static __init int
  573. es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem, char *productid)
  574. {
  575. int ret = es7000_mps_ret;
  576. return ret && es7000_apic_is_cluster();
  577. }
  578. struct apic apic_es7000_cluster = {
  579. .name = "es7000",
  580. .probe = probe_es7000,
  581. .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster,
  582. .apic_id_registered = es7000_apic_id_registered,
  583. .irq_delivery_mode = dest_LowestPrio,
  584. /* logical delivery broadcast to all procs: */
  585. .irq_dest_mode = 1,
  586. .target_cpus = target_cpus_cluster,
  587. .disable_esr = 1,
  588. .dest_logical = 0,
  589. .check_apicid_used = es7000_check_apicid_used,
  590. .check_apicid_present = es7000_check_apicid_present,
  591. .vector_allocation_domain = es7000_vector_allocation_domain,
  592. .init_apic_ldr = es7000_init_apic_ldr_cluster,
  593. .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
  594. .setup_apic_routing = es7000_setup_apic_routing,
  595. .multi_timer_check = NULL,
  596. .apicid_to_node = es7000_apicid_to_node,
  597. .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
  598. .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
  599. .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
  600. .setup_portio_remap = NULL,
  601. .check_phys_apicid_present = es7000_check_phys_apicid_present,
  602. .enable_apic_mode = es7000_enable_apic_mode,
  603. .phys_pkg_id = es7000_phys_pkg_id,
  604. .mps_oem_check = es7000_mps_oem_check_cluster,
  605. .get_apic_id = es7000_get_apic_id,
  606. .set_apic_id = NULL,
  607. .apic_id_mask = 0xFF << 24,
  608. .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid_cluster,
  609. .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
  610. .send_IPI_mask = es7000_send_IPI_mask,
  611. .send_IPI_mask_allbutself = NULL,
  612. .send_IPI_allbutself = es7000_send_IPI_allbutself,
  613. .send_IPI_all = es7000_send_IPI_all,
  614. .send_IPI_self = default_send_IPI_self,
  615. .wakeup_secondary_cpu = wakeup_secondary_cpu_via_mip,
  616. .trampoline_phys_low = 0x467,
  617. .trampoline_phys_high = 0x469,
  618. .wait_for_init_deassert = NULL,
  619. /* Nothing to do for most platforms, since cleared by the INIT cycle: */
  620. .smp_callin_clear_local_apic = NULL,
  621. .inquire_remote_apic = default_inquire_remote_apic,
  622. .read = native_apic_mem_read,
  623. .write = native_apic_mem_write,
  624. .icr_read = native_apic_icr_read,
  625. .icr_write = native_apic_icr_write,
  626. .wait_icr_idle = native_apic_wait_icr_idle,
  627. .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
  628. };
  629. struct apic apic_es7000 = {
  630. .name = "es7000",
  631. .probe = probe_es7000,
  632. .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
  633. .apic_id_registered = es7000_apic_id_registered,
  634. .irq_delivery_mode = dest_Fixed,
  635. /* phys delivery to target CPUs: */
  636. .irq_dest_mode = 0,
  637. .target_cpus = es7000_target_cpus,
  638. .disable_esr = 1,
  639. .dest_logical = 0,
  640. .check_apicid_used = es7000_check_apicid_used,
  641. .check_apicid_present = es7000_check_apicid_present,
  642. .vector_allocation_domain = es7000_vector_allocation_domain,
  643. .init_apic_ldr = es7000_init_apic_ldr,
  644. .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
  645. .setup_apic_routing = es7000_setup_apic_routing,
  646. .multi_timer_check = NULL,
  647. .apicid_to_node = es7000_apicid_to_node,
  648. .cpu_to_logical_apicid = es7000_cpu_to_logical_apicid,
  649. .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
  650. .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
  651. .setup_portio_remap = NULL,
  652. .check_phys_apicid_present = es7000_check_phys_apicid_present,
  653. .enable_apic_mode = es7000_enable_apic_mode,
  654. .phys_pkg_id = es7000_phys_pkg_id,
  655. .mps_oem_check = es7000_mps_oem_check,
  656. .get_apic_id = es7000_get_apic_id,
  657. .set_apic_id = NULL,
  658. .apic_id_mask = 0xFF << 24,
  659. .cpu_mask_to_apicid = es7000_cpu_mask_to_apicid,
  660. .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
  661. .send_IPI_mask = es7000_send_IPI_mask,
  662. .send_IPI_mask_allbutself = NULL,
  663. .send_IPI_allbutself = es7000_send_IPI_allbutself,
  664. .send_IPI_all = es7000_send_IPI_all,
  665. .send_IPI_self = default_send_IPI_self,
  666. .trampoline_phys_low = 0x467,
  667. .trampoline_phys_high = 0x469,
  668. .wait_for_init_deassert = es7000_wait_for_init_deassert,
  669. /* Nothing to do for most platforms, since cleared by the INIT cycle: */
  670. .smp_callin_clear_local_apic = NULL,
  671. .inquire_remote_apic = default_inquire_remote_apic,
  672. .read = native_apic_mem_read,
  673. .write = native_apic_mem_write,
  674. .icr_read = native_apic_icr_read,
  675. .icr_write = native_apic_icr_write,
  676. .wait_icr_idle = native_apic_wait_icr_idle,
  677. .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
  678. };