From 25fdfed826e1adbcfde7c8c38f08a3a8c5a3e662 Mon Sep 17 00:00:00 2001 From: TC956X <56059496+TC956X@users.noreply.github.com> Date: Thu, 4 Nov 2021 18:39:31 +0900 Subject: [PATCH] V_01-00-20 1. Added separate control functions for MAC TX and RX start/stop. 2. Stopped disabling/enabling of MAC TX during Link down/up. 3. Disabled link state latency configuration for all PCIe ports by default --- Readme.md | 10 ++++++++-- common.h | 4 +++- dwxgmac2_core.c | 32 ++++++++++++++++++++++++++++++++ hwif.h | 10 ++++++++++ tc956x_pci.c | 4 +++- tc956xmac.h | 4 +++- tc956xmac_main.c | 6 ++++-- 7 files changed, 63 insertions(+), 7 deletions(-) diff --git a/Readme.md b/Readme.md index 6f2004efa853..edaab4beb266 100644 --- a/Readme.md +++ b/Readme.md @@ -1,7 +1,7 @@ # Toshiba Electronic Devices & Storage Corporation TC956X PCIe Ethernet Host Driver -Release Date: 26 Oct 2021 +Release Date: 04 Nov 2021 -Release Version: V_01-00-19 : Limited-tested version +Release Version: V_01-00-20 : Limited-tested version TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19". @@ -282,3 +282,9 @@ ethtool -s eth0 wol pg 1. Added PM support for suspend-resume. 2. Added WOL Interrupt Handler and ethtool Support. 3. Updated EEE support for PHY and MAC Control. (EEE macros are not enabled as EEE LPI interrupts disable are still under validation) + +## TC956X_Host_Driver_20211104_V_01-00-20: + +1. Added separate control functions for MAC TX and RX start/stop. +2. Stopped disabling/enabling of MAC TX during Link down/up. +3. Disabled link state latency configuration for all PCIe ports by default diff --git a/common.h b/common.h index 23ac7fbde332..558b2c80a47a 100644 --- a/common.h +++ b/common.h @@ -57,6 +57,8 @@ : 2. Added enums for PM Suspend-Resume. : 3. Added macros for EEE, LPI Timer and MAC RST Status. * VERSION : 01-00-19 + * 04 Nov 2021 : 1. Disabled link state latency configuration for all PCIe ports by default + * VERSION : 01-00-20 */ #ifndef __COMMON_H__ @@ -98,7 +100,7 @@ enum TC956X_PORT_PM_STATE { SUSPEND = 0, RESUME, }; -#define TC956X_PCIE_LINK_STATE_LATENCY_CTRL +//#define TC956X_PCIE_LINK_STATE_LATENCY_CTRL #define DISABLE 0 #define ENABLE 1 diff --git a/dwxgmac2_core.c b/dwxgmac2_core.c index 45591b680773..c8e9ccbedd29 100644 --- a/dwxgmac2_core.c +++ b/dwxgmac2_core.c @@ -52,6 +52,8 @@ * VERSION : 01-00-16 * 26 Oct 2021 : 1. Added EEE print in host IRQ and updated EEE configuration. * VERSION : 01-00-19 + * 04 Nov 2021 : 1. Added separate control functons for MAC TX and RX start/stop + * VERSION : 01-00-20 */ #include @@ -147,6 +149,34 @@ static void dwxgmac2_set_mac(struct tc956xmac_priv *priv, void __iomem *ioaddr, writel(rx, ioaddr + XGMAC_RX_CONFIG); } +static void dwxgmac2_set_mac_tx(struct tc956xmac_priv *priv, void __iomem *ioaddr, + bool enable) +{ + u32 tx = readl(ioaddr + XGMAC_TX_CONFIG); + + if (enable) { + tx |= XGMAC_CONFIG_TE; + } else { + tx &= ~XGMAC_CONFIG_TE; + } + + writel(tx, ioaddr + XGMAC_TX_CONFIG); +} + +static void dwxgmac2_set_mac_rx(struct tc956xmac_priv *priv, void __iomem *ioaddr, + bool enable) +{ + u32 rx = readl(ioaddr + XGMAC_RX_CONFIG); + + if (enable) { + rx |= XGMAC_CONFIG_RE; + } else { + rx &= ~XGMAC_CONFIG_RE; + } + + writel(rx, ioaddr + XGMAC_RX_CONFIG); +} + static int dwxgmac2_rx_ipc(struct tc956xmac_priv *priv, struct mac_device_info *hw) { void __iomem *ioaddr = hw->pcsr; @@ -2734,6 +2764,8 @@ static void tc956x_enable_jumbo_frm(struct tc956xmac_priv *priv, const struct tc956xmac_ops dwxgmac210_ops = { .core_init = dwxgmac2_core_init, .set_mac = dwxgmac2_set_mac, + .set_mac_tx = dwxgmac2_set_mac_tx, + .set_mac_rx = dwxgmac2_set_mac_rx, .rx_ipc = dwxgmac2_rx_ipc, .rx_queue_enable = dwxgmac2_rx_queue_enable, .rx_queue_prio = dwxgmac2_rx_queue_prio, diff --git a/hwif.h b/hwif.h index 63c1549399a3..073d193954c1 100644 --- a/hwif.h +++ b/hwif.h @@ -37,6 +37,8 @@ * 3. Removed IOCTL TC956XMAC_VLAN_STRIP_CONFIG. * 4. Removed "Disable VLAN Filter" option in IOCTL TC956XMAC_VLAN_FILTERING. * VERSION : 01-00-13 + * 04 Nov 2021 : 1. Added separate control functons for MAC TX and RX start/stop + * VERSION : 01-00-20 */ #ifndef __TC956XMAC_HWIF_H__ @@ -338,6 +340,10 @@ struct tc956xmac_ops { void (*core_init)(struct tc956xmac_priv *priv, struct mac_device_info *hw, struct net_device *dev); /* Enable the MAC RX/TX */ void (*set_mac)(struct tc956xmac_priv *priv, void __iomem *ioaddr, bool enable); + /* Start/Stop the MAC TX */ + void (*set_mac_tx)(struct tc956xmac_priv *priv, void __iomem *ioaddr, bool enable); + /* Start/Stop the MAC RX */ + void (*set_mac_rx)(struct tc956xmac_priv *priv, void __iomem *ioaddr, bool enable); /* Enable and verify that the IPC module is supported */ int (*rx_ipc)(struct tc956xmac_priv *priv, struct mac_device_info *hw); /* Enable RX Queues */ @@ -458,6 +464,10 @@ struct tc956xmac_ops { tc956xmac_do_void_callback(__priv, mac, core_init, __args) #define tc956xmac_mac_set(__priv, __args...) \ tc956xmac_do_void_callback(__priv, mac, set_mac, __args) +#define tc956xmac_mac_set_tx(__priv, __args...) \ + tc956xmac_do_void_callback(__priv, mac, set_mac_tx, __args) +#define tc956xmac_mac_set_rx(__priv, __args...) \ + tc956xmac_do_void_callback(__priv, mac, set_mac_rx, __args) #define tc956xmac_rx_ipc(__priv, __args...) \ tc956xmac_do_callback(__priv, mac, rx_ipc, __args) #define tc956xmac_rx_queue_enable(__priv, __args...) \ diff --git a/tc956x_pci.c b/tc956x_pci.c index d012d69c9e61..7969d0f2609a 100644 --- a/tc956x_pci.c +++ b/tc956x_pci.c @@ -78,6 +78,8 @@ 3. Added platform api calls. 4. Version update * VERSION : 01-00-19 + * 04 Nov 2021 : 1. Version update + * VERSION : 01-00-20 */ #include @@ -110,7 +112,7 @@ static unsigned int tc956x_port1_interface = ENABLE_SGMII_INTERFACE; unsigned int tc956x_port0_filter_phy_pause_frames = DISABLE; unsigned int tc956x_port1_filter_phy_pause_frames = DISABLE; -static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 1, 9}; +static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 2, 0}; enum TC956X_INDEPENDENT_PORT_PM_SUSPEND tc956xmac_pm_suspend_counter = NO_PORT_SUSPENDED; struct mutex tc956x_pm_suspend_lock; diff --git a/tc956xmac.h b/tc956xmac.h index ed2d924d2507..08b5aa2a2041 100644 --- a/tc956xmac.h +++ b/tc956xmac.h @@ -79,6 +79,8 @@ : 2. Added variable for port-wise suspend status. : 3. Added macro to control EEE MAC Control. * VERSION : 01-00-19 + * 04 Nov 2021 : 1. Version update + * VERSION : 01-00-20 */ #ifndef __TC956XMAC_H__ @@ -131,7 +133,7 @@ #ifdef TC956X #define TC956X_RESOURCE_NAME "tc956x_pci-eth" -#define DRV_MODULE_VERSION "V_01-00-19" +#define DRV_MODULE_VERSION "V_01-00-20" #define TC956X_FW_MAX_SIZE (64*1024) #define ATR_AXI4_SLV_BASE 0x0800 diff --git a/tc956xmac_main.c b/tc956xmac_main.c index 30af109d0269..5e2b7c9479d7 100644 --- a/tc956xmac_main.c +++ b/tc956xmac_main.c @@ -65,6 +65,8 @@ 3. Changed IRQF_SHARED to IRQF_NO_SUSPEND and added WOL Interrupt Handler support. 4. Added Platform Apis. * VERSION : 01-00-19 + * 04 Nov 2021 : 1. Stopped disabling/enabling of MAC TX during Link down/up. + * VERSION : 01-00-20 */ #include @@ -1781,7 +1783,7 @@ static void tc956xmac_mac_link_down(struct phylink_config *config, { struct tc956xmac_priv *priv = netdev_priv(to_net_dev(config->dev)); - tc956xmac_mac_set(priv, priv->ioaddr, false); + tc956xmac_mac_set_rx(priv, priv->ioaddr, false); #ifdef EEE priv->eee_active = false; priv->eee_enabled = tc956xmac_eee_init(priv); @@ -1875,7 +1877,7 @@ static void tc956xmac_mac_link_up(struct phylink_config *config, { struct tc956xmac_priv *priv = netdev_priv(to_net_dev(config->dev)); - tc956xmac_mac_set(priv, priv->ioaddr, true); + tc956xmac_mac_set_rx(priv, priv->ioaddr, true); #ifdef EEE if (phy && priv->dma_cap.eee) { #ifdef TC956X_5_G_2_5_G_EEE_SUPPORT