Commit 4b20a07e authored by Oleksij Rempel's avatar Oleksij Rempel Committed by David S. Miller

net: dsa: microchip: ksz8795: add support for ksz88xx chips

We add support for the ksz8863 and ksz8873 chips which are
using the same register patterns but other offsets as the
ksz8795.
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f73e112
This diff is collapsed.
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
#define REG_CHIP_ID0 0x00 #define REG_CHIP_ID0 0x00
#define FAMILY_ID 0x87 #define KSZ87_FAMILY_ID 0x87
#define KSZ88_FAMILY_ID 0x88
#define REG_CHIP_ID1 0x01 #define REG_CHIP_ID1 0x01
...@@ -28,6 +29,12 @@ ...@@ -28,6 +29,12 @@
#define CHIP_ID_94 0x60 #define CHIP_ID_94 0x60
#define CHIP_ID_95 0x90 #define CHIP_ID_95 0x90
#define CHIP_ID_63 0x30
#define KSZ8863_REG_SW_RESET 0x43
#define KSZ8863_GLOBAL_SOFTWARE_RESET BIT(4)
#define KSZ8863_PCS_RESET BIT(0)
#define REG_SW_CTRL_0 0x02 #define REG_SW_CTRL_0 0x02
...@@ -267,6 +274,7 @@ ...@@ -267,6 +274,7 @@
#define REG_PORT_3_CTRL_9 0x3C #define REG_PORT_3_CTRL_9 0x3C
#define REG_PORT_4_CTRL_9 0x4C #define REG_PORT_4_CTRL_9 0x4C
#define PORT_AUTO_NEG_ENABLE BIT(7)
#define PORT_AUTO_NEG_DISABLE BIT(7) #define PORT_AUTO_NEG_DISABLE BIT(7)
#define PORT_FORCE_100_MBIT BIT(6) #define PORT_FORCE_100_MBIT BIT(6)
#define PORT_FORCE_FULL_DUPLEX BIT(5) #define PORT_FORCE_FULL_DUPLEX BIT(5)
...@@ -800,6 +808,7 @@ ...@@ -800,6 +808,7 @@
#define KSZ8795_ID_HI 0x0022 #define KSZ8795_ID_HI 0x0022
#define KSZ8795_ID_LO 0x1550 #define KSZ8795_ID_LO 0x1550
#define KSZ8863_ID_LO 0x1430
#define KSZ8795_SW_ID 0x8795 #define KSZ8795_SW_ID 0x8795
...@@ -830,7 +839,7 @@ ...@@ -830,7 +839,7 @@
#define KS_PRIO_IN_REG 4 #define KS_PRIO_IN_REG 4
#define KSZ8795_COUNTER_NUM 0x20 #define MIB_COUNTER_NUM 0x20
/* Common names used by other drivers */ /* Common names used by other drivers */
...@@ -876,26 +885,13 @@ ...@@ -876,26 +885,13 @@
#define MIB_COUNTER_VALUE 0x3FFFFFFF #define MIB_COUNTER_VALUE 0x3FFFFFFF
#define KS_MIB_TOTAL_RX_0 0x100 #define KSZ8795_MIB_TOTAL_RX_0 0x100
#define KS_MIB_TOTAL_TX_0 0x101 #define KSZ8795_MIB_TOTAL_TX_0 0x101
#define KS_MIB_PACKET_DROPPED_RX_0 0x102 #define KSZ8795_MIB_TOTAL_RX_1 0x104
#define KS_MIB_PACKET_DROPPED_TX_0 0x103 #define KSZ8795_MIB_TOTAL_TX_1 0x105
#define KS_MIB_TOTAL_RX_1 0x104
#define KS_MIB_TOTAL_TX_1 0x105 #define KSZ8863_MIB_PACKET_DROPPED_TX_0 0x100
#define KS_MIB_PACKET_DROPPED_TX_1 0x106 #define KSZ8863_MIB_PACKET_DROPPED_RX_0 0x105
#define KS_MIB_PACKET_DROPPED_RX_1 0x107
#define KS_MIB_TOTAL_RX_2 0x108
#define KS_MIB_TOTAL_TX_2 0x109
#define KS_MIB_PACKET_DROPPED_TX_2 0x10A
#define KS_MIB_PACKET_DROPPED_RX_2 0x10B
#define KS_MIB_TOTAL_RX_3 0x10C
#define KS_MIB_TOTAL_TX_3 0x10D
#define KS_MIB_PACKET_DROPPED_TX_3 0x10E
#define KS_MIB_PACKET_DROPPED_RX_3 0x10F
#define KS_MIB_TOTAL_RX_4 0x110
#define KS_MIB_TOTAL_TX_4 0x111
#define KS_MIB_PACKET_DROPPED_TX_4 0x112
#define KS_MIB_PACKET_DROPPED_RX_4 0x113
#define MIB_PACKET_DROPPED 0x0000FFFF #define MIB_PACKET_DROPPED 0x0000FFFF
......
...@@ -71,6 +71,7 @@ struct ksz_device { ...@@ -71,6 +71,7 @@ struct ksz_device {
int port_cnt; int port_cnt;
int reg_mib_cnt; int reg_mib_cnt;
int mib_cnt; int mib_cnt;
const struct mib_names *mib_names;
phy_interface_t compat_interface; phy_interface_t compat_interface;
u32 regs_size; u32 regs_size;
bool phy_errata_9477; bool phy_errata_9477;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment