added a lot of printk output to ease writing of emulator debug debug
authorDobrica Pavlinusic <dpavlin@brr.lan>
Sun, 14 Oct 2007 21:54:04 +0000 (16:54 -0500)
committerDobrica Pavlinusic <dpavlin@brr.lan>
Sun, 14 Oct 2007 21:54:04 +0000 (16:54 -0500)
arch/ppc/kernel/mpc10x_common.c
arch/ppc/kernel/open_pic.c

index 8d522ce..9c48530 100755 (executable)
@@ -69,7 +69,7 @@ mpc10x_bridge_set_resources(int map, struct pci_controller *hose)
                        break;
                default:
                        printk("mpc10x_bridge_set_resources: "
-                                       "Invalid map specified\n");
+                                       "Invalid map specified: %d\n", map);
                        if (ppc_md.progress)
                                ppc_md.progress("mpc10x:exit1", 0x100);
        }
@@ -105,8 +105,8 @@ mpc10x_bridge_init(struct pci_controller *hose,
                                           MPC10X_MAPB_CNFG_DATA);
                        break;
                default:
-                       printk("mpc10x_bridge_init: %s\n",
-                               "Invalid current map specified");
+                       printk("mpc10x_bridge_init: %s %d\n",
+                               "Invalid current map specified", current_map);
                        if (ppc_md.progress)
                                ppc_md.progress("mpc10x:exit1", 0x100);
                        return -1;
@@ -126,6 +126,8 @@ mpc10x_bridge_init(struct pci_controller *hose,
                case MPC10X_BRIDGE_8245:
                        break;
                default:
+                       printk("mpc10x_bridge_init: %s %x expected %x\n",
+                               "Invalid host bridge", host_bridge, MPC10X_BRIDGE_106);
                        if (ppc_md.progress)
                                ppc_md.progress("mpc10x:exit2", 0x100);
                        return -1;
@@ -294,7 +296,7 @@ mpc10x_bridge_init(struct pci_controller *hose,
        mpc10x_disable_store_gathering(hose);
 #endif
 
-       if (ppc_md.progress) ppc_md.progress("mpc10x:exit", 0x100);
+       if (ppc_md.progress) ppc_md.progress("mpc10x:exitOK", 0x100);
        return 0;
 }
 
index 542f24e..2686b01 100755 (executable)
@@ -179,6 +179,7 @@ u_int openpic_read(volatile u_int *addr)
 #else
        val = in_le32(addr);
 #endif
+       printk("openpic_read( %08x ) = %x\n", addr, val);
        return val;
 }
 
@@ -189,6 +190,7 @@ static inline void openpic_write(volatile u_int *addr, u_int val)
 #else
        out_le32(addr, val);
 #endif
+       printk("openpic_write( %08x, %x )\n", addr, val);
 }
 
 static inline u_int openpic_readfield(volatile u_int *addr, u_int mask)
@@ -201,6 +203,7 @@ inline void openpic_writefield(volatile u_int *addr, u_int mask,
                               u_int field)
 {
        u_int val = openpic_read(addr);
+       printk("openpic_writefield( addr = %x mask = %x field = %x )\n", addr, mask, field);
        openpic_write(addr, (val & ~mask) | (field & mask));
 }
 
@@ -217,6 +220,7 @@ static inline void openpic_setfield(volatile u_int *addr, u_int mask)
 static void openpic_safe_writefield(volatile u_int *addr, u_int mask,
                                    u_int field)
 {
+       printk("openpic_safe_writefield( addr = %x mask = %x field = %x )\n", addr, mask, field );
        openpic_setfield(addr, OPENPIC_MASK);
        while (openpic_read(addr) & OPENPIC_ACTIVITY);
        openpic_writefield(addr, mask | OPENPIC_MASK, field | OPENPIC_MASK);
@@ -333,6 +337,7 @@ void __init openpic_init(int offset)
        if (ppc_md.progress) ppc_md.progress("openpic: enter", 0x122);
 
        t = openpic_read(&OpenPIC->Global.Feature_Reporting0);
+       printk("openpic version: %x\n", t & OPENPIC_FEATURE_VERSION_MASK);
        switch (t & OPENPIC_FEATURE_VERSION_MASK) {
        case 1:
                version = "1.0";
@@ -349,6 +354,7 @@ void __init openpic_init(int offset)
        }
        NumProcessors = ((t & OPENPIC_FEATURE_LAST_PROCESSOR_MASK) >>
                         OPENPIC_FEATURE_LAST_PROCESSOR_SHIFT) + 1;
+       printk("openpic NumProcessors: %x\n", NumProcessors);
 //REX:
 #if 0  
        if (NumSources == 0)
@@ -359,18 +365,23 @@ void __init openpic_init(int offset)
 #endif
 //REX: too :p
 #if 1
-       if (NumSources == 0)
+       if (NumSources == 0) {
+               if ( ppc_md.progress ) ppc_md.progress("openpic: openpic_set_sources(0,122,NULL) global timer frequency
+               ",0x3bb);
                openpic_set_sources(0, 122,
                                    NULL);
+       }
 #endif
        printk("OpenPIC Version %s (%d CPUs and %d IRQ sources) at %p\n",
               version, NumProcessors, NumSources, OpenPIC);
+       if ( ppc_md.progress ) ppc_md.progress("openpic: global timer frequency",0x3bb);
        timerfreq = openpic_read(&OpenPIC->Global.Timer_Frequency);
        if (timerfreq)
                printk("OpenPIC timer frequency is %d.%06d MHz\n",
                       timerfreq / 1000000, timerfreq % 1000000);
 
        open_pic_irq_offset = offset;
+       printk("## timerfreq = %x open_pic_irq_offset = %x\n", timerfreq, open_pic_irq_offset);
 
        /* Initialize timer interrupts */
        if ( ppc_md.progress ) ppc_md.progress("openpic: timer",0x3ba);
@@ -662,6 +673,7 @@ static void __init openpic_inittimer(u_int timer, u_int pri, u_int vec)
        check_arg_timer(timer);
        check_arg_pri(pri);
        check_arg_vec(vec);
+       printk("openpic_inittimer( timer = %x pri = %x vec = %x )\n", timer, pri, vec );
        openpic_safe_writefield(&OpenPIC->Global.Timer[timer].Vector_Priority,
                                OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK,
                                (pri << OPENPIC_PRIORITY_SHIFT) | vec);