diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2023-01-23 22:12:36 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2023-01-23 22:12:37 -0800 |
| commit | 90e05ef3d17a8fcab534bf67109ef98b309b0d0f (patch) | |
| tree | 8443658cd4f29cf001d0cd936855b662f449f8f8 /drivers/net/dsa/microchip/lan937x_main.c | |
| parent | 3176eb82681ec9c8af31c6588ddedcc6cfb9e445 (diff) | |
| parent | 71d7920fb2d1d6cdaa6db58426783be02c9cb7bb (diff) | |
Merge branch 'net-dsa-microchip-add-support-for-credit-based-shaper'
Arun Ramadoss says:
====================
net: dsa: microchip: add support for credit based shaper
LAN937x switch family, KSZ9477, KSZ9567, KSZ9563 and KSZ8563 supports
the credit based shaper. But there were few difference between LAN937x and KSZ
switch like
- number of queues for LAN937x is 8 and for others it is 4.
- size of credit increment register for LAN937x is 24 and for other is 16-bit.
This patch series add the credit based shaper with common implementation for
LAN937x and KSZ swithes.
====================
Link: https://lore.kernel.org/r/20230120052135.32120-1-arun.ramadoss@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/microchip/lan937x_main.c')
| -rw-r--r-- | drivers/net/dsa/microchip/lan937x_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index 06d3d0308cba..399a3905e6ca 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -15,6 +15,7 @@ #include "lan937x_reg.h" #include "ksz_common.h" +#include "ksz9477.h" #include "lan937x.h" static int lan937x_cfg(struct ksz_device *dev, u32 addr, u8 bits, bool set) @@ -180,6 +181,9 @@ void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port) lan937x_port_cfg(dev, port, REG_PORT_CTRL_0, PORT_TAIL_TAG_ENABLE, true); + /* Enable the Port Queue split */ + ksz9477_port_queue_split(dev, port); + /* set back pressure for half duplex */ lan937x_port_cfg(dev, port, REG_PORT_MAC_CTRL_1, PORT_BACK_PRESSURE, true); @@ -336,6 +340,11 @@ void lan937x_setup_rgmii_delay(struct ksz_device *dev, int port) } } +int lan937x_tc_cbs_set_cinc(struct ksz_device *dev, int port, u32 val) +{ + return ksz_pwrite32(dev, port, REG_PORT_MTI_CREDIT_INCREMENT, val); +} + int lan937x_switch_init(struct ksz_device *dev) { dev->port_mask = (1 << dev->info->port_cnt) - 1; |
