V_01-00-10

1. TC956X_PCIE_GEN3_SETTING macro setting supported through makefile. By default Gen3 settings will not be applied by the Driver as TC956X_PCIE_GEN3_SETTING is not defined.
2. TC956X_LOAD_FW_HEADER macro setting supported through makefile. By default, TC956X_LOAD_FW_HEADER macro is disabled. If FIRMWARE_NAME is not specified in Makefile, the default value shall be TC956X_Firmware_PCIeBridge.bin
3. Platform APIs supported.
4. Modified PHY C22/C45 debug message.
This commit is contained in:
TC956X 2021-08-25 14:19:04 +09:00 committed by jianzhou
parent 91bf4a10b7
commit cf2a317cd0
7 changed files with 89 additions and 12 deletions

View File

@ -1,7 +1,7 @@
# Toshiba Electronic Devices & Storage Corporation TC956X PCIe Ethernet Host Driver
Release Date: 16 Aug 2021
Release Date: 24 Aug 2021
Release Version: V_01-00-09 : Limited-tested version
Release Version: V_01-00-10 : Limited-tested version
TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
@ -16,6 +16,15 @@ TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
#make clean
#make
To compile driver with load firmware header (fw.h) use the below command
#make TC956X_LOAD_FW_HEADER=1
In order to compile the Driver to include the code for applying Gen3 setting, execute Make with below argument
#make TC956X_PCIE_GEN3_SETTING=1
Please note, incase both fw.h and Gen3 settings are needed, then both arugments need to be specified.
3. Load phylink module
#modprobe phylink
@ -142,3 +151,10 @@ TC956X PCIe EMAC driver is based on "Fedora 30, kernel-5.4.19".
## TC956X_Host_Driver_20210816_V_01-00-09:
1. PHY interrupt mode supported through .config_intr and .ack_interrupt API
## TC956X_Host_Driver_20210824_V_01-00-10:
1. TC956X_PCIE_GEN3_SETTING macro setting supported through makefile. By default Gen3 settings will not be applied by the Driver as TC956X_PCIE_GEN3_SETTING is not defined.
2. TC956X_LOAD_FW_HEADER macro setting supported through makefile. By default, TC956X_LOAD_FW_HEADER macro is disabled. If FIRMWARE_NAME is not specified in Makefile, the default value shall be TC956X_Firmware_PCIeBridge.bin
3. Platform APIs supported.
4. Modified PHY C22/C45 debug message.

View File

@ -9,6 +9,14 @@ else
CCFLAGS += -m32
endif
ifeq ($(TC956X_PCIE_GEN3_SETTING),1)
EXTRA_CFLAGS+=-DTC956X_PCIE_GEN3_SETTING
endif
ifeq ($(TC956X_LOAD_FW_HEADER),1)
EXTRA_CFLAGS+=-DTC956X_LOAD_FW_HEADER
endif
DMA_OFFLOAD = 1
obj-m := tc956x_pcie_eth.o

View File

@ -51,6 +51,9 @@
* VERSION : 01-00-08
* 16 Aug 2021 : 1. PHY interrupt mode supported through .config_intr and .ack_interrupt API
* VERSION : 01-00-09
* 24 Aug 2021 : 1. Disable TC956X_PCIE_GEN3_SETTING and TC956X_LOAD_FW_HEADER macros and provide support via Makefile
* : 2. Platform API supported
* VERSION : 01-00-10
*/
#include <linux/clk-provider.h>
@ -80,7 +83,7 @@ static unsigned int tc956x_speed = 3;
static unsigned int tc956x_port0_interface = ENABLE_XFI_INTERFACE;
static unsigned int tc956x_port1_interface = ENABLE_SGMII_INTERFACE;
static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 0, 9};
static const struct tc956x_version tc956x_drv_version = {0, 1, 0, 0, 1, 0};
/*
* This struct is used to associate PCI Function of MAC controller on a board,
@ -1576,7 +1579,7 @@ static void tc956x_pcie_disable_dsp2_port(struct device *dev,
}
#endif /*#ifdef TC956X_PCIE_DISABLE_DSP2*/
#ifdef TC956X_PCIE_GEN3_SETTING
//#ifdef TC956X_PCIE_GEN3_SETTING
static int tc956x_replace_aspm(struct pci_dev *pdev, u16 replace_value, u16 *org_value)
{
int err;
@ -1723,7 +1726,7 @@ int tc956x_set_pci_speed(struct pci_dev *pdev, u32 speed)
return ret;
}
#endif /*#ifdef TC956X_PCIE_GEN3_SETTING*/
//#endif /*#ifdef TC956X_PCIE_GEN3_SETTING*/
#endif /*#ifdef TC956X*/
@ -2202,6 +2205,10 @@ static void tc956xmac_pci_remove(struct pci_dev *pdev)
pdev->irq = 0;
if (tc956x_platform_remove(priv)) {
dev_err(priv->device, "Platform remove error\n");
}
/* Enable MSI Operation */
pci_disable_msi(pdev);
@ -2247,11 +2254,11 @@ static void tc956xmac_pci_remove(struct pci_dev *pdev)
static s32 tc956x_pcie_suspend(struct pci_dev *pdev, pm_message_t state)
{
s32 ret = 0;
struct net_device *ndev = dev_get_drvdata(&pdev->dev);
struct tc956xmac_priv *priv = netdev_priv(ndev);
#ifdef DMA_OFFLOAD_ENABLE
u8 i;
u32 val;
struct net_device *ndev = dev_get_drvdata(&pdev->dev);
struct tc956xmac_priv *priv = netdev_priv(ndev);
#endif
DBGPR_FUNC(&(pdev->dev), "-->%s\n", __func__);
@ -2283,6 +2290,13 @@ static s32 tc956x_pcie_suspend(struct pci_dev *pdev, pm_message_t state)
}
}
#endif
ret = tc956x_platform_suspend(priv);
if (ret) {
NMSGPR_ERR(&(pdev->dev), "%s: error in calling tc956x_platform_suspend", pci_name(pdev));
return ret;
}
/* Save the PCI Config Space of the device */
ret = pci_save_state(pdev);
@ -2515,6 +2529,13 @@ static s32 tc956x_pcie_resume(struct pci_dev *pdev)
/* Restore PCI config space of device */
pci_restore_state(pdev);
ret = tc956x_platform_resume(priv);
if (ret) {
NMSGPR_ERR(&(pdev->dev), "%s: error in calling tc956x_platform_resume", pci_name(pdev));
pci_disable_device(pdev);
return ret;
}
/* Configure TA map registers */
#ifdef TC956X
if (priv->port_num == RM_PF0_ID) {

View File

@ -53,6 +53,9 @@
* VERSION : 01-00-08
* 16 Aug 2021 : 1. PHY interrupt mode supported through .config_intr and .ack_interrupt API
* VERSION : 01-00-09
* 24 Aug 2021 : 1. Disable TC956X_PCIE_GEN3_SETTING and TC956X_LOAD_FW_HEADER macros and provide support via Makefile
* : 2. Platform API supported
* VERSION : 01-00-10
*/
#ifndef __TC956XMAC_H__
@ -71,7 +74,7 @@
#include <net/page_pool.h>
#include <linux/version.h>
#define TC956X_LOAD_FW_HEADER
//#define TC956X_LOAD_FW_HEADER
#define PF_DRIVER 4
// #define CONFIG_TC956XMAC_SELFTESTS /*Enable this macro to test Feature selftest*/
@ -94,12 +97,14 @@
#define TC956X_TX_QUEUES 8
#define TC956X_RX_QUEUES 8
#ifndef FIRMWARE_NAME
#define FIRMWARE_NAME "TC956X_Firmware_PCIeBridge.bin"
#endif
#ifdef TC956X
#define TC956X_RESOURCE_NAME "tc956x_pci-eth"
#define DRV_MODULE_VERSION "V_01-00-09"
#define DRV_MODULE_VERSION "V_01-00-10"
#define TC956X_FW_MAX_SIZE (64*1024)
#define ATR_AXI4_SLV_BASE 0x0800
@ -540,6 +545,8 @@ struct tc956xmac_priv {
/* set to 1 when onestep timestamp is enabled, else 0. */
u32 ost_en;
/* Private data store for platform layer */
void *plat_priv;
#ifdef DMA_OFFLOAD_ENABLE
void *client_priv;
struct tc956xmac_cm3_tamap cm3_tamap[MAX_CM3_TAMAP_ENTRIES];
@ -644,4 +651,17 @@ s32 tc956x_load_firmware(struct device *dev, struct tc956xmac_resources *res);
int tc956x_set_pci_speed(struct pci_dev *pdev, u32 speed);
#ifdef CONFIG_TC956X_PLATFORM_SUPPORT
int tc956x_platform_probe(struct tc956xmac_priv *priv, struct tc956xmac_resources *res);
int tc956x_platform_remove(struct tc956xmac_priv *priv);
int tc956x_platform_suspend(struct tc956xmac_priv *priv);
int tc956x_platform_resume(struct tc956xmac_priv *priv);
#else
static inline int tc956x_platform_probe(struct tc956xmac_priv *priv, struct tc956xmac_resources *res) { return 0; }
static inline int tc956x_platform_remove(struct tc956xmac_priv *priv) { return 0; }
static inline int tc956x_platform_suspend(struct tc956xmac_priv *priv) { return 0; }
static inline int tc956x_platform_resume(struct tc956xmac_priv *priv) { return 0; }
#endif
#endif /* __TC956XMAC_H__ */

View File

@ -40,6 +40,8 @@
* VERSION : 01-00-04
* 16 Aug 2021 : 1. PHY interrupt mode supported through .config_intr and .ack_interrupt API
* VERSION : 01-00-09
* 24 Aug 2021 : 1. Disable TC956X_PCIE_GEN3_SETTING and TC956X_LOAD_FW_HEADER macros and provide support via Makefile
* VERSION : 01-00-10
*/
#ifndef __TC956XMAC_PLATFORM_DATA
@ -52,7 +54,7 @@
#define TC956X
//#define TC956X_IOCTL_REG_RD_WR_ENABLE
//#define TC956X_WITHOUT_MDIO
#define TC956X_PCIE_GEN3_SETTING
//#define TC956X_PCIE_GEN3_SETTING
//#define TC956X_PCIE_DISABLE_DSP1 /*Enable this macro to disable DSP1 port*/
//#define TC956X_PCIE_DISABLE_DSP2 /*Enable this macro to disable DSP2 port*/
/* Enable for PORT0 interrupt mode, if commented polling mode */

View File

@ -47,6 +47,8 @@
* VERSION : 01-00-08
* 16 Aug 2021 : 1. PHY interrupt mode supported through .config_intr and .ack_interrupt API
* VERSION : 01-00-09
* 24 Aug 2021 : 1. Platform API supported
* VERSION : 01-00-10
*/
#include <linux/clk.h>
@ -9747,6 +9749,11 @@ int tc956xmac_dvr_probe(struct device *device,
priv->device = device;
priv->dev = ndev;
ret = tc956x_platform_probe(priv, res);
if (ret) {
dev_err(priv->device, "Platform probe error %d\n", ret);
return -EPERM;
}
#ifdef TC956X
priv->mac_loopback_mode = 0; /* Disable MAC loopback by default */
priv->phy_loopback_mode = 0; /* Disable PHY loopback by default */

View File

@ -500,9 +500,12 @@ int tc956xmac_mdio_register(struct net_device *ndev)
if (phy_reg_read != -EBUSY && phy_reg_read != -ENODEV) {
if (phy_reg_read != 0x0000 && phy_reg_read != 0xffff) {
NMSGPR_ALERT(priv->device,
if (priv->plat->c45_needed == true)
NMSGPR_ALERT(priv->device,
"TC956X: Phy detected C45 at ID/ADDR %d\n", addr);
else
NMSGPR_ALERT(priv->device,
"TC956X: Phy detected C22 at ID/ADDR %d\n", addr);
#else
struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);