Yu Liao
d76867efeb
net: txgbe: use pci_dev_id() helper
...
PCI core API pci_dev_id() can be used to get the BDF number for a PCI
device. We don't need to compose it manually. Use pci_dev_id() to
simplify the code a little bit.
Signed-off-by: Yu Liao <liaoyu15@huawei.com >
Reviewed-by: Simon Horman <horms@kernel.org >
Link: https://patch.msgid.link/20240826012100.3975175-1-liaoyu15@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2024-08-27 14:20:13 -07:00
Russell King (Oracle)
dd1941f801
net: txgbe: use phylink_pcs_change() to report PCS link change events
...
Use phylink_pcs_change() when reporting changes in PCS link state to
phylink as the interrupts are informing us about changes to the PCS
state.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk >
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com >
Link: https://lore.kernel.org/r/E1s0OH2-009hgx-Qw@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2024-04-29 19:04:35 -07:00
Duanqiang Wen
edd2d250fb
Revert "net: txgbe: fix clk_name exceed MAX_DEV_ID limits"
...
This reverts commit e30cef001d .
commit 99f4570cfb ("clkdev: Update clkdev id usage to allow
for longer names") can fix clk_name exceed MAX_DEV_ID limits,
so this commit is meaningless.
Signed-off-by: Duanqiang Wen <duanqiangwen@net-swift.com >
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com >
Link: https://lore.kernel.org/r/20240422084109.3201-2-duanqiangwen@net-swift.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2024-04-24 19:55:44 -07:00
Duanqiang Wen
8d6bf83f67
Revert "net: txgbe: fix i2c dev name cannot match clkdev"
...
This reverts commit c644920ce9 .
when register i2c dev, txgbe shorten "i2c_designware" to "i2c_dw",
will cause this i2c dev can't match platfom driver i2c_designware_platform.
Signed-off-by: Duanqiang Wen <duanqiangwen@net-swift.com >
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com >
Link: https://lore.kernel.org/r/20240422084109.3201-1-duanqiangwen@net-swift.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2024-04-24 19:55:44 -07:00
Duanqiang Wen
c644920ce9
net: txgbe: fix i2c dev name cannot match clkdev
...
txgbe clkdev shortened clk_name, so i2c_dev info_name
also need to shorten. Otherwise, i2c_dev cannot initialize
clock.
Fixes: e30cef001d ("net: txgbe: fix clk_name exceed MAX_DEV_ID limits")
Signed-off-by: Duanqiang Wen <duanqiangwen@net-swift.com >
Link: https://lore.kernel.org/r/20240402021843.126192-1-duanqiangwen@net-swift.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2024-04-03 19:21:04 -07:00
Duanqiang Wen
e30cef001d
net: txgbe: fix clk_name exceed MAX_DEV_ID limits
...
txgbe register clk which name is i2c_designware.pci_dev_id(),
clk_name will be stored in clk_lookup_alloc. If PCIe bus number
is larger than 0x39, clk_name size will be larger than 20 bytes.
It exceeds clk_lookup_alloc MAX_DEV_ID limits. So the driver
shortened clk_name.
Fixes: b63f20485e ("net: txgbe: Register fixed rate clock")
Signed-off-by: Duanqiang Wen <duanqiangwen@net-swift.com >
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com >
Link: https://lore.kernel.org/r/20240313080634.459523-1-duanqiangwen@net-swift.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2024-03-14 13:49:02 +01:00
Jiawen Wu
0e71862a20
net: txgbe: fix to clear interrupt status after handling IRQ
...
GPIO EOI is not set to clear interrupt status after handling the
interrupt. It should be done in irq_chip->irq_ack, but this function
is not called in handle_nested_irq(). So executing function
txgbe_gpio_irq_ack() manually in txgbe_gpio_irq_handler().
Fixes: aefd013624 ("net: txgbe: use irq_domain for interrupt controller")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Link: https://lore.kernel.org/r/20240301092956.18544-2-jiawenwu@trustnetic.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2024-03-05 11:13:04 +01:00
Jiawen Wu
b4a2496c17
net: txgbe: fix GPIO interrupt blocking
...
The register of GPIO interrupt status is masked before MAC IRQ
is enabled. This is because of hardware deficiency. So manually
clear the interrupt status before using them. Otherwise, GPIO
interrupts will never be reported again. There is a workaround for
clearing interrupts to set GPIO EOI in txgbe_up_complete().
Fixes: aefd013624 ("net: txgbe: use irq_domain for interrupt controller")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Link: https://lore.kernel.org/r/20240301092956.18544-1-jiawenwu@trustnetic.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2024-03-05 11:13:04 +01:00
Jiawen Wu
aefd013624
net: txgbe: use irq_domain for interrupt controller
...
In the current interrupt controller, the MAC interrupt acts as the
parent interrupt in the GPIO IRQ chip. But when the number of Rx/Tx
ring changes, the PCI IRQ vector needs to be reallocated. Then this
interrupt controller would be corrupted. So use irq_domain structure
to avoid the above problem.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2024-01-27 14:31:55 +00:00
Jiawen Wu
937d46ecc5
net: wangxun: add ethtool_ops for channel number
...
Add support to get RX/TX queue number with ethtool -l, and set RX/TX
queue number with ethtool -L. Since interrupts need to be rescheduled,
adjust the allocation of msix enties.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2024-01-04 10:49:35 +00:00
Jiawen Wu
2fe2ca09da
net: wangxun: add flow control support
...
Add support to set pause params with ethtool -A and get pause
params with ethtool -a, for ethernet driver txgbe and ngbe.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk >
Signed-off-by: David S. Miller <davem@davemloft.net >
2024-01-04 10:49:35 +00:00
Jiawen Wu
4491c602fe
net: txgbe: use phylink bits added in libwx
...
Convert txgbe to use phylink and phylink_config added in libwx.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk >
Signed-off-by: David S. Miller <davem@davemloft.net >
2024-01-04 10:49:35 +00:00
Jiawen Wu
f557524029
net: wangxun: move MDIO bus implementation to the library
...
Move similar code of accessing MDIO bus from txgbe/ngbe to libwx.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Simon Horman <horms@kernel.org >
Link: https://lore.kernel.org/r/20230912031424.721386-1-jiawenwu@trustnetic.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-09-14 15:18:40 +02:00
Jiawen Wu
02b2a6f91b
net: txgbe: support copper NIC with external PHY
...
Wangxun SP chip supports to connect with external PHY (marvell 88x3310),
which links to 10GBASE-T/1000BASE-T/100BASE-T. Add the identification of
media types from subsystem device IDs. For sp_media_copper, register mdio
bus for the external PHY.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2023-08-25 07:42:59 +01:00
Jiawen Wu
a4414dd13f
net: txgbe: support switching mode to 1000BASE-X and SGMII
...
Disable data path before PCS VR reset while switching PCS mode, to prevent
the blocking of data path. Enable AN interrupt for CL37 auto-negotiation.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2023-08-25 07:42:59 +01:00
Xiongfeng Wang
d8c21ef7b2
net: txgbe: Use pci_dev_id() to simplify the code
...
PCI core API pci_dev_id() can be used to get the BDF number for a pci
device. We don't need to compose it manually. Use pci_dev_id() to
simplify the code a little bit.
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com >
Reviewed-by: Yang Yingliang <yangyingliang@huawei.com >
Reviewed-by: Simon Horman <horms@kernel.org >
Link: https://lore.kernel.org/r/20230808024931.147048-1-wangxiongfeng2@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org >
2023-08-09 13:03:27 -07:00
Jiawen Wu
08f08f9390
net: txgbe: Support phylink MAC layer
...
Add phylink support to Wangxun 10Gb Ethernet controller for the 10GBASE-R
interface.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00
Jiawen Wu
854cace613
net: txgbe: Implement phylink pcs
...
Register MDIO bus for PCS layer to use Synopsys designware XPCS, support
10GBASE-R interface to the controller.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Andrew Lunn <andrew@lunn.ch >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00
Jiawen Wu
b83c37315a
net: txgbe: Support GPIO to SFP socket
...
Register GPIO chip and handle GPIO IRQ for SFP socket.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00
Jiawen Wu
04d9423618
net: txgbe: Add SFP module identify
...
Register SFP platform device to get modules information.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Andrew Lunn <andrew@lunn.ch >
Reviewed-by: Piotr Raczynski <piotr.raczynski@intel.com >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00
Jiawen Wu
c625e72561
net: txgbe: Register I2C platform device
...
Register the platform device to use Designware I2C bus master driver.
Use regmap to read/write I2C device region from given base offset.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Andrew Lunn <andrew@lunn.ch >
Reviewed-by: Piotr Raczynski <piotr.raczynski@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00
Jiawen Wu
b63f20485e
net: txgbe: Register fixed rate clock
...
In order for I2C to be able to work in standard mode, register a fixed
rate clock for each I2C device.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Andrew Lunn <andrew@lunn.ch >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00
Jiawen Wu
c3e382ad6d
net: txgbe: Add software nodes to support phylink
...
Register software nodes for GPIO, I2C, SFP and PHYLINK. Define the
device properties.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com >
Reviewed-by: Andrew Lunn <andrew@lunn.ch >
Reviewed-by: Piotr Raczynski <piotr.raczynski@intel.com >
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com >
Signed-off-by: Paolo Abeni <pabeni@redhat.com >
2023-06-08 13:25:10 +02:00