diff options
author | Jochen Friedrich <jochen@scram.de> | 2007-11-26 12:03:40 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-12-13 23:47:16 -0500 |
commit | 362f9b6fa8c9670cc5496390845021c2865d049b (patch) | |
tree | ea6a97b113aa8382aeddbcfa4faf2524bd2d96dc /drivers/net/fs_enet | |
parent | 721c0c8af1a27941a34af5046aae4a8369c8404c (diff) |
[POWERPC] Move CPM command handling into the cpm drivers
This patch moves the CPM command handling into commproc.c
for CPM1 and cpm2_common.c. This is yet another preparation
to get rid of drivers accessing the CPM via the global cpmp.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Scott Wood <scottwood@freescale.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
Diffstat (limited to 'drivers/net/fs_enet')
-rw-r--r-- | drivers/net/fs_enet/mac-fcc.c | 10 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-scc.c | 11 |
2 files changed, 2 insertions, 19 deletions
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index da4efbca646e..e36321152d50 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -81,16 +81,8 @@ | |||
81 | static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op) | 81 | static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op) |
82 | { | 82 | { |
83 | const struct fs_platform_info *fpi = fep->fpi; | 83 | const struct fs_platform_info *fpi = fep->fpi; |
84 | int i; | ||
85 | |||
86 | W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG); | ||
87 | for (i = 0; i < MAX_CR_CMD_LOOPS; i++) | ||
88 | if ((R32(cpmp, cp_cpcr) & CPM_CR_FLG) == 0) | ||
89 | return 0; | ||
90 | 84 | ||
91 | printk(KERN_ERR "%s(): Not able to issue CPM command\n", | 85 | return cpm_command(fpi->cp_command, op); |
92 | __FUNCTION__); | ||
93 | return 1; | ||
94 | } | 86 | } |
95 | 87 | ||
96 | static int do_pd_setup(struct fs_enet_private *fep) | 88 | static int do_pd_setup(struct fs_enet_private *fep) |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index 03134f47a4eb..5ff856d7590b 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -89,21 +89,12 @@ | |||
89 | * Delay to wait for SCC reset command to complete (in us) | 89 | * Delay to wait for SCC reset command to complete (in us) |
90 | */ | 90 | */ |
91 | #define SCC_RESET_DELAY 50 | 91 | #define SCC_RESET_DELAY 50 |
92 | #define MAX_CR_CMD_LOOPS 10000 | ||
93 | 92 | ||
94 | static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op) | 93 | static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op) |
95 | { | 94 | { |
96 | const struct fs_platform_info *fpi = fep->fpi; | 95 | const struct fs_platform_info *fpi = fep->fpi; |
97 | int i; | ||
98 | |||
99 | W16(cpmp, cp_cpcr, fpi->cp_command | CPM_CR_FLG | (op << 8)); | ||
100 | for (i = 0; i < MAX_CR_CMD_LOOPS; i++) | ||
101 | if ((R16(cpmp, cp_cpcr) & CPM_CR_FLG) == 0) | ||
102 | return 0; | ||
103 | 96 | ||
104 | printk(KERN_ERR "%s(): Not able to issue CPM command\n", | 97 | return cpm_command(fpi->cp_command, op); |
105 | __FUNCTION__); | ||
106 | return 1; | ||
107 | } | 98 | } |
108 | 99 | ||
109 | static int do_pd_setup(struct fs_enet_private *fep) | 100 | static int do_pd_setup(struct fs_enet_private *fep) |