drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI ethernet interfaces of APM X-Gene SoC.
cover drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI ethernet interfaces of APM X-Gene SoC.
---
Suman Tripathi (4):
drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI
interface of APM X-Gene SoC ethernet controller.
drivers: net: xgene: Implement the backward compatibility with the old
and new firmware w.r.t Tx completion IRQ interrupt.
drivers: net: xgene: Add ACPI support for SGMII0 and XFI1 interface of
2nd H/W version of APM X-Gene SoC ethernet controller.
drivers: net: xgene: Check for IS_ERR rather than NULL for clock.
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 7 +- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 84 ++++++++++++++--------- drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c | 13 ++-- drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c | 13 ++-- 4 files changed, 73 insertions(+), 44 deletions(-)
--
1.8.2.1
PATCH 1/4 drivers: net: xgene: Fix the ACPI support for RGMII/SGMII0/XFI interface of APM X-Gene SoC ethernet controller.
This patch implements couple of fixes to support ACPI for RGMII/SGMII0/XFI interface of APM X-Gene SoC ethernet controller driver. This patch uses the _SUN acpi object to fetch the port-id information whereas the FDT uses port-id binding for port-id information.
--- drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 2 +- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 66 +++++++++++++++--------- 2 files changed, 44 insertions(+), 24 deletions(-)
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +1 -1
@@ -751,7 +751,7 @@ static int xgene_mdiobus_register(struct xgene_enet_pdata *pdata,if (ret)return -EINVAL ; - phy =get_phy_device (mdio, phy_id, true); + phy =get_phy_device (mdio, phy_id, false);if (!phy ||IS_ERR (phy))return -EIO ;
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +43 -23
115 lines not on this page · raw message
--
1.8.2.1
PATCH 2/4 drivers: net: xgene: Implement the backward compatibility with the old and new firmware w.r.t Tx completion IRQ interrupt.
In reply to Suman TripathiThis patch implements the backward compatibility with the old firmware where the Tx completion IRQ interrupt was absent whereas incase of new firmware the Tx completion IRQ interrupt is present.
--- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +7 -7
@@ -1024,11 +1024,13 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)if (pdata->phy_mode !=PHY_INTERFACE_MODE_RGMII ) { ret =platform_get_irq (pdev,1 );if (ret <=0 ) { -dev_err (dev,"Unable to get ENET Tx completion IRQ\n" ); - ret = ret ? : -ENXIO ; -return ret; - } - pdata->txc_irq = ret; + pdata->cq_cnt =0 ; +dev_info (dev,"Unable to get Tx completion IRQ," +"using Rx IRQ instead\n" ); + }else { + pdata->cq_cnt =XGENE_MAX_TXC_RINGS ; + pdata->txc_irq = ret; + } } pdata->clk =devm_clk_get (&pdev->dev,NULL );
@@ -1105,13 +1107,11 @@ static void xgene_enet_setup_ops(struct xgene_enet_pdata *pdata) pdata->mac_ops = &xgene_sgmac_ops; pdata->port_ops = &xgene_sgport_ops; pdata->rm =RM1 ; - pdata->cq_cnt =XGENE_MAX_TXC_RINGS ;break ;default : pdata->mac_ops = &xgene_xgmac_ops; pdata->port_ops = &xgene_xgport_ops; pdata->rm =RM0 ; - pdata->cq_cnt =XGENE_MAX_TXC_RINGS ;break ; }
--
1.8.2.1
PATCH 3/4 drivers: net: xgene: Add ACPI support for SGMII0 and XFI1 interface of 2nd H/W version of APM X-Gene SoC ethernet controller.
In reply to Suman TripathiThis patch adds the ACPI support for SGMII0 and XFI1 interface of 2nd H/W version of APM X-Gene SoC ethernet controller.
--- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +2 -0
@@ -1289,6 +1289,8 @@ static const struct acpi_device_id xgene_enet_acpi_match[] = { { "APMC0D05", XGENE_ENET1}, { "APMC0D30", XGENE_ENET1}, { "APMC0D31", XGENE_ENET1}, + { "APMC0D26", XGENE_ENET2}, + { "APMC0D25", XGENE_ENET2}, { } };MODULE_DEVICE_TABLE (acpi, xgene_enet_acpi_match);
--
1.8.2.1
PATCH 4/4 drivers: net: xgene: Check for IS_ERR rather than NULL for clock.
In reply to Suman TripathiThis patches fixes the code to check for IS_ERR rather than NULL for clock interface.
--- drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 5 +++-- drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +- drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c | 13 ++++++++----- drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c | 13 ++++++++----- 4 files changed, 20 insertions(+), 13 deletions(-)
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +3 -2
@@ -610,7 +610,7 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)if (!xgene_ring_mgr_init (pdata))return -ENODEV ; -if (pdata->clk) { +if (!IS_ERR (pdata->clk)) {clk_prepare_enable (pdata->clk);clk_disable_unprepare (pdata->clk);clk_prepare_enable (pdata->clk);
@@ -629,7 +629,8 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata)static void xgene_gport_shutdown (struct xgene_enet_pdata *pdata) { -clk_disable_unprepare (pdata->clk); +if (!IS_ERR (pdata->clk)) +clk_disable_unprepare (pdata->clk); }static int xgene_enet_mdio_read (struct mii_bus *bus,int mii_id,int regnum)
drivers/net/ethernet/apm/xgene/xgene_enet_main.c +1 -1
@@ -1036,7 +1036,7 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata) pdata->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (pdata->clk)) {/* Firmware may have set up the clock already. */ - pdata->clk =NULL ; +dev_info (dev,"clocks have been setup already\n" ); }if (pdata->phy_mode !=PHY_INTERFACE_MODE_XGMII )
drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c +8 -5
@@ -333,10 +333,12 @@ static int xgene_enet_reset(struct xgene_enet_pdata *p) {if (!xgene_ring_mgr_init (p))return -ENODEV ; - -clk_prepare_enable (p->clk); -clk_disable_unprepare (p->clk); -clk_prepare_enable (p->clk); + +if (!IS_ERR (p->clk)) { +clk_prepare_enable (p->clk); +clk_disable_unprepare (p->clk); +clk_prepare_enable (p->clk); + }xgene_enet_ecc_init (p);xgene_enet_config_ring_if_assoc (p);
@@ -369,7 +371,8 @@ static void xgene_enet_cle_bypass(struct xgene_enet_pdata *p,static void xgene_enet_shutdown (struct xgene_enet_pdata *p) { -clk_disable_unprepare (p->clk); +if (!IS_ERR (p->clk)) +clk_disable_unprepare (p->clk); }static void xgene_enet_link_state (struct work_struct *work)
drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c +8 -5
@@ -255,10 +255,12 @@ static int xgene_enet_reset(struct xgene_enet_pdata *pdata) {if (!xgene_ring_mgr_init (pdata))return -ENODEV ; - -clk_prepare_enable (pdata->clk); -clk_disable_unprepare (pdata->clk); -clk_prepare_enable (pdata->clk); + +if (!IS_ERR (pdata->clk)) { +clk_prepare_enable (pdata->clk); +clk_disable_unprepare (pdata->clk); +clk_prepare_enable (pdata->clk); + }xgene_enet_ecc_init (pdata);xgene_enet_config_ring_if_assoc (pdata);
@@ -285,7 +287,8 @@ static void xgene_enet_xgcle_bypass(struct xgene_enet_pdata *pdata,static void xgene_enet_shutdown (struct xgene_enet_pdata *pdata) { -clk_disable_unprepare (pdata->clk); +if (!IS_ERR (pdata->clk)) +clk_disable_unprepare (pdata->clk); }static void xgene_enet_link_state (struct work_struct *work)
--
1.8.2.1
David Miller
maintainerFrom: Suman Tripathi <[email protected]>
Date: Tue, 23 Jun 2015 14:47:13 +0530
Quoted 2 lines
Signed-off-by Iyappan Subramanian <[email protected]>Signed-off-by Suman Tripathi <[email protected]>
Series applied, thanks.