Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150050
b: refs/heads/master
c: 1d58ea3
h: refs/heads/master
v: v3
  • Loading branch information
Kumar Gala authored and David S. Miller committed Apr 28, 2009
1 parent b437f5e commit 1aee7d4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc59fcda671ee15362986a902bbd90e218fe84c4
refs/heads/master: 1d58ea30b141c95bd21fb39021d4b602f48b30be
39 changes: 1 addition & 38 deletions trunk/drivers/net/fs_enet/fs_enet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,30 +941,6 @@ extern void fs_mii_disconnect(struct net_device *dev);

/**************************************************************************************/

/* handy pointer to the immap */
void __iomem *fs_enet_immap = NULL;

static int setup_immap(void)
{
#ifdef CONFIG_CPM1
fs_enet_immap = ioremap(IMAP_ADDR, 0x4000);
WARN_ON(!fs_enet_immap);
#elif defined(CONFIG_CPM2)
fs_enet_immap = cpm2_immr;
#endif

return 0;
}

static void cleanup_immap(void)
{
#if defined(CONFIG_CPM1)
iounmap(fs_enet_immap);
#endif
}

/**************************************************************************************/

#ifdef CONFIG_FS_ENET_HAS_FEC
#define IS_FEC(match) ((match)->data == &fs_fec_ops)
#else
Expand Down Expand Up @@ -1144,25 +1120,12 @@ static struct of_platform_driver fs_enet_driver = {

static int __init fs_init(void)
{
int r = setup_immap();
if (r != 0)
return r;

r = of_register_platform_driver(&fs_enet_driver);
if (r != 0)
goto out;

return 0;

out:
cleanup_immap();
return r;
return of_register_platform_driver(&fs_enet_driver);
}

static void __exit fs_cleanup(void)
{
of_unregister_platform_driver(&fs_enet_driver);
cleanup_immap();
}

#ifdef CONFIG_NET_POLL_CONTROLLER
Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/net/fs_enet/fs_enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,4 @@ extern const struct fs_ops fs_scc_ops;

/*******************************************************************/

/* handy pointer to the immap */
extern void __iomem *fs_enet_immap;

/*******************************************************************/

#endif
34 changes: 0 additions & 34 deletions trunk/drivers/net/fs_enet/mac-fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,6 @@ static void set_multicast_list(struct net_device *dev)

static void restart(struct net_device *dev)
{
#ifdef CONFIG_DUET
immap_t *immap = fs_enet_immap;
u32 cptr;
#endif
struct fs_enet_private *fep = netdev_priv(dev);
fec_t __iomem *fecp = fep->fec.fecp;
const struct fs_platform_info *fpi = fep->fpi;
Expand Down Expand Up @@ -315,36 +311,6 @@ static void restart(struct net_device *dev)
FW(fecp, ievent, 0xffc0);
FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29);

/*
* adjust to speed (only for DUET & RMII)
*/
#ifdef CONFIG_DUET
if (fpi->use_rmii) {
cptr = in_be32(&immap->im_cpm.cp_cptr);
switch (fs_get_fec_index(fpi->fs_no)) {
case 0:
cptr |= 0x100;
if (fep->speed == 10)
cptr |= 0x0000010;
else if (fep->speed == 100)
cptr &= ~0x0000010;
break;
case 1:
cptr |= 0x80;
if (fep->speed == 10)
cptr |= 0x0000008;
else if (fep->speed == 100)
cptr &= ~0x0000008;
break;
default:
BUG(); /* should never happen */
break;
}
out_be32(&immap->im_cpm.cp_cptr, cptr);
}
#endif


FW(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
/*
* adjust to duplex mode
Expand Down

0 comments on commit 1aee7d4

Please sign in to comment.