net: rk29_vmac: support rk30

This commit is contained in:
黄涛
2012-05-07 20:15:24 +08:00
parent fd8103d56a
commit bbcdce2359
2 changed files with 22 additions and 2 deletions

View File

@@ -1044,8 +1044,16 @@ int vmac_open(struct net_device *dev)
//set rmii ref clock 50MHz
mac_clk = clk_get(NULL, "mac_ref_div");
if (IS_ERR(mac_clk))
mac_clk = NULL;
arm_clk = clk_get(NULL, "arm_pll");
mac_parent = clk_get_parent(mac_clk);
if (IS_ERR(arm_clk))
arm_clk = NULL;
if (mac_clk) {
mac_parent = clk_get_parent(mac_clk);
if (IS_ERR(mac_parent))
mac_parent = NULL;
}
if (arm_clk && mac_parent && (arm_clk == mac_parent))
wake_lock(&idlelock);
@@ -1184,8 +1192,16 @@ int vmac_close(struct net_device *dev)
//clock close
mac_clk = clk_get(NULL, "mac_ref_div");
mac_parent = clk_get_parent(mac_clk);
if (IS_ERR(mac_clk))
mac_clk = NULL;
if (mac_clk) {
mac_parent = clk_get_parent(mac_clk);
if (IS_ERR(mac_parent))
mac_parent = NULL;
}
arm_clk = clk_get(NULL, "arm_pll");
if (IS_ERR(arm_clk))
arm_clk = NULL;
if (arm_clk && mac_parent && (arm_clk == mac_parent))
wake_unlock(&idlelock);

View File

@@ -31,7 +31,11 @@
#define VMAC_VERSION "1.0"
/* Buffer descriptors */
#ifdef CONFIG_ARCH_RK29
#define TX_BDT_LEN 16 /* Number of receive BD's */
#else
#define TX_BDT_LEN 255 /* Number of receive BD's */
#endif
#define RX_BDT_LEN 255 /* Number of transmit BD's */
/* BD poll rate, in 1024 cycles. @100Mhz: x * 1024 cy * 10ns = 1ms */