This is a discussion on partial patch for mps 1.1 Default Configuration SMP systems within the mailing.openbsd.tech forums, part of the OpenBSD category; --> Hello, A few days ago I have been able to get my hands on an old dual P5-100 system. ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, A few days ago I have been able to get my hands on an old dual P5-100 system. I have tried the snapshots + current generic.mp but all paniced with 'lazy bum'. It turns out the developer who wrote that code simply did not implement the 'Default Configuration' part of the MPS specification. After looking around in netbsd ( same situation as openbsd ), freebsd and linux I have decided to try to get this supported. Currently this patch sets up the bus structures and also sets the ioapic routing. Although interrupts do not seem to be ok ( scsi controller dies with resets ) Probably the local apics have to be setup ? This is my first try at doing SMP code so please do not hit me too hard with your cluesticks. Comments welcome, Index: mpbios.c ================================================== ================= RCS file: /data/cvs/src/sys/arch/i386/i386/mpbios.c,v retrieving revision 1.3 diff -u -r1.3 mpbios.c --- mpbios.c 23 Jun 2004 17:14:31 -0000 1.3 +++ mpbios.c 25 Jun 2004 10:54:33 -0000 @@ -537,6 +537,9 @@ /* check for use of 'default' configuration */ if (mp_fps->mpfb1 != 0) { struct mpbios_proc pe; + struct mpbios_bus bus; + struct mpbios_int mpi; + int i; printf("\n%s: MP default configuration %d\n", self->dv_xname, mp_fps->mpfb1); @@ -556,10 +559,79 @@ mpbios_ioapic((u_int8_t *)&default_ioapic, self); + /* not nice, but with MPS default configuration I do not + expect to see more than 2 busses + */ + mp_busses = malloc(sizeof(struct mp_bus) * 2, + M_DEVBUF, M_NOWAIT); + + mp_nbus = 1; /* start with only one bus */ + bus.type = 1; /* MP_BUS mpsec_def.h */ + bus.bus_id = 0; + + switch (mp_fps->mpfb1) { + + default: printf("%s: WARNING Unknown standard configuration %d\n", mp_fps->mpfb1); + case 1: + case 5: + memcpy(bus.bus_type, "ISA ",6); + break; + case 2: + case 6: + case 3: + memcpy(bus.bus_type, "EISA ", 6); + break; + case 4: + case 7: + memcpy(bus.bus_type, "EISA ", 6); + } + mp_nbus = 1; + bus.type = 1; + bus.bus_id = 0; + mpbios_bus((u_int8_t *)&bus, self); + + if (mp_fps->mpfb1 > 4) { + mp_nbus++; + bus.bus_id = 1; + memcpy(bus.bus_type, "PCI ", 6); + mpbios_bus((u_int8_t *)&bus, self); + }; + + /* let see if we can setup the interrupts for case 6 */ + + mp_intrs = malloc(sizeof(struct mp_intr_map) * 17, + M_DEVBUF, M_NOWAIT); + + + mpi.type = MPS_MCT_IOINT; /*MP_INTSRC; */ + mpi.int_flags = 0; + mpi.src_bus_id = 0; + mpi.int_type = MPS_INTTYPE_INT; /* mp_INT */ + /*mpi.dst_apic_id = mp_ioapics[0].mpc_acpid; */ + mpi.dst_apic_id = MPS_ALL_APICS; // ??? + + // note that config 5 will probably fail + for ( i = 0; i<16;i++) { + switch (mp_fps->mpfb1) { + case 2: + if (i== 0 || i ==13) + continue; /* IRQ0 & IRQ13 not connected */ + default: + if (i ==2) + continue; /* IRQ2 is never conntected */ + } + mpi.src_bus_irq = i; + mpi.dst_apic_int = i ? i : 2; + mpbios_int((u_int8_t *)&mpi , MPS_MCT_IOINT, &mp_intrs[i]); + } + mpi.int_type = MPS_INTTYPE_ExtINT; /* mp_ExtInt */ + mpi.src_bus_irq = 0; + mpi.dst_apic_int = 0; + mpbios_int((u_int8_t *)&mpi , MPS_MCT_IOINT, &mp_intrs[i]); // not good /* XXX */ printf("%s: WARNING: interrupts not configured\n", self->dv_xname); - panic("lazy bum"); + //panic("lazy bum"); return; } else { /* @@ -959,6 +1031,7 @@ self->dv_xname); else mp_eisa_bus = bus_id; + } else if (memcmp(entry->bus_type, "ISA ", 6) == 0) { mp_busses[bus_id].mb_name = "isa"; mp_busses[bus_id].mb_idx = 0; /* XXX */ @@ -1106,3 +1179,4 @@ printf(" (type 0x%x flags 0x%x)\n", type, flags); } } + -- | Mvg Gerard Gerritsen, | | Your eyes are weary from staring at the CRT. You feel sleepy. Notice how | restful it is to watch the cursor blink. Close your eyes. The opinions | stated above are yours. You cannot imagine why you ever felt otherwise. |