Changes to support the 64 core boxboro machine
authorKevin Klues <klueska@ros-dev.(none)>
Tue, 20 Apr 2010 19:04:21 +0000 (12:04 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:43 +0000 (17:35 -0700)
This code allows the disabling the mptables via
__CONFIG_DISABLE_MPTABLES__, and the use of the 64 core boxboro machine.

This is ugly. You've been warned.

Makeconfig
kern/arch/i686/e1000.c
kern/arch/i686/init.c
kern/arch/i686/trap.c

index c385a18..032e391 100644 (file)
@@ -20,7 +20,9 @@ CONFIG_DEMAND_PAGING:=             -D__CONFIG_DEMAND_PAGING__
 CONFIG_NOMTRRS:=                   -D__CONFIG_NOMTRRS__
 CONFIG_E1000_MMIO_HACK:=           -D__CONFIG_E1000_MMIO_HACK__
 CONFIG_E1000_ON_S142:=             -D__CONFIG_E1000_ON_S142__
-CONFIG_E1000_ON_BOXBORO:=          -D__CONFIG_E1000_ON_BOXBORO__
+CONFIG_E1000_ON_BOXBORO:=          -DE1000_MMIO_ADDR=0x9eb20000
+CONFIG_E1000_ON_S142:=             -DE1000_MMIO_ADDR=0xfbee000
+CONFIG_DISABLE_MPTABLES:=          -D__CONFIG_DISABLE_MPTABLES__
 
 # Userspace configuration parameters
 # By default, each of these options will be turned off
index f48d302..6c491a1 100644 (file)
@@ -208,7 +208,6 @@ int e1000_scan_pci() {
                                                        // write all 1's denotes the size
                                                        outl(PCI_CONFIG_DATA, 0xFFFFFFFF);
                                                        result = inl(PCI_CONFIG_DATA);
-                                                       printk("Result of writing all 1's: %x\n", result);
                                                        result = result & PCI_MEM_MASK;
                                                        result = (result ^ 0xFFFFFFFF) + 1;
                                                        e1000_addr_size = result;
@@ -472,9 +471,7 @@ void e1000_configure() {
         // Set RX Ring Size
         // This is the number of desc's, divided by 8. It starts
         // at bit 7.
-       printk("rdlen: %x\n", e1000_rr32(E1000_RDLEN));
         e1000_wr32(E1000_RDLEN, NUM_RX_DESCRIPTORS * 16);
-       printk("rdlen: %x\n", e1000_rr32(E1000_RDLEN));
         
        e1000_wr32(0x0280C, 0x00);
 
@@ -557,9 +554,14 @@ void e1000_setup_interrupts() {
 
        // Kernel based interrupt stuff
        register_interrupt_handler(interrupt_handlers, KERNEL_IRQ_OFFSET + e1000_irq, e1000_interrupt_handler, 0);
-       
+
+#ifdef __CONFIG_DISABLE_MPTABLES__
+       pic_unmask_irq(e1000_irq);
+       unmask_lapic_lvt(LAPIC_LVT_LINT0);
+       enable_irq();
+#else  
        ioapic_route_irq(e1000_irq, E1000_IRQ_CPU);     
-       
+#endif 
        return;
 }
 
index 15e3230..6601d11 100644 (file)
 
 void arch_init()
 {
-       mptables_parse();
        pci_init();
+#ifndef __CONFIG_DISABLE_MPTABLES__
+       mptables_parse();
        ioapic_init(); // MUST BE AFTER PCI/ISA INIT!
-               
        // TODO: move these back to regular init.  requires fixing the 
        // __CONFIG_NETWORKING__ inits to not need multiple cores running.
+#endif
        // this returns when all other cores are done and ready to receive IPIs
        #ifdef __CONFIG_SINGLE_CORE__
                smp_percpu_init();
index f5275cf..1a5e290 100644 (file)
@@ -284,16 +284,16 @@ irq_handler(trapframe_t *tf)
        // All others are LAPIC (timer, IPIs, perf, non-ExtINT LINTS, etc)
        // For now, only 235-255 are available
        assert(tf->tf_trapno >= 32); // slows us down, but we should never have this
-       
+
+#ifndef __CONFIG_DISABLE_MPTABLES__
        lapic_send_eoi();
-       
-       /*
+#else
        //Old PIC relatd code. Should be gone for good, but leaving it just incase.
        if (tf->tf_trapno < 48)
                pic_send_eoi(tf->tf_trapno - PIC1_OFFSET);
        else
                lapic_send_eoi();
-       */
+#endif
 
 }