Date: Sun, 12 Dec 1999 20:11:45 +0900 From: NOKUBI Hirotaka <hnokubi@yyy.or.jp> To: freebsd-smp@freebsd.org Subject: IRQ and APIC pin mapping question Message-ID: <19991212111015.2B2CF150CD@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Hello. I've been trying SMP kernel on NEC PC9821RvII which is not PC-AT compatible, FreeBSD PC98 port works fine on it with UP kernel. I made it possible to access MPCT at the top of the physical memory, SMP kernel works fine on it. But there is a problem around interrupt. Would you advice me about that? Almost all MPCT I've seen has same source IRQ# and destination APIC PIN#, like IRQ4 is connected to APIC PIN4. But PC9821RvII's MPCT shows some IRQ# is connected to different APIC PIN#, like IRQ8 is connected to APIC PIN7 (please see mptable output). My question is the meaning of int_to_apicintpin[]. Interrupt is managed with IRQ#, so it needs to know that which IRQ# corresponds to which APIC PIN#. Although I think that is the reason int_to_apicintpin[] is provided, initialization of it confused me. Function setup_apic_irq_mapping() initialize int_to_apicintpin[] using assign_apic_irq() with same value as argument `intpin' and `irq' (please see patch). It works fine on the machine which has same IRQ# and APIC PIN#. But on my PC9821RvII, it is impossible for kernel to get correct APIC PIN# corresponds to IRQ# to handle. For example, kernel wants to disable IRQ10, APIC PIN9 should be disabled, but without patch, kernel disables APIC PIN10. How can I fix this problem without affecting PC-AT compatible? ---- NOKUBI Hirotaka Fingerprint20 = DEBC 0793 7CD6 92F1 0A1F A792 9E2F EEEE A41B 171D =============================================================================== MPTable, version 2.0.15 ------------------------------------------------------------------------------- MP Floating Pointer Structure: location: BIOS physical address: 0x000f50f0 signature: '_MP_' length: 16 bytes version: 1.4 checksum: 0xa1 mode: Virtual Wire ------------------------------------------------------------------------------- MP Config Table Header: physical address: 0x05fff704 signature: 'PCMP' base table length: 252 version: 1.4 checksum: 0x47 OEM ID: 'NEC ' Product ID: 'T63M0.06 ' OEM table pointer: 0x00000000 OEM table size: 0 entry count: 23 local APIC address: 0xfee00000 extended table length: 0 extended table checksum: 0 ------------------------------------------------------------------------------- MP Config Base Table Entries: -- Processors: APIC ID Version State Family Model Step Flags 0 0x11 BSP, usable 6 3 3 0x0381 1 0x11 AP, usable 6 3 4 0x0381 -- Bus: Bus ID Type 0 NEC98 1 PCI -- I/O APICs: APIC ID Version State Address 2 0x11 usable 0xfec00000 -- I/O Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN# INT active-hi edge 0 0 2 0 INT active-hi edge 0 1 2 1 INT active-hi edge 0 2 2 2 INT active-hi level 0 3 2 3 INT active-hi edge 0 4 2 4 INT active-hi edge 0 5 2 5 INT active-hi edge 0 6 2 6 INT active-hi edge 0 8 2 7 INT active-hi edge 0 9 2 8 INT active-hi level 0 10 2 9 INT active-hi edge 0 11 2 10 INT active-hi edge 0 12 2 11 INT active-hi edge 0 13 2 12 INT active-hi edge 0 14 2 13 INT active-hi edge 0 15 2 14 ExtINT active-hi edge 0 0 2 15 -- Local Ints: Type Polarity Trigger Bus ID IRQ APIC ID PIN# ExtINT active-hi edge 0 0 0 0 NMI active-hi edge 0 1 0 1 ------------------------------------------------------------------------------- # SMP kernel config file options: # Required: options SMP # Symmetric MultiProcessor Kernel options APIC_IO # Symmetric (APIC) I/O # Optional (built-in defaults will work in most cases): #options NCPU=2 # number of CPUs #options NBUS=2 # number of busses #options NAPIC=1 # number of IO APICs #options NINTR=24 # number of INTs =============================================================================== Index: i386/i386/mp_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/mp_machdep.c,v retrieving revision 1.111 diff -u -u -r1.111 mp_machdep.c --- mp_machdep.c 1999/10/15 21:38:15 1.111 +++ mp_machdep.c 1999/12/12 10:59:25 @@ -966,7 +966,7 @@ int x; if (int_to_apicintpin[irq].ioapic != -1) - panic("assign_apic_irq: inconsistent table"); + return; int_to_apicintpin[irq].ioapic = apic; int_to_apicintpin[irq].int_pin = intpin; @@ -1070,7 +1070,7 @@ io_apic_ints[x].int_type == 3)) { assign_apic_irq(0, io_apic_ints[x].dst_apic_int, - io_apic_ints[x].dst_apic_int); + io_apic_ints[x].src_bus_irq); } } int_vector = 0; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991212111015.2B2CF150CD>