From: hydra Date: Wed, 4 Oct 2000 15:06:11 +0000 (+0000) Subject: Add a dumpdata() routing that will dump out an area of memory in X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1dfc8279154d8221fb8fb9ba889ccbadc238f774;p=users%2Frw%2Fppcboot.git Add a dumpdata() routing that will dump out an area of memory in hex values along with addresses. Also, rearrange and correct the setting of BCSR bits for FADS when initializing the ethernet. --- diff --git a/mpc8xx/scc.c b/mpc8xx/scc.c index b29e977..4125cbc 100644 --- a/mpc8xx/scc.c +++ b/mpc8xx/scc.c @@ -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 */