[PATCH net 1/2] net: dsa: mt7530: remove redundant MODULE_ALIAS entries

2018-03-26 Thread sean.wang
From: Sean Wang MODULE_ALIAS exports information to allow the module to be auto-loaded at boot for the drivers registered using legacy platform registration. However, currently the driver is always used by DT-only platform, MODULE_ALIAS is redundant and should be removed

[PATCH net 2/2] net: dsa: mt7530: fix module autoloading for OF platform drivers

2018-03-26 Thread sean.wang
From: Sean Wang It's required to create a modules.alias via MODULE_DEVICE_TABLE helper for the OF platform driver. Otherwise, module autoloading cannot work. Signed-off-by: Sean Wang --- drivers/net/dsa/mt7530.c | 1 + 1 file changed, 1

[PATCH net 1/2] dt-bindings: net: mediatek: add condition to property mediatek,pctl

2017-12-20 Thread sean.wang
From: Sean Wang The property "mediatek,pctl" is only required for SoCs such as MT2701 and MT7623, so adding a few words for stating the condition. Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/mediatek-net.txt | 2 +- 1 file

[PATCH net 2/2] net: mediatek: remove superfluous pin setup for MT7622 SoC

2017-12-20 Thread sean.wang
From: Sean Wang Remove superfluous pin setup to get out of accessing invalid I/O pin registers because the way for pin configuring tends to be different from various SoCs and thus it should be better being managed and controlled by the pinctrl driver which MT7622 already

[PATCH net] net: mediatek: setup proper state for disabled GMAC on the default

2017-12-18 Thread sean.wang
From: Sean Wang The current solution would setup fixed and force link of 1Gbps to the both GMAC on the default. However, The GMAC should always be put to link down state when the GMAC is disabled on certain target boards. Otherwise, the driver possibly receives unexpected

[PATCH v3 net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530

2017-12-14 Thread sean.wang
From: Sean Wang MT7530 can treat each port as either VLAN-unaware port or VLAN-aware port through the implementation of port matrix mode or port security mode on the ingress port, respectively. On one hand, Each port has been acting as the VLAN-unaware one whenever the

[PATCH v3 net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver

2017-12-14 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function from MediaTek switch. Signed-off-by: Sean Wang Reviewed-by: Andrew Lunn --- MAINTAINERS | 7

[PATCH v3 net-next 0/3] add VLAN support to DSA MT7530

2017-12-14 Thread sean.wang
From: Sean Wang Changes sicne v2: update to the latest code base from net-next and fix up all building errors with -Werror. Changes since v1: - fix up the typo - prefer ordering declarations longest to shortest - update that vlan_prepare callback should not change any

[PATCH v3 net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag

2017-12-14 Thread sean.wang
From: Sean Wang In order to let MT7530 switch can recognize well those egress packets having both special tag and VLAN tag, the information about the special tag should be carried on the existing VLAN tag. On the other hand, it's unnecessary for extra handling for ingress

[PATCH v2 net-next 0/3] add VLAN support to DSA MT7530

2017-12-12 Thread sean.wang
From: Sean Wang Changes since v1: - fix up the typo - prefer ordering declarations longest to shortest - update that vlan_prepare callback should not change any state - use lower case letter for function naming The patchset extends DSA MT7530 to VLAN support through

[PATCH v2 net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag

2017-12-12 Thread sean.wang
From: Sean Wang In order to let MT7530 switch can recognize well those egress packets having both special tag and VLAN tag, the information about the special tag should be carried on the existing VLAN tag. On the other hand, it's unnecessary for extra handling for ingress

[PATCH v2 net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver

2017-12-12 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function from MediaTek switch. Signed-off-by: Sean Wang Reviewed-by: Andrew Lunn --- MAINTAINERS | 7

[PATCH v2 net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530

2017-12-12 Thread sean.wang
From: Sean Wang MT7530 can treat each port as either VLAN-unaware port or VLAN-aware port through the implementation of port matrix mode or port security mode on the ingress port, respectively. On one hand, Each port has been acting as the VLAN-unaware one whenever the

[PATCH net-next 3/3] net: dsa: mediatek: update MAINTAINERS entry with MediaTek switch driver

2017-12-06 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function from MediaTek switch. Signed-off-by: Sean Wang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+)

[PATCH net-next 1/3] net: dsa: mediatek: add VLAN support for MT7530

2017-12-06 Thread sean.wang
From: Sean Wang MT7530 can treat each port as either VLAN-unware port or VLAN-ware port through the implementation of port matrix mode or port security mode on the ingress port, respectively. On one hand, Each port has been acting as the VLAN-unware one whenever the

[PATCH net-next 0/3] add VLAN support to DSA MT7530

2017-12-06 Thread sean.wang
From: Sean Wang The patchset extends DSA MT7530 to VLAN support through filling required callbacks in patch 1 and merging the special tag with VLAN tag in patch 2 for allowing that the hardware can handle these packets with VID from the CPU port. Sean Wang (3): net:

[PATCH net-next 2/3] net: dsa: mediatek: combine MediaTek tag with VLAN tag

2017-12-06 Thread sean.wang
From: Sean Wang In order to let MT7530 switch can recognize well those packets having both special tag and VLAN tag, the information about the special tag should be carried on the existing VLAN tag. Signed-off-by: Sean Wang --- net/dsa/tag_mtk.c

[PATCH net-next v3 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC

2017-07-31 Thread sean.wang
From: Sean Wang Changes since v2: - update John's mail Changes since v1: - add refinement for ethernet clock management - take out the code block for ESW, add it until ESW driver is actually introduced The series adds the driver for ethernet controller found on MT7622

[PATCH net-next v3 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers

2017-07-31 Thread sean.wang
From: Sean Wang Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet driver for the existing SoCs and adding support for the following SoCs. In the past, Sean has been active at making most of the qualifications , stress test and submitting a lot of

[PATCH net-next v3 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC

2017-07-31 Thread sean.wang
From: Sean Wang The patch adds the supplements in the dt-binding document for MediaTek MT7622 SoC with extra SGMII system controller and relevant clock consumers listed as the requirements for those SoCs equipped with the SGMII circuit. Also, add the missing binding

[PATCH net-next v3 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC

2017-07-31 Thread sean.wang
From: Sean Wang This patch adds the driver for ethernet controller on MT7622 SoC. It has the similar handling logic as the previously MT7623 does, but there are additions against with MT7623 SoC, the shared SGMII given for the dual GMACs and including 5-ports 10/100

[PATCH net-next v3 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-31 Thread sean.wang
From: Sean Wang This patch is the preparation patch in order to adapt into various hardware through adding platform data which holds specific characteristics among MediaTek SoCs and introducing the unified clock handler for those distinct clock requirements depending on

[PATCH] net: dsa: fixup fail to get tag in mtk_get_tag_protocol

2017-07-24 Thread sean.wang
From: Sean Wang dsa_is_cpu_port() checking ds->cpu_port_mask is not available in ds->ops->get_tag_protocol Since commit 14be36c2c96c ("net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse()") So force returning DSA_TAG_PROTO_MTK inside

[PATCH v2 net] net: ethernet: mediatek: avoid potential invalid memory access

2017-07-22 Thread sean.wang
From: Sean Wang Potential dangerous invalid memory might be accessed if invalid mac value reflected from the forward port field in rxd4 caused by possible potential hardware defects. So added a simple sanity checker to avoid the kind of situation happening.

[PATCH net] net: ethernet: mediatek: avoid potential invalid memory access

2017-07-20 Thread sean.wang
From: Sean Wang Potential dangerous invalid memory might be accessed if invalid mac value reflected from the forward port field in rxd4 caused by possible potential hardware defects. So added a simple sanity checker to avoid the kind of situation happening.

[PATCH net-next v2 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC

2017-07-17 Thread sean.wang
From: Sean Wang Changes since v1: - add refinement for ethernet clock management - take out the code block for ESW, add it until ESW driver is actually introduced The series adds the driver for ethernet controller found on MT7622 SoC. There are additions against with

[PATCH net-next v2 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-17 Thread sean.wang
From: Sean Wang This patch is the preparation patch in order to adapt into various hardware through adding platform data which holds specific characteristics among MediaTek SoCs and introducing the unified clock handler for those distinct clock requirements depending on

[PATCH net-next v2 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC

2017-07-17 Thread sean.wang
From: Sean Wang This patch adds the driver for ethernet controller on MT7622 SoC. It has the similar handling logic as the previously MT7623 does, but there are additions against with MT7623 SoC, the shared SGMII given for the dual GMACs and including 5-ports 10/100

[PATCH net-next v2 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC

2017-07-17 Thread sean.wang
From: Sean Wang The patch adds the supplements in the dt-binding document for MediaTek MT7622 SoC with extra SGMII system controller and relevant clock consumers listed as the requirements for those SoCs equipped with the SGMII circuit. Also, add the missing binding

[PATCH net-next v2 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers

2017-07-17 Thread sean.wang
From: Sean Wang Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet driver for the existing SoCs and adding support for the following SoCs. In the past, Sean has been active at making most of the qualifications , stress test and submitting a lot of

[PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-11 Thread sean.wang
From: Sean Wang This patch is the preparation patch in order to adapt into various hardware through adding platform data which holds specific characteristics among MediaTek SoCs and introducing the unified clock handler for those distinct clock requirements depending on

[PATCH net-next 4/4] MAINTAINERS: add Sean/Nelson as MediaTek ethernet maintainers

2017-07-11 Thread sean.wang
From: Sean Wang Sean and Nelson work for MediaTek on maintaining the MediaTek ethernet driver for the existing SoCs and adding support for the following SoCs. In the past, Sean has been active at making most of the qualifications , stress test and submitting a lot of

[PATCH net-next 1/4] dt-bindings: net: mediatek: add support for MediaTek MT7623 and MT7622 SoC

2017-07-11 Thread sean.wang
From: Sean Wang The patch adds the supplements in the dt-binding document for MediaTek MT7622 SoC with extra SGMII system controller and relevant clock consumers listed as the requirements for those SoCs equipped with the SGMII circuit. Also, add the missing binding

[PATCH net-next 3/4] net-next: mediatek: add support for MediaTek MT7622 SoC

2017-07-11 Thread sean.wang
From: Sean Wang This patch adds the driver for ethernet controller on MT7622 SoC. It has the similar handling logic as the previously MT7623 does, but there are additions against with MT7623 SoC, the shared SGMII given for the dual GMACs and including 5-ports 10/100

[PATCH net-next 0/4] net-next: mediatek: add support for ethernet on MT7622 SoC

2017-07-11 Thread sean.wang
From: Sean Wang The series adds the driver for ethernet controller found on MT7622 SoC. There are additions against with previous MT7623 SoC such as shared SGMII given for the dual GMACs and built-in 5-ports 10/100 embedded switch support (ESW). Thus more clocks consumers

[PATCH] net: ethernet: mediatek: fixed deadlock captured by lockdep

2017-07-03 Thread sean.wang
From: Sean Wang Lockdep found an inconsistent lock state when mtk_get_stats64 is called in user context while NAPI updates MAC statistics in softirq. Use spin_trylock_bh/spin_unlock_bh fix following lockdep warning. [ 81.321030] WARNING: inconsistent lock state [

[PATCH v2 net 2/2] net: ethernet: mediatek: fix inconsistency of port number carried in TXD

2017-04-13 Thread sean.wang
From: Sean Wang Fix port inconsistency on TXD due to hardware BUG that would cause different port number is carried on the same TXD between tx_map() and tx_unmap() with the iperf test. It would cause confusing BQL logic which leads to kernel panic when dual GMAC runs

[PATCH v2 net 1/2] net: ethernet: mediatek: fix inconsistency between TXD and the used buffer

2017-04-13 Thread sean.wang
From: Sean Wang Fix inconsistency between the TXD descriptor and the used buffer that would cause unexpected logic at mtk_tx_unmap() during skb housekeeping. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17

[PATCH v2 net 0/2] Fix crash caused by reporting inconsistent skb->len to BQL

2017-04-13 Thread sean.wang
From: Sean Wang Changes since v1: - fix inconsistent enumeration which easily causes the potential bug The series fixes kernel BUG caused by inconsistent SKB length reported into BQL. The reason for inconsistent length comes from hardware BUG which results in different

[PATCH net-next] net: ethernet: mediatek: enhance TX path with recycling more SKBs in one poll

2017-04-11 Thread sean.wang
From: Sean Wang The patch adds the enhancement for recycling more TX completed SKBs in one NAPI polling handler if NAPI budgets are still available and hardware raises status bit shown for certain SKBs are aready done. Signed-off-by: Sean Wang

[PATCH net 2/2] net: ethernet: mediatek: fix inconsistency of port number carried in TXD

2017-04-11 Thread sean.wang
From: Sean Wang Fix port inconsistency on TXD due to hardware BUG that would cause different port number is carried on the same TXD between tx_map() and tx_unmap() with the iperf test. It would cause confusing BQL logic which leads to kernel panic when dual GMAC runs

[PATCH net 0/2] Fix crash caused by reporting inconsistent skb->len to BQL

2017-04-11 Thread sean.wang
From: Sean Wang The series fixes kernel BUG caused by inconsistent SKB length reported into BQL. The reason for inconsistent length comes from hardware BUG which results in different port number carried on the TXD within the lifecycle of SKB. So patch 2) is proposed for

[PATCH net 1/2] net: ethernet: mediatek: fix inconsistency between TXD and the used buffer

2017-04-11 Thread sean.wang
From: Sean Wang Fix inconsistency between the TXD descriptor and the used buffer that would cause unexpected logic at mtk_tx_unmap() during skb housekeeping. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 17

[PATCH net-next v4 0/5] net-next: dsa: add Mediatek MT7530 support

2017-04-07 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports

[PATCH net-next v4 3/5] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-04-07 Thread sean.wang
From: Sean Wang The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is also working out for general untag packets as well.

[PATCH net-next v4 2/5] net-next: dsa: add Mediatek tag RX/TX handler

2017-04-07 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang

[PATCH net-next v4 1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-04-07 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang Acked-by: Rob Herring --- .../devicetree/bindings/net/dsa/mt7530.txt | 92

[PATCH net-next v4 4/5] net-next: ethernet: mediatek: add device_node of GMAC pointing into the netdev instance

2017-04-07 Thread sean.wang
From: Sean Wang the patch adds the setup of the corresponding device node of GMAC into the netdev instance which could allow other modules such as DSA to find the instance through the node in dt-bindings using of_find_net_device_by_node() call. Signed-off-by: Sean Wang

[PATCH net-next v4 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-04-07 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the

[PATCH net-next v3 3/5] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-03-29 Thread sean.wang
From: Sean Wang The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is also working out for general untag packets as well.

[PATCH net-next v3 2/5] net-next: dsa: add Mediatek tag RX/TX handler

2017-03-29 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang

[PATCH net-next v3 4/5] net-next: ethernet: mediatek: add device_node of GMAC pointing into the netdev instance

2017-03-29 Thread sean.wang
From: Sean Wang the patch adds the setup of the corresponding device node of GMAC into the netdev instance which could allow other modules such as DSA to find the instance through the node in dt-bindings using of_find_net_device_by_node() call. Signed-off-by: Sean Wang

[PATCH net-next v3 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-03-29 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the

[PATCH net-next v3 1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-03-29 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang Acked-by: Rob Herring --- .../devicetree/bindings/net/dsa/mt7530.txt | 92

[PATCH net-next v3 0/5] net-next: dsa: add Mediatek MT7530 support

2017-03-29 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports

[PATCH net-next v2 2/5] net-next: dsa: add Mediatek tag RX/TX handler

2017-03-21 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang

[PATCH net-next v2 3/5] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-03-21 Thread sean.wang
From: Sean Wang The patch adds the setup for allowing CDM can recognize these packets with carrying port-distinguishing tag. Otherwise, these tagging packets will be handled incorrectly by CDM. The setup is working out for general untag packets as well. Signed-off-by:

[PATCH net-next v2 4/5] net-next: ethernet: mediatek: add device_node of GMAC pointing into the netdev instance

2017-03-21 Thread sean.wang
From: Sean Wang the patch adds the setup of the corresponding device node of GMAC into the netdev instance which could allow other modules such as DSA to find the instance through the node in dt-bindings using of_find_net_device_by_node() call. Signed-off-by: Sean Wang

[PATCH net-next v2 0/5] net-next: dsa: add Mediatek MT7530 support

2017-03-21 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports

[PATCH net-next v2 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-03-21 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the

[PATCH net-next v2 1/5] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-03-21 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang --- .../devicetree/bindings/net/dsa/mt7530.txt | 92 ++ 1 file changed, 92 insertions(+)

[PATCH net-next 4/4] net-next: dsa: add dsa support for Mediatek MT7530 switch

2017-03-13 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N platform which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the

[PATCH net-next 2/4] net-next: dsa: add Mediatek tag RX/TX handler

2017-03-13 Thread sean.wang
From: Sean Wang Add the support for the 4-bytes tag for DSA port distinguishing inserted allowing receiving and transmitting the packet via the particular port. The tag is being added after the source MAC address in the ethernet header. Signed-off-by: Sean Wang

[PATCH net-next 1/4] dt-bindings: net: dsa: add Mediatek MT7530 binding

2017-03-13 Thread sean.wang
From: Sean Wang Add device-tree binding for Mediatek MT7530 switch. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang --- .../devicetree/bindings/net/dsa/mt7530.txt | 94 ++ 1 file changed, 94 insertions(+)

[PATCH net-next 3/4] net-next: ethernet: mediatek: add CDM able to recognize the tag for DSA

2017-03-13 Thread sean.wang
From: Sean Wang Allowing CDM can recognize these packets with carrying port-distinguishing tag when CONFIG_NET_DSA_TAG_MTK is enabled. Otherwise, these packets will be dropped by CDM ingress. Signed-off-by: Sean Wang Signed-off-by: Landen Chao

[PATCH net-next 0/4] net-next: dsa: add Mediatek MT7530 support

2017-03-13 Thread sean.wang
From: Sean Wang MT7530 is a 7-ports Gigabit Ethernet Switch that could be found on Mediatek router platforms such as MT7623A or MT7623N which includes 7-port Gigabit Ethernet MAC and 5-port Gigabit Ethernet PHY. Among these ports, The port from 0 to 4 are the user ports

[PATCH net-next] Documentation: devicetree: fix typo in MediaTek ethernet device-tree binding

2016-09-23 Thread sean.wang
From: Sean Wang fix typo in Documentation/devicetree/bindings/net/mediatek-net.txt Cc: devicet...@vger.kernel.org Reported-by: Sergei Shtylyov Signed-off-by: Sean Wang ---

[PATCH net-next v2] Documentation: devicetree: revise ethernet device-tree binding about TRGMII

2016-09-23 Thread sean.wang
From: Sean Wang add phy-mode "trgmii" to Documentation/devicetree/bindings/net/ethernet.txt Cc: devicet...@vger.kernel.org Reported-by: Sergei Shtylyov Signed-off-by: Sean Wang ---

[PATCH net-next] Documentation: devicetree: revise ethernet device-tree binding about TRGMII

2016-09-22 Thread sean.wang
From: Sean Wang fix typo in mediatek-net.txt and add phy-mode "trgmii" to ethernet.txt Cc: devicet...@vger.kernel.org Reported-by: Sergei Shtylyov Signed-off-by: Sean Wang ---

[PATCH net-next] net: ethernet: mediatek: get out of potential invalid pointer access

2016-09-22 Thread sean.wang
From: Sean Wang Potential dangerous invalid pointer might be accessed if the error happens when couple phy_device to net_device so cleanup the error path. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 -- 1

[PATCH net-next] net: ethernet: mediatek: use [get|set]_link_ksettings

2016-09-22 Thread sean.wang
From: Sean Wang 1) use new api [get|set]_link_ksettings instead of [get|set]_settings old ones. 2) dev->phydev is sure being ready before calling these callbacks, so removing all the sanity check if it is existing. Signed-off-by: Sean Wang ---

[PATCH net-next] net: ethernet: mediatek: remove superfluous local variable for phy address

2016-09-22 Thread sean.wang
From: Sean Wang remove the unused variable for parsing PHY address and the related logic for sanity test which would be all already handled done when of_mdiobus_register was called Reported-by: Nelson Chang Signed-off-by: Sean Wang

[PATCH net-next] net: ethernet: mediatek: use phydev from struct net_device

2016-09-22 Thread sean.wang
From: Sean Wang reuse phydev already in struct net_device instead of creating another new one in private structure. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 73 ++---

[PATCH net-next v2 3/3] net: ethernet: mediatek: add the dts property to set if TRGMII supported on GMAC0

2016-09-21 Thread sean.wang
From: Sean Wang Add the dts property for the capability if TRGMII supported on GAMC0 Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/mediatek-net.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH net-next v2 1/3] net: ethernet: mediatek: add extension of phy-mode for TRGMII

2016-09-21 Thread sean.wang
From: Sean Wang adds PHY-mode "trgmii" as an extension for the operation mode of the PHY interface for PHY_INTERFACE_MODE_TRGMII. and adds a variable trgmii inside mtk_mac as the indication to make the difference between the MAC connected to internal switch or connected

[PATCH net-next v2 2/3] net: ethernet: mediatek: add support for GMAC0 connecting with external PHY through TRGMII

2016-09-21 Thread sean.wang
From: Sean Wang Changing dynamically source clock, TX/RX delay and interface mode used by TRGMII hardware module inside PHY capability polling routine for adapting to the various speed of RGMII used by external PHY for GMAC0. Signed-off-by: Sean Wang

[PATCH net-next v2 0/3] add support for RGMII on GMAC0 through TRGMII hardware module

2016-09-21 Thread sean.wang
From: Sean Wang By default, GMAC0 is connected to built-in switch called MT7530 through the proprietary interface called Turbo RGMII (TRGMII). TRGMII also supports well for RGMII as generic external PHY uses but requires some slight changes to the setup of TRGMII and

[PATCH net-next] net: ethernet: mediatek: fix missing changes merged for conflicts overlapping commits

2016-09-20 Thread sean.wang
From: Sean Wang add the missing commits about 1) Commit d3bd1ce4db8e843dce421e2f8f123e5251a9c7d3 ("remove redundant free_irq for devm_request_ir allocated irq") 2) Commit 7c6b0d76fa02213393815e3b6d5e4a415bf3f0e2 ("fix logic unbalance between probe and remove") during

[PATCH net-next 1/3] net: ethernet: mediatek: add extension of phy-mode for TRGMII

2016-09-20 Thread sean.wang
From: Sean Wang adds PHY-mode "trgmii" as an extension for the operation mode of the PHY interface, TRGMII can be compatible with RGMII, so the extended mode doesn't really have effects on the target MAC and PHY, is used as the indication if the current MAC is connected

[PATCH net-next 0/3] add support for RGMII on GMAC0 through TRGMII hardware module

2016-09-20 Thread sean.wang
From: Sean Wang By default, GMAC0 is connected to built-in switch called MT7530 through the proprietary interface called Turbo RGMII (TRGMII). TRGMII also supports well for RGMII as generic external PHY uses but requires some slight changes to the setup of TRGMII and

[PATCH net-next 3/3] net: ethernet: mediatek: add the dts property to set if TRGMII supported on GMAC0

2016-09-20 Thread sean.wang
From: Sean Wang Add the dts property for the capability if TRGMII supported on GAMC0 Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/mediatek-net.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH net-next 2/3] net: ethernet: mediatek: add support for GMAC0 connecting with external PHY through TRGMII

2016-09-20 Thread sean.wang
From: Sean Wang Changing dynamically source clock, TX/RX delay and interface mode used by TRGMII hardware module inside PHY capability polling routine for adapting to the various speed of RGMII used by external PHY for GMAC0. Signed-off-by: Sean Wang

[PATCH net-next] net: ethernet: mediatek: enhance with avoiding superfluous assignment inside mtk_get_ethtool_stats

2016-09-19 Thread sean.wang
From: Sean Wang data_src is unchanged inside the loop, so this patch moves the assignment to outside the loop to avoid unnecessarily assignment Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 ++- 1 file changed, 2

[PATCH net-next v2 3/7] net: ethernet: mediatek: cleanup error path inside mtk_hw_init

2016-09-14 Thread sean.wang
From: Sean Wang This cleans up the error path inside mtk_hw_init call, causing it able to exit appropriately when something fails and also includes refactoring mtk_cleanup call to make the partial logic reusable on the error path. Signed-off-by: Sean Wang

[PATCH net-next v2 5/7] net: ethernet: mediatek: add the whole ethernet reset into the reset process

2016-09-14 Thread sean.wang
From: Sean Wang 1) original driver only resets DMA used by descriptor rings which can't guarantee it can recover all various kinds of fatal errors, so the patch tries to reset the underlying hardware resource from scratch on Mediatek SoC required for ethernet running,

[PATCH net-next v2 7/7] net: ethernet: mediatek: avoid race condition during the reset process

2016-09-14 Thread sean.wang
From: Sean Wang add the protection of the race condition between the reset process and hardware access happening on the related callbacks. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 36

[PATCH net-next v2 2/7] net: ethernet: mediatek: add mtk_hw_deinit call as the opposite to mtk_hw_init call

2016-09-14 Thread sean.wang
From: Sean Wang grouping things related to the deinitialization of what mtk_hw_init call does that help to be reused by the reset process and the error path handling. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15

[PATCH net-next v2 1/7] net: ethernet: mediatek: refactoring mtk_hw_init to be reused

2016-09-14 Thread sean.wang
From: Sean Wang the existing mtk_hw_init includes hardware and software initialization inside so that it is slightly hard to reuse them for the process of the reset recovery, so some splitting is made here for keeping hardware initializing relevant thing and the else such

[PATCH net-next v2 6/7] net: ethernet: mediatek: add more resets for internal ethernet circuit block

2016-09-14 Thread sean.wang
From: Sean Wang struct mtk_eth has already contained struct regmap ethsys pointer to the address range of the internal circuit reset, so we reuse it to reset more internal blocks on ethernet hardware such as packet processing engine (PPE) and frame engine (FE) instead of

[PATCH net-next v2 4/7] net: ethernet: mediatek: add controlling power domain the ethernet belongs to

2016-09-14 Thread sean.wang
From: Sean Wang introduce power domain control which the digital circuit of the ethernet belongs to inside the flow of hardware initialization and deinitialization which helps the entire ethernet hardware block could restart cleanly and completely as being back to the

[PATCH net-next v2 0/7] add enhancement into the existing reset flow

2016-09-14 Thread sean.wang
From: Sean Wang Current driver only resets DMA used by descriptor rings which can't guarantee it can recover all various kinds of fatal errors, so the patch 1) tries to reset the underlying hardware resource from scratch on Mediatek SoC required for ethernet running. 2)

[PATCH net] net: ethernet: mediatek: fix module loading automatically based on MODULE_DEVICE_TABLE

2016-09-14 Thread sean.wang
From: Sean Wang The device table is required to load modules based on modaliases. After adding MODULE_DEVICE_TABLE, below entries for example will be added to modules.alias: alias of:N*T*Cmediatek,mt7623-ethC* mtk_eth_soc Signed-off-by: Sean Wang

[PATCH net-next 3/7] net: ethernet: mediatek: cleanup error path inside mtk_hw_init

2016-09-13 Thread sean.wang
From: Sean Wang This cleans up the error path inside mtk_hw_init call, causing it able to exit appropriately when something fails and also includes refactoring mtk_cleanup call to make the partial logic reusable on the error path. Signed-off-by: Sean Wang

[PATCH net-next 7/7] net: ethernet: mediatek: avoid race condition during the reset process

2016-09-13 Thread sean.wang
From: Sean Wang add the protection of the race condition between the reset process and hardware access happening on the related callbacks. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 36

[PATCH net-next 0/7] add enhancement into the existing reset flow

2016-09-13 Thread sean.wang
From: Sean Wang Current driver only resets DMA used by descriptor rings which can't guarantee it can recover all various kinds of fatal errors, so the patch 1) tries to reset the underlying hardware resource from scratch on Mediatek SoC required for ethernet running. 2)

[PATCH net-next 2/7] net: ethernet: mediatek: add mtk_hw_deinit call as the opposite to mtk_hw_init call

2016-09-13 Thread sean.wang
From: Sean Wang grouping things related to the deinitialization of what mtk_hw_init call does that help to be reused by the reset process and the error path handling. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15

[PATCH net-next 6/7] net: ethernet: mediatek: add more resets for internal ethernet circuit block

2016-09-13 Thread sean.wang
From: Sean Wang struct mtk_eth has already contained struct regmap ethsys pointer to the address range of the internal circuit reset, so we reuse it to reset more internal blocks on ethernet hardware such as packet processing engine (PPE) and frame engine (FE) instead of

[PATCH net-next 5/7] net: ethernet: mediatek: add the whole ethernet reset into the reset process

2016-09-13 Thread sean.wang
From: Sean Wang 1) original driver only resets DMA used by descriptor rings which can't guarantee it can recover all various kinds of fatal errors, so the patch tries to reset the underlying hardware resource from scratch on Mediatek SoC required for ethernet running,

[PATCH net-next 4/7] net: ethernet: mediatek: add controlling power domain the ethernet belongs to

2016-09-13 Thread sean.wang
From: Sean Wang introduce power domain control which the digital circuit of the ethernet belongs to inside the flow of hardware initialization and deinitialization which helps the entire ethernet hardware block could restart cleanly and completely as being back to the

[PATCH net-next 1/7] net: ethernet: mediatek: refactoring mtk_hw_init to be reused

2016-09-13 Thread sean.wang
From: Sean Wang the existing mtk_hw_init includes hardware and software initialization inside so that it is slightly hard to reuse them for the process of the reset recovery, so some splitting is made here for keeping hardware initializing relevant thing and the else such

  1   2   >