Lines Matching +full:no +full:- +full:hw +full:- +full:checksum
1 // SPDX-License-Identifier: GPL-2.0
4 * compliant MP-table parsing routines.
36 * Checksum an MP configuration block.
45 while (len--) in mpf_checksum()
55 topology_register_apic(m->apicid, CPU_ACPIID_INVALID, m->cpuflag & CPU_ENABLED); in MP_processor_info()
56 if (!(m->cpuflag & CPU_ENABLED)) in MP_processor_info()
59 if (m->cpuflag & CPU_BOOTPROCESSOR) in MP_processor_info()
60 bootup_cpu = " (Bootup-CPU)"; in MP_processor_info()
62 pr_info("Processor #%d%s\n", m->apicid, bootup_cpu); in MP_processor_info()
69 memcpy(str, m->bustype, 6); in mpc_oem_bus_info()
71 apic_pr_verbose("Bus #%d is %s\n", m->busid, str); in mpc_oem_bus_info()
81 if (m->busid >= MAX_MP_BUSSES) { in MP_bus_info()
83 m->busid, str, MAX_MP_BUSSES - 1); in MP_bus_info()
88 set_bit(m->busid, mp_bus_not_pci); in MP_bus_info()
89 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { in MP_bus_info()
91 mp_bus_id_to_type[m->busid] = MP_BUS_ISA; in MP_bus_info()
93 } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) { in MP_bus_info()
94 clear_bit(m->busid, mp_bus_not_pci); in MP_bus_info()
96 mp_bus_id_to_type[m->busid] = MP_BUS_PCI; in MP_bus_info()
97 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) { in MP_bus_info()
98 mp_bus_id_to_type[m->busid] = MP_BUS_EISA; in MP_bus_info()
101 pr_warn("Unknown bustype %s - ignoring\n", str); in MP_bus_info()
111 if (m->flags & MPC_APIC_USABLE) in MP_ioapic_info()
112 mp_register_ioapic(m->apicid, m->apicaddr, gsi_top, &cfg); in MP_ioapic_info()
119 mp_irq->irqtype, mp_irq->irqflag & 3, in print_mp_irq_info()
120 (mp_irq->irqflag >> 2) & 3, mp_irq->srcbus, in print_mp_irq_info()
121 mp_irq->srcbusirq, mp_irq->dstapic, mp_irq->dstirq); in print_mp_irq_info()
133 m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbusid, in MP_lintsrc_info()
134 m->srcbusirq, m->destapic, m->destapiclint); in MP_lintsrc_info()
143 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) { in smp_check_mpc()
145 mpc->signature[0], mpc->signature[1], in smp_check_mpc()
146 mpc->signature[2], mpc->signature[3]); in smp_check_mpc()
149 if (mpf_checksum((unsigned char *)mpc, mpc->length)) { in smp_check_mpc()
150 pr_err("MPTABLE: checksum error!\n"); in smp_check_mpc()
153 if (mpc->spec != 0x01 && mpc->spec != 0x04) { in smp_check_mpc()
154 pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec); in smp_check_mpc()
157 if (!mpc->lapic) { in smp_check_mpc()
161 memcpy(oem, mpc->oem, 8); in smp_check_mpc()
165 memcpy(str, mpc->productid, 12); in smp_check_mpc()
170 pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic); in smp_check_mpc()
183 pr_err("Your mptable is wrong, contact your HW vendor!\n"); in smp_dump_mptable()
186 1, mpc, mpc->length, 1); in smp_dump_mptable()
203 register_lapic_address(mpc->lapic); in smp_read_mpc()
208 while (count < mpc->length) { in smp_read_mpc()
235 count = mpc->length; in smp_read_mpc()
241 pr_err("MPTABLE: no processors registered!\n"); in smp_read_mpc()
269 * If true, we have an ISA/PCI system with no IRQ entries in construct_default_ioirq_mptable()
272 * there is good ELCR data is very simple - IRQ0, 1, 2 and 13 can in construct_default_ioirq_mptable()
277 pr_info("ISA/PCI bus type with no IRQ information... falling back to ELCR\n"); in construct_default_ioirq_mptable()
301 * If the ELCR indicates a level-sensitive interrupt, we in construct_default_ioirq_mptable()
363 * We set up most of the low 16 IO-APIC pins according to MPS rules. in construct_ioapic_table()
418 size = mpc->length; in get_mpc_size()
420 apic_pr_verbose(" mpc: %lx-%lx\n", physptr, physptr + size); in get_mpc_size()
430 size = get_mpc_size(mpf->physptr); in check_physptr()
431 mpc = early_memremap(mpf->physptr, size); in check_physptr()
442 pr_cont("... disabling SMP support. (tell your hw vendor)\n"); in check_physptr()
444 return -1; in check_physptr()
449 return -1; in check_physptr()
453 * If there are no explicit MP IRQ entries, then we are in check_physptr()
454 * broken. We set up most of the low 16 IO-APIC pins to in check_physptr()
460 pr_err("BIOS bug, no explicit IRQ entries, using default mptable. (tell your hw vendor)\n"); in check_physptr()
504 mpf->specification); in mpparse_get_smp_config()
506 if (mpf->feature2 & (1 << 7)) { in mpparse_get_smp_config()
517 if (mpf->feature1) { in mpparse_get_smp_config()
524 pr_info("Default MP configuration #%d\n", mpf->feature1); in mpparse_get_smp_config()
525 construct_default_ISA_mptable(mpf->feature1); in mpparse_get_smp_config()
527 } else if (mpf->physptr) { in mpparse_get_smp_config()
554 memblock_reserve(mpf->physptr, get_mpc_size(mpf->physptr)); in smp_reserve_memory()
563 apic_pr_verbose("Scan for SMP in [mem %#010lx-%#010lx]\n", base, base + length - 1); in smp_scan_config()
570 (mpf->length == 1) && in smp_scan_config()
572 ((mpf->specification == 1) in smp_scan_config()
573 || (mpf->specification == 4))) { in smp_scan_config()
580 pr_info("found SMP MP-table at [mem %#010lx-%#010lx]\n", in smp_scan_config()
581 base, base + sizeof(*mpf) - 1); in smp_scan_config()
584 if (mpf->physptr) in smp_scan_config()
595 length -= 16; in smp_scan_config()
621 * there is a real-mode segmented pointer pointing to the in mpparse_find_mptable()
645 if (m->irqtype != mp_INT) in get_MP_intsrc_index()
648 if (m->irqflag != (MP_IRQTRIG_LEVEL | MP_IRQPOL_ACTIVE_LOW)) in get_MP_intsrc_index()
661 if (mp_irqs[i].srcbus != m->srcbus) in get_MP_intsrc_index()
663 if (mp_irqs[i].srcbusirq != m->srcbusirq) in get_MP_intsrc_index()
667 return -2; in get_MP_intsrc_index()
674 return -1; in get_MP_intsrc_index()
701 * not found (-1), or duplicated (-2) are invalid entries, in check_irq_src()
713 WARN(1, "update_mptable: No spare slots (length: %x)\n", count); in check_slot()
714 return -1; in check_slot()
735 pr_info("mpc_length %x\n", mpc->length); in replace_intsrc_all()
736 while (count < mpc->length) { in replace_intsrc_all()
775 nr_m_spare--; in replace_intsrc_all()
784 mpc->length = count; in replace_intsrc_all()
791 /* update checksum */ in replace_intsrc_all()
792 mpc->checksum = 0; in replace_intsrc_all()
793 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length); in replace_intsrc_all()
858 if (mpf->feature1) in update_mp_table()
861 if (!mpf->physptr) in update_mp_table()
864 size = get_mpc_size(mpf->physptr); in update_mp_table()
865 mpc = early_memremap(mpf->physptr, size); in update_mp_table()
875 pr_info("physptr: %x\n", mpf->physptr); in update_mp_table()
877 if (mpc_new_phys && mpc->length > mpc_new_length) { in update_mp_table()
886 mpc->checksum = 0; in update_mp_table()
887 old = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
888 mpc->checksum = 0xff; in update_mp_table()
889 new = mpf_checksum((unsigned char *)mpc, mpc->length); in update_mp_table()
894 pr_info("use in-position replacing\n"); in update_mp_table()
901 mpf->physptr = mpc_new_phys; in update_mp_table()
902 memcpy(mpc_new, mpc, mpc->length); in update_mp_table()
907 if (mpc_new_phys - mpf->physptr) { in update_mp_table()
910 mpf_new = early_memremap(0x400 - 16, sizeof(*mpf_new)); in update_mp_table()
915 pr_info("mpf new: %x\n", 0x400 - 16); in update_mp_table()
919 mpf->physptr = mpc_new_phys; in update_mp_table()
921 mpf->checksum = 0; in update_mp_table()
922 mpf->checksum -= mpf_checksum((unsigned char *)mpf, 16); in update_mp_table()
923 pr_info("physptr new: %x\n", mpf->physptr); in update_mp_table()