diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fs_enet/mac-fcc.c | 10 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-scc.c | 11 | ||||
-rw-r--r-- | drivers/net/ucc_geth.c | 55 |
3 files changed, 53 insertions, 23 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 48f2f3005935..fe3d8a621c33 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) |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index abac7db3819e..8d456e379a86 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -3822,6 +3822,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3822 | int err, ucc_num, max_speed = 0; | 3822 | int err, ucc_num, max_speed = 0; |
3823 | const phandle *ph; | 3823 | const phandle *ph; |
3824 | const unsigned int *prop; | 3824 | const unsigned int *prop; |
3825 | const char *sprop; | ||
3825 | const void *mac_addr; | 3826 | const void *mac_addr; |
3826 | phy_interface_t phy_interface; | 3827 | phy_interface_t phy_interface; |
3827 | static const int enet_to_speed[] = { | 3828 | static const int enet_to_speed[] = { |
@@ -3854,10 +3855,56 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3854 | 3855 | ||
3855 | ug_info->uf_info.ucc_num = ucc_num; | 3856 | ug_info->uf_info.ucc_num = ucc_num; |
3856 | 3857 | ||
3857 | prop = of_get_property(np, "rx-clock", NULL); | 3858 | sprop = of_get_property(np, "rx-clock-name", NULL); |
3858 | ug_info->uf_info.rx_clock = *prop; | 3859 | if (sprop) { |
3859 | prop = of_get_property(np, "tx-clock", NULL); | 3860 | ug_info->uf_info.rx_clock = qe_clock_source(sprop); |
3860 | ug_info->uf_info.tx_clock = *prop; | 3861 | if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) || |
3862 | (ug_info->uf_info.rx_clock > QE_CLK24)) { | ||
3863 | printk(KERN_ERR | ||
3864 | "ucc_geth: invalid rx-clock-name property\n"); | ||
3865 | return -EINVAL; | ||
3866 | } | ||
3867 | } else { | ||
3868 | prop = of_get_property(np, "rx-clock", NULL); | ||
3869 | if (!prop) { | ||
3870 | /* If both rx-clock-name and rx-clock are missing, | ||
3871 | we want to tell people to use rx-clock-name. */ | ||
3872 | printk(KERN_ERR | ||
3873 | "ucc_geth: missing rx-clock-name property\n"); | ||
3874 | return -EINVAL; | ||
3875 | } | ||
3876 | if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) { | ||
3877 | printk(KERN_ERR | ||
3878 | "ucc_geth: invalid rx-clock propperty\n"); | ||
3879 | return -EINVAL; | ||
3880 | } | ||
3881 | ug_info->uf_info.rx_clock = *prop; | ||
3882 | } | ||
3883 | |||
3884 | sprop = of_get_property(np, "tx-clock-name", NULL); | ||
3885 | if (sprop) { | ||
3886 | ug_info->uf_info.tx_clock = qe_clock_source(sprop); | ||
3887 | if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) || | ||
3888 | (ug_info->uf_info.tx_clock > QE_CLK24)) { | ||
3889 | printk(KERN_ERR | ||
3890 | "ucc_geth: invalid tx-clock-name property\n"); | ||
3891 | return -EINVAL; | ||
3892 | } | ||
3893 | } else { | ||
3894 | prop = of_get_property(np, "rx-clock", NULL); | ||
3895 | if (!prop) { | ||
3896 | printk(KERN_ERR | ||
3897 | "ucc_geth: mising tx-clock-name property\n"); | ||
3898 | return -EINVAL; | ||
3899 | } | ||
3900 | if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) { | ||
3901 | printk(KERN_ERR | ||
3902 | "ucc_geth: invalid tx-clock property\n"); | ||
3903 | return -EINVAL; | ||
3904 | } | ||
3905 | ug_info->uf_info.tx_clock = *prop; | ||
3906 | } | ||
3907 | |||
3861 | err = of_address_to_resource(np, 0, &res); | 3908 | err = of_address_to_resource(np, 0, &res); |
3862 | if (err) | 3909 | if (err) |
3863 | return -EINVAL; | 3910 | return -EINVAL; |