From: 黄涛 Date: Mon, 7 May 2012 12:15:24 +0000 (+0800) Subject: net: rk29_vmac: support rk30 X-Git-Tag: firefly_0821_release~9243 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bbcdce235949b12514628258c2b5a0985feaa819;p=firefly-linux-kernel-4.4.55.git net: rk29_vmac: support rk30 --- diff --git a/drivers/net/rk29_vmac.c b/drivers/net/rk29_vmac.c index 7cf2285c70ce..95e79e45e274 100755 --- a/drivers/net/rk29_vmac.c +++ b/drivers/net/rk29_vmac.c @@ -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); diff --git a/drivers/net/rk29_vmac.h b/drivers/net/rk29_vmac.h index a1f67c07fb37..25692a0dee8b 100755 --- a/drivers/net/rk29_vmac.h +++ b/drivers/net/rk29_vmac.h @@ -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 */