projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
at91: Add CAN init function
[oweals/u-boot.git]
/
cpu
/
mpc8260
/
ether_fcc.c
diff --git
a/cpu/mpc8260/ether_fcc.c
b/cpu/mpc8260/ether_fcc.c
index 0393afabc2792d208bf6bfd09a2c110bcca787af..5ac02a09c025b5132bd44dd4ea7c180e0371abea 100644
(file)
--- a/
cpu/mpc8260/ether_fcc.c
+++ b/
cpu/mpc8260/ether_fcc.c
@@
-47,7
+47,13
@@
#include <config.h>
#include <net.h>
#include <config.h>
#include <net.h>
-#if defined(CONFIG_ETHER_ON_FCC) && (CONFIG_COMMANDS & CFG_CMD_NET) && \
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+#include <miiphy.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
defined(CONFIG_NET_MULTI)
static struct ether_fcc_info_s
defined(CONFIG_NET_MULTI)
static struct ether_fcc_info_s
@@
-67,8
+73,8
@@
static struct ether_fcc_info_s
PROFF_FCC1,
CPM_CR_FCC1_SBLOCK,
CPM_CR_FCC1_PAGE,
PROFF_FCC1,
CPM_CR_FCC1_SBLOCK,
CPM_CR_FCC1_PAGE,
- C
FG
_CMXFCR_MASK1,
- C
FG
_CMXFCR_VALUE1
+ C
ONFIG_SYS
_CMXFCR_MASK1,
+ C
ONFIG_SYS
_CMXFCR_VALUE1
},
#endif
},
#endif
@@
-78,8
+84,8
@@
static struct ether_fcc_info_s
PROFF_FCC2,
CPM_CR_FCC2_SBLOCK,
CPM_CR_FCC2_PAGE,
PROFF_FCC2,
CPM_CR_FCC2_SBLOCK,
CPM_CR_FCC2_PAGE,
- C
FG
_CMXFCR_MASK2,
- C
FG
_CMXFCR_VALUE2
+ C
ONFIG_SYS
_CMXFCR_MASK2,
+ C
ONFIG_SYS
_CMXFCR_VALUE2
},
#endif
},
#endif
@@
-89,8
+95,8
@@
static struct ether_fcc_info_s
PROFF_FCC3,
CPM_CR_FCC3_SBLOCK,
CPM_CR_FCC3_PAGE,
PROFF_FCC3,
CPM_CR_FCC3_SBLOCK,
CPM_CR_FCC3_PAGE,
- C
FG
_CMXFCR_MASK3,
- C
FG
_CMXFCR_VALUE3
+ C
ONFIG_SYS
_CMXFCR_MASK3,
+ C
ONFIG_SYS
_CMXFCR_VALUE3
},
#endif
};
},
#endif
};
@@
-219,7
+225,7
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
{
struct ether_fcc_info_s * info = dev->priv;
int i;
{
struct ether_fcc_info_s * info = dev->priv;
int i;
- volatile immap_t *immr = (immap_t *)C
FG
_IMMR;
+ volatile immap_t *immr = (immap_t *)C
ONFIG_SYS
_IMMR;
volatile cpm8260_t *cp = &(immr->im_cpm);
fcc_enet_t *pram_ptr;
unsigned long mem_addr;
volatile cpm8260_t *cp = &(immr->im_cpm);
fcc_enet_t *pram_ptr;
unsigned long mem_addr;
@@
-240,7
+246,7
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
/* 28.9 - (5): FPSMR: enable full duplex, select CCITT CRC for Ethernet */
FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
/* 28.9 - (5): FPSMR: enable full duplex, select CCITT CRC for Ethernet */
- immr->im_fcc[info->ether_index].fcc_fpsmr = C
FG
_FCC_PSMR | FCC_PSMR_ENCRC;
+ immr->im_fcc[info->ether_index].fcc_fpsmr = C
ONFIG_SYS
_FCC_PSMR | FCC_PSMR_ENCRC;
/* 28.9 - (6): FDSR: Ethernet Syn */
immr->im_fcc[info->ether_index].fcc_fdsr = 0xD555;
/* 28.9 - (6): FDSR: Ethernet Syn */
immr->im_fcc[info->ether_index].fcc_fdsr = 0xD555;
@@
-290,10
+296,10
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
*/
pram_ptr->fen_genfcc.fcc_mrblr = PKT_MAXBLR_SIZE;
pram_ptr->fen_genfcc.fcc_rstate = (CPMFCR_GBL | CPMFCR_EB |
*/
pram_ptr->fen_genfcc.fcc_mrblr = PKT_MAXBLR_SIZE;
pram_ptr->fen_genfcc.fcc_rstate = (CPMFCR_GBL | CPMFCR_EB |
- C
FG
_CPMFCR_RAMTYPE) << 24;
+ C
ONFIG_SYS
_CPMFCR_RAMTYPE) << 24;
pram_ptr->fen_genfcc.fcc_rbase = (unsigned int)(&rtx.rxbd[rxIdx]);
pram_ptr->fen_genfcc.fcc_tstate = (CPMFCR_GBL | CPMFCR_EB |
pram_ptr->fen_genfcc.fcc_rbase = (unsigned int)(&rtx.rxbd[rxIdx]);
pram_ptr->fen_genfcc.fcc_tstate = (CPMFCR_GBL | CPMFCR_EB |
- C
FG
_CPMFCR_RAMTYPE) << 24;
+ C
ONFIG_SYS
_CPMFCR_RAMTYPE) << 24;
pram_ptr->fen_genfcc.fcc_tbase = (unsigned int)(&rtx.txbd[txIdx]);
/* protocol-specific area */
pram_ptr->fen_genfcc.fcc_tbase = (unsigned int)(&rtx.txbd[txIdx]);
/* protocol-specific area */
@@
-360,7
+366,7
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
static void fec_halt(struct eth_device* dev)
{
struct ether_fcc_info_s * info = dev->priv;
static void fec_halt(struct eth_device* dev)
{
struct ether_fcc_info_s * info = dev->priv;
- volatile immap_t *immr = (immap_t *)C
FG
_IMMR;
+ volatile immap_t *immr = (immap_t *)C
ONFIG_SYS
_IMMR;
/* write GFMR: disable tx/rx */
immr->im_fcc[info->ether_index].fcc_gfmr &=
/* write GFMR: disable tx/rx */
immr->im_fcc[info->ether_index].fcc_gfmr &=
@@
-386,6
+392,12
@@
int fec_initialize(bd_t *bis)
dev->recv = fec_recv;
eth_register(dev);
dev->recv = fec_recv;
eth_register(dev);
+
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) \
+ && defined(CONFIG_BITBANGMII)
+ miiphy_register(dev->name,
+ bb_miiphy_read, bb_miiphy_write);
+#endif
}
return 1;
}
return 1;
@@
-634,9
+646,7
@@
swap16 (unsigned short x)
void
eth_loopback_test (void)
{
void
eth_loopback_test (void)
{
- DECLARE_GLOBAL_DATA_PTR;
-
- volatile immap_t *immr = (immap_t *)CFG_IMMR;
+ volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
volatile cpm8260_t *cp = &(immr->im_cpm);
int c, nclosed;
ulong runtime, nmsec;
volatile cpm8260_t *cp = &(immr->im_cpm);
int c, nclosed;
ulong runtime, nmsec;
@@
-644,7
+654,7
@@
eth_loopback_test (void)
puts ("FCC Ethernet External loopback test\n");
puts ("FCC Ethernet External loopback test\n");
-
memcpy (NetOurEther, gd->bd->bi_enetaddr, 6
);
+
eth_getenv_enetaddr("ethaddr", NetOurEther
);
/*
* global initialisations for all FCC channels
/*
* global initialisations for all FCC channels
@@
-831,7
+841,7
@@
eth_loopback_test (void)
* So, far we have only been given one Ethernet address. We use
* the same address for all channels
*/
* So, far we have only been given one Ethernet address. We use
* the same address for all channels
*/
-#define ea
gd->bd->bi_enetadd
r
+#define ea
NetOurEthe
r
fpp->fen_paddrh = (ea[5] << 8) + ea[4];
fpp->fen_paddrm = (ea[3] << 8) + ea[2];
fpp->fen_paddrl = (ea[1] << 8) + ea[0];
fpp->fen_paddrh = (ea[5] << 8) + ea[4];
fpp->fen_paddrm = (ea[3] << 8) + ea[2];
fpp->fen_paddrl = (ea[1] << 8) + ea[0];
@@
-1177,4
+1187,4
@@
eth_loopback_test (void)
#endif /* CONFIG_ETHER_LOOPBACK_TEST */
#endif /* CONFIG_ETHER_LOOPBACK_TEST */
-#endif
/* CONFIG_ETHER_ON_FCC && CFG_CMD_NET && CONFIG_NET_MULTI */
+#endif