]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
Add a dumpdata() routing that will dump out an area of memory in
authorhydra <hydra>
Wed, 4 Oct 2000 15:06:11 +0000 (15:06 +0000)
committerhydra <hydra>
Wed, 4 Oct 2000 15:06:11 +0000 (15:06 +0000)
hex values along with addresses.
Also, rearrange and correct the setting of BCSR bits for FADS when
initializing the ethernet.

mpc8xx/scc.c

index b29e97749aa2fbb63da70e6b8ce3b37e66245e2b..4125cbcaf7f0023196122818194c72046b82336f 100644 (file)
@@ -73,6 +73,26 @@ typedef volatile struct CommonBufferDescriptor {
 
 static RTXBD *rtx;
 
+void
+dumpdata(void *buf, int nbytes)
+{
+               unsigned int    offset = 0;
+               unsigned char   *cp = buf;
+               int                             i;
+
+               printf("\n");
+               while (nbytes > 0) {
+                       printf("%04x ", offset);
+                       for (i = 0; i < 16; i++) {
+                               if ((nbytes - i) < 0)
+                                       break;
+                               printf(" %02x", *(cp+offset));
+                               offset++;
+                       }
+                       printf("\n");
+                       nbytes -= i;
+               }
+}
 
 int eth_send(volatile void *packet, int length)
 {
@@ -175,6 +195,12 @@ int eth_init(bd_t *bis)
 
     volatile immap_t *immr = (immap_t *)CFG_IMMR;
 
+#if defined(CONFIG_FADS)
+   *((uint *) BCSR4) &= ~(BCSR4_ETHLOOP|BCSR4_MODEM_EN);
+   *((uint *) BCSR4) |= BCSR4_TFPLDL|BCSR4_TPSQEL|BCSR4_DATA_VOICE;
+   *((uint *) BCSR1) &= ~BCSR1_ETHEN;
+#endif
+
     pram_ptr = (scc_enet_t *)&(immr->im_cpm.cp_dparam[PROFF_ENET]);
 
     rxIdx = 0;
@@ -352,11 +378,6 @@ int eth_init(bd_t *bis)
    immr->im_cpm.cp_scc[SCC_ENET].scc_pmsr = (SCC_PMSR_ENCRC | SCC_PMSR_NIB22
                                      /* | SCC_PMSR_BRO | SCC_PMSR_PRO */);
 
-#if defined(CONFIG_FADS)
-   *((uint *) BCSR1) &= ~BCSR1_ETHEN;
-   *((uint *) BCSR4) |= BCSR4_DATA_VOICE;
-#endif
-
     /*
      * Configure Ethernet TENA Signal
      */