projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.denx.de/u-boot-fdt
[oweals/u-boot.git]
/
cpu
/
mpc85xx
/
ether_fcc.c
diff --git
a/cpu/mpc85xx/ether_fcc.c
b/cpu/mpc85xx/ether_fcc.c
index ec3990cb8d82508719270d8acda8460796cad1f4..bd62aab9f34b9567c43b65e986bc4d1339b09c4a 100644
(file)
--- a/
cpu/mpc85xx/ether_fcc.c
+++ b/
cpu/mpc85xx/ether_fcc.c
@@
-48,13
+48,13
@@
#include <config.h>
#include <net.h>
#include <config.h>
#include <net.h>
-#if defined(CONFIG_MII) ||
(CONFIG_COMMANDS & CFG_CMD_MII) ||
defined(CONFIG_CMD_MII)
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
#include <miiphy.h>
#endif
#if defined(CONFIG_CPM2)
#include <miiphy.h>
#endif
#if defined(CONFIG_CPM2)
-#if defined(CONFIG_ETHER_ON_FCC) &&
((CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)
) && \
+#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
@@
-230,8
+230,8
@@
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 *)CFG_IMM
R;
- volatile ccsr_cpm_cp_t *cp = &(
immr->im_cpm.
im_cpm_cp);
+ volatile
ccsr_cpm_t *cpm = (ccsr_cpm_t *)CFG_MPC85xx_CPM_ADD
R;
+ volatile ccsr_cpm_cp_t *cp = &(
cpm->
im_cpm_cp);
fcc_enet_t *pram_ptr;
unsigned long mem_addr;
fcc_enet_t *pram_ptr;
unsigned long mem_addr;
@@
-242,35
+242,35
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
/* 28.9 - (1-2): ioports have been set up already */
/* 28.9 - (3): connect FCC's tx and rx clocks */
/* 28.9 - (1-2): ioports have been set up already */
/* 28.9 - (3): connect FCC's tx and rx clocks */
-
immr->im_cpm.
im_cpm_mux.cmxuar = 0; /* ATM */
-
immr->im_cpm.im_cpm_mux.cmxfcr = (immr->im_cpm.
im_cpm_mux.cmxfcr & ~info->cmxfcr_mask) |
+
cpm->
im_cpm_mux.cmxuar = 0; /* ATM */
+
cpm->im_cpm_mux.cmxfcr = (cpm->
im_cpm_mux.cmxfcr & ~info->cmxfcr_mask) |
info->cmxfcr_value;
/* 28.9 - (4): GFMR: disable tx/rx, CCITT CRC, set Mode Ethernet */
if(info->ether_index == 0) {
info->cmxfcr_value;
/* 28.9 - (4): GFMR: disable tx/rx, CCITT CRC, set Mode Ethernet */
if(info->ether_index == 0) {
-
immr->im_cpm.
im_cpm_fcc1.gfmr = FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
+
cpm->
im_cpm_fcc1.gfmr = FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
} else if (info->ether_index == 1) {
} else if (info->ether_index == 1) {
-
immr->im_cpm.
im_cpm_fcc2.gfmr = FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
+
cpm->
im_cpm_fcc2.gfmr = FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
} else if (info->ether_index == 2) {
} else if (info->ether_index == 2) {
-
immr->im_cpm.
im_cpm_fcc3.gfmr = FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
+
cpm->
im_cpm_fcc3.gfmr = FCC_GFMR_MODE_ENET | FCC_GFMR_TCRC_32;
}
/* 28.9 - (5): FPSMR: enable full duplex, select CCITT CRC for Ethernet,MII */
if(info->ether_index == 0) {
}
/* 28.9 - (5): FPSMR: enable full duplex, select CCITT CRC for Ethernet,MII */
if(info->ether_index == 0) {
-
immr->im_cpm.
im_cpm_fcc1.fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC;
+
cpm->
im_cpm_fcc1.fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC;
} else if (info->ether_index == 1){
} else if (info->ether_index == 1){
-
immr->im_cpm.
im_cpm_fcc2.fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC;
+
cpm->
im_cpm_fcc2.fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC;
} else if (info->ether_index == 2){
} else if (info->ether_index == 2){
-
immr->im_cpm.
im_cpm_fcc3.fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC;
+
cpm->
im_cpm_fcc3.fpsmr = CFG_FCC_PSMR | FCC_PSMR_ENCRC;
}
/* 28.9 - (6): FDSR: Ethernet Syn */
if(info->ether_index == 0) {
}
/* 28.9 - (6): FDSR: Ethernet Syn */
if(info->ether_index == 0) {
-
immr->im_cpm.
im_cpm_fcc1.fdsr = 0xD555;
+
cpm->
im_cpm_fcc1.fdsr = 0xD555;
} else if (info->ether_index == 1) {
} else if (info->ether_index == 1) {
-
immr->im_cpm.
im_cpm_fcc2.fdsr = 0xD555;
+
cpm->
im_cpm_fcc2.fdsr = 0xD555;
} else if (info->ether_index == 2) {
} else if (info->ether_index == 2) {
-
immr->im_cpm.
im_cpm_fcc3.fdsr = 0xD555;
+
cpm->
im_cpm_fcc3.fdsr = 0xD555;
}
/* reset indeces to current rx/tx bd (see eth_send()/eth_rx()) */
}
/* reset indeces to current rx/tx bd (see eth_send()/eth_rx()) */
@@
-296,7
+296,7
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
rtx.txbd[TX_BUF_CNT - 1].cbd_sc |= BD_ENET_TX_WRAP;
/* 28.9 - (7): initialize parameter ram */
rtx.txbd[TX_BUF_CNT - 1].cbd_sc |= BD_ENET_TX_WRAP;
/* 28.9 - (7): initialize parameter ram */
- pram_ptr = (fcc_enet_t *)&(
immr->im_cpm.
im_dprambase[info->proff_enet]);
+ pram_ptr = (fcc_enet_t *)&(
cpm->
im_dprambase[info->proff_enet]);
/* clear whole structure to make sure all reserved fields are zero */
memset((void*)pram_ptr, 0, sizeof(fcc_enet_t));
/* clear whole structure to make sure all reserved fields are zero */
memset((void*)pram_ptr, 0, sizeof(fcc_enet_t));
@@
-385,14
+385,14
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
/* 28.9 - (8)(9): clear out events in FCCE */
/* 28.9 - (9): FCCM: mask all events */
if(info->ether_index == 0) {
/* 28.9 - (8)(9): clear out events in FCCE */
/* 28.9 - (9): FCCM: mask all events */
if(info->ether_index == 0) {
-
immr->im_cpm.
im_cpm_fcc1.fcce = ~0x0;
-
immr->im_cpm.
im_cpm_fcc1.fccm = 0;
+
cpm->
im_cpm_fcc1.fcce = ~0x0;
+
cpm->
im_cpm_fcc1.fccm = 0;
} else if (info->ether_index == 1) {
} else if (info->ether_index == 1) {
-
immr->im_cpm.
im_cpm_fcc2.fcce = ~0x0;
-
immr->im_cpm.
im_cpm_fcc2.fccm = 0;
+
cpm->
im_cpm_fcc2.fcce = ~0x0;
+
cpm->
im_cpm_fcc2.fccm = 0;
} else if (info->ether_index == 2) {
} else if (info->ether_index == 2) {
-
immr->im_cpm.
im_cpm_fcc3.fcce = ~0x0;
-
immr->im_cpm.
im_cpm_fcc3.fccm = 0;
+
cpm->
im_cpm_fcc3.fcce = ~0x0;
+
cpm->
im_cpm_fcc3.fccm = 0;
}
/* 28.9 - (10-12): we don't use ethernet interrupts */
}
/* 28.9 - (10-12): we don't use ethernet interrupts */
@@
-413,11
+413,11
@@
static int fec_init(struct eth_device* dev, bd_t *bis)
/* 28.9 - (14): enable tx/rx in gfmr */
if(info->ether_index == 0) {
/* 28.9 - (14): enable tx/rx in gfmr */
if(info->ether_index == 0) {
-
immr->im_cpm.
im_cpm_fcc1.gfmr |= FCC_GFMR_ENT | FCC_GFMR_ENR;
+
cpm->
im_cpm_fcc1.gfmr |= FCC_GFMR_ENT | FCC_GFMR_ENR;
} else if (info->ether_index == 1) {
} else if (info->ether_index == 1) {
-
immr->im_cpm.
im_cpm_fcc2.gfmr |= FCC_GFMR_ENT | FCC_GFMR_ENR;
+
cpm->
im_cpm_fcc2.gfmr |= FCC_GFMR_ENT | FCC_GFMR_ENR;
} else if (info->ether_index == 2) {
} else if (info->ether_index == 2) {
-
immr->im_cpm.
im_cpm_fcc3.gfmr |= FCC_GFMR_ENT | FCC_GFMR_ENR;
+
cpm->
im_cpm_fcc3.gfmr |= FCC_GFMR_ENT | FCC_GFMR_ENR;
}
return 1;
}
return 1;
@@
-426,15
+426,15
@@
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 *)CFG_IMM
R;
+ volatile
ccsr_cpm_t *cpm = (ccsr_cpm_t *)CFG_MPC85xx_CPM_ADD
R;
/* write GFMR: disable tx/rx */
if(info->ether_index == 0) {
/* write GFMR: disable tx/rx */
if(info->ether_index == 0) {
-
immr->im_cpm.
im_cpm_fcc1.gfmr &= ~(FCC_GFMR_ENT | FCC_GFMR_ENR);
+
cpm->
im_cpm_fcc1.gfmr &= ~(FCC_GFMR_ENT | FCC_GFMR_ENR);
} else if(info->ether_index == 1) {
} else if(info->ether_index == 1) {
-
immr->im_cpm.
im_cpm_fcc2.gfmr &= ~(FCC_GFMR_ENT | FCC_GFMR_ENR);
+
cpm->
im_cpm_fcc2.gfmr &= ~(FCC_GFMR_ENT | FCC_GFMR_ENR);
} else if(info->ether_index == 2) {
} else if(info->ether_index == 2) {
-
immr->im_cpm.
im_cpm_fcc3.gfmr &= ~(FCC_GFMR_ENT | FCC_GFMR_ENR);
+
cpm->
im_cpm_fcc3.gfmr &= ~(FCC_GFMR_ENT | FCC_GFMR_ENR);
}
}
}
}
@@
-458,7
+458,7
@@
int fec_initialize(bd_t *bis)
eth_register(dev);
eth_register(dev);
-#if (defined(CONFIG_MII) ||
(CONFIG_COMMANDS & CFG_CMD_MII) ||
defined(CONFIG_CMD_MII)) \
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) \
&& defined(CONFIG_BITBANGMII)
miiphy_register(dev->name,
bb_miiphy_read, bb_miiphy_write);
&& defined(CONFIG_BITBANGMII)
miiphy_register(dev->name,
bb_miiphy_read, bb_miiphy_write);
@@
-468,6
+468,6
@@
int fec_initialize(bd_t *bis)
return 1;
}
return 1;
}
-#endif
/* CONFIG_ETHER_ON_FCC && CFG_CMD_NET && CONFIG_NET_MULTI */
+#endif
#endif /* CONFIG_CPM2 */
#endif /* CONFIG_CPM2 */