]> git.sur5r.net Git - u-boot/blobdiff - post/cpu/mpc8xx/ether.c
fix compile warning for env tools
[u-boot] / post / cpu / mpc8xx / ether.c
index 2fa5cf4ac991cf7f456977261b0b859208ae03ad..fcbb30067eee6a4a6dd5e5fdf4527477d54f74fc 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include <post.h>
-#if CONFIG_POST & CFG_POST_ETHER
+#if CONFIG_POST & CONFIG_SYS_POST_ETHER
 #if defined(CONFIG_8xx)
 #include <commproc.h>
 #elif defined(CONFIG_MPC8260)
@@ -67,8 +67,6 @@ static int ctlr_list[][2] = { {CTLR_SCC, 1} };
 static int ctlr_list[][2] = { };
 #endif
 
-#define CTRL_LIST_SIZE (sizeof(ctlr_list) / sizeof(ctlr_list[0]))
-
 static struct {
        void (*init) (int index);
        void (*halt) (int index);
@@ -109,18 +107,25 @@ static RTXBD *rtx;
 
 static void scc_init (int scc_index)
 {
-       bd_t *bd = gd->bd;
-
-       static int proff[] =
-                       { PROFF_SCC1, PROFF_SCC2, PROFF_SCC3, PROFF_SCC4 };
-       static unsigned int cpm_cr[] =
-                       { CPM_CR_CH_SCC1, CPM_CR_CH_SCC2, CPM_CR_CH_SCC3,
-CPM_CR_CH_SCC4 };
+       uchar ea[6];
+
+       static int proff[] = {
+                               PROFF_SCC1,
+                               PROFF_SCC2,
+                               PROFF_SCC3,
+                               PROFF_SCC4,
+       };
+       static unsigned int cpm_cr[] = {
+                               CPM_CR_CH_SCC1,
+                               CPM_CR_CH_SCC2,
+                               CPM_CR_CH_SCC3,
+                               CPM_CR_CH_SCC4,
+       };
 
        int i;
        scc_enet_t *pram_ptr;
 
-       volatile immap_t *immr = (immap_t *) CFG_IMMR;
+       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
 
        immr->im_cpm.cp_scc[scc_index].scc_gsmrl &=
                        ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
@@ -143,7 +148,7 @@ CPM_CR_CH_SCC4 };
        rxIdx = 0;
        txIdx = 0;
 
-#ifdef CFG_ALLOC_DPRAM
+#ifdef CONFIG_SYS_ALLOC_DPRAM
        rtx = (RTXBD *) (immr->im_cpm.cp_dpmem +
                                         dpram_alloc_align (sizeof (RTXBD), 8));
 #else
@@ -296,11 +301,10 @@ CPM_CR_CH_SCC4 };
        pram_ptr->sen_gaddr3 = 0x0;     /* Group Address Filter 3 (unused) */
        pram_ptr->sen_gaddr4 = 0x0;     /* Group Address Filter 4 (unused) */
 
-#define ea bd->bi_enetaddr
+       eth_getenv_enetaddr("ethaddr", ea);
        pram_ptr->sen_paddrh = (ea[5] << 8) + ea[4];
        pram_ptr->sen_paddrm = (ea[3] << 8) + ea[2];
        pram_ptr->sen_paddrl = (ea[1] << 8) + ea[0];
-#undef ea
 
        pram_ptr->sen_pper = 0x0;       /* Persistence (unused) */
        pram_ptr->sen_iaddr1 = 0x0;     /* Individual Address Filter 1 (unused) */
@@ -452,7 +456,7 @@ CPM_CR_CH_SCC4 };
 
 static void scc_halt (int scc_index)
 {
-       volatile immap_t *immr = (immap_t *) CFG_IMMR;
+       volatile immap_t *immr = (immap_t *) CONFIG_SYS_IMMR;
 
        immr->im_cpm.cp_scc[scc_index].scc_gsmrl &=
                        ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
@@ -612,7 +616,7 @@ int ether_post_test (int flags)
        ctlr_proc[CTLR_SCC].send = scc_send;
        ctlr_proc[CTLR_SCC].recv = scc_recv;
 
-       for (i = 0; i < CTRL_LIST_SIZE; i++) {
+       for (i = 0; i < ARRAY_SIZE(ctlr_list); i++) {
                if (test_ctlr (ctlr_list[i][0], ctlr_list[i][1]) != 0) {
                        res = -1;
                }
@@ -624,4 +628,4 @@ int ether_post_test (int flags)
        return res;
 }
 
-#endif /* CONFIG_POST & CFG_POST_ETHER */
+#endif /* CONFIG_POST & CONFIG_SYS_POST_ETHER */