Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: mscc: ocelot: convert port registers to regmap

At the moment, there are some minimal register differences between
VSC7514 Ocelot and VSC9959 Felix. To be precise, the PCS1G registers are
missing from Felix because it was integrated with an NXP PCS.

But with VSC9953 Seville (not yet introduced), the register differences
are more pronounced. The MAC registers are located at different offsets
within the DEV_GMII target. So we need to refactor the driver to keep a
regmap even for per-port registers. The callers of the ocelot_port_readl
and ocelot_port_writel were kept unchanged, only the implementation is
now more generic.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vladimir Oltean and committed by
David S. Miller
91c724cf 5d037b4d

+158 -99
+7 -6
drivers/net/dsa/ocelot/felix.c
··· 524 524 525 525 for (port = 0; port < num_phys_ports; port++) { 526 526 struct ocelot_port *ocelot_port; 527 - void __iomem *port_regs; 527 + struct regmap *target; 528 528 529 529 ocelot_port = devm_kzalloc(ocelot->dev, 530 530 sizeof(struct ocelot_port), ··· 541 541 res.start += switch_base; 542 542 res.end += switch_base; 543 543 544 - port_regs = devm_ioremap_resource(ocelot->dev, &res); 545 - if (IS_ERR(port_regs)) { 544 + target = ocelot_regmap_init(ocelot, &res); 545 + if (IS_ERR(target)) { 546 546 dev_err(ocelot->dev, 547 - "failed to map registers for port %d\n", port); 547 + "Failed to map memory space for port %d\n", 548 + port); 548 549 kfree(port_phy_modes); 549 - return PTR_ERR(port_regs); 550 + return PTR_ERR(target); 550 551 } 551 552 552 553 ocelot_port->phy_mode = port_phy_modes[port]; 553 554 ocelot_port->ocelot = ocelot; 554 - ocelot_port->regs = port_regs; 555 + ocelot_port->target = target; 555 556 ocelot->ports[port] = ocelot_port; 556 557 } 557 558
+45 -2
drivers/net/dsa/ocelot/felix_vsc9959.c
··· 329 329 REG(GCB_SOFT_RST, 0x000004), 330 330 }; 331 331 332 - static const u32 *vsc9959_regmap[] = { 332 + static const u32 vsc9959_dev_gmii_regmap[] = { 333 + REG(DEV_CLOCK_CFG, 0x0), 334 + REG(DEV_PORT_MISC, 0x4), 335 + REG(DEV_EVENTS, 0x8), 336 + REG(DEV_EEE_CFG, 0xc), 337 + REG(DEV_RX_PATH_DELAY, 0x10), 338 + REG(DEV_TX_PATH_DELAY, 0x14), 339 + REG(DEV_PTP_PREDICT_CFG, 0x18), 340 + REG(DEV_MAC_ENA_CFG, 0x1c), 341 + REG(DEV_MAC_MODE_CFG, 0x20), 342 + REG(DEV_MAC_MAXLEN_CFG, 0x24), 343 + REG(DEV_MAC_TAGS_CFG, 0x28), 344 + REG(DEV_MAC_ADV_CHK_CFG, 0x2c), 345 + REG(DEV_MAC_IFG_CFG, 0x30), 346 + REG(DEV_MAC_HDX_CFG, 0x34), 347 + REG(DEV_MAC_DBG_CFG, 0x38), 348 + REG(DEV_MAC_FC_MAC_LOW_CFG, 0x3c), 349 + REG(DEV_MAC_FC_MAC_HIGH_CFG, 0x40), 350 + REG(DEV_MAC_STICKY, 0x44), 351 + REG_RESERVED(PCS1G_CFG), 352 + REG_RESERVED(PCS1G_MODE_CFG), 353 + REG_RESERVED(PCS1G_SD_CFG), 354 + REG_RESERVED(PCS1G_ANEG_CFG), 355 + REG_RESERVED(PCS1G_ANEG_NP_CFG), 356 + REG_RESERVED(PCS1G_LB_CFG), 357 + REG_RESERVED(PCS1G_DBG_CFG), 358 + REG_RESERVED(PCS1G_CDET_CFG), 359 + REG_RESERVED(PCS1G_ANEG_STATUS), 360 + REG_RESERVED(PCS1G_ANEG_NP_STATUS), 361 + REG_RESERVED(PCS1G_LINK_STATUS), 362 + REG_RESERVED(PCS1G_LINK_DOWN_CNT), 363 + REG_RESERVED(PCS1G_STICKY), 364 + REG_RESERVED(PCS1G_DEBUG_STATUS), 365 + REG_RESERVED(PCS1G_LPI_CFG), 366 + REG_RESERVED(PCS1G_LPI_WAKE_ERROR_CNT), 367 + REG_RESERVED(PCS1G_LPI_STATUS), 368 + REG_RESERVED(PCS1G_TSTPAT_MODE_CFG), 369 + REG_RESERVED(PCS1G_TSTPAT_STATUS), 370 + REG_RESERVED(DEV_PCS_FX100_CFG), 371 + REG_RESERVED(DEV_PCS_FX100_STATUS), 372 + }; 373 + 374 + static const u32 *vsc9959_regmap[TARGET_MAX] = { 333 375 [ANA] = vsc9959_ana_regmap, 334 376 [QS] = vsc9959_qs_regmap, 335 377 [QSYS] = vsc9959_qsys_regmap, ··· 380 338 [S2] = vsc9959_s2_regmap, 381 339 [PTP] = vsc9959_ptp_regmap, 382 340 [GCB] = vsc9959_gcb_regmap, 341 + [DEV_GMII] = vsc9959_dev_gmii_regmap, 383 342 }; 384 343 385 344 /* Addresses are relative to the PCI device's base address */ 386 - static const struct resource vsc9959_target_io_res[] = { 345 + static const struct resource vsc9959_target_io_res[TARGET_MAX] = { 387 346 [ANA] = { 388 347 .start = 0x0280000, 389 348 .end = 0x028ffff,
+1 -2
drivers/net/ethernet/mscc/ocelot.h
··· 105 105 #define ocelot_field_write(ocelot, reg, val) regmap_field_write((ocelot)->regfields[(reg)], (val)) 106 106 #define ocelot_field_read(ocelot, reg, val) regmap_field_read((ocelot)->regfields[(reg)], (val)) 107 107 108 - int ocelot_probe_port(struct ocelot *ocelot, u8 port, 109 - void __iomem *regs, 108 + int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target, 110 109 struct phy_device *phy); 111 110 112 111 void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu,
+14 -2
drivers/net/ethernet/mscc/ocelot_io.c
··· 49 49 50 50 u32 ocelot_port_readl(struct ocelot_port *port, u32 reg) 51 51 { 52 - return readl(port->regs + reg); 52 + struct ocelot *ocelot = port->ocelot; 53 + u16 target = reg >> TARGET_OFFSET; 54 + u32 val; 55 + 56 + WARN_ON(!target); 57 + 58 + regmap_read(port->target, ocelot->map[target][reg & REG_MASK], &val); 59 + return val; 53 60 } 54 61 EXPORT_SYMBOL(ocelot_port_readl); 55 62 56 63 void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg) 57 64 { 58 - writel(val, port->regs + reg); 65 + struct ocelot *ocelot = port->ocelot; 66 + u16 target = reg >> TARGET_OFFSET; 67 + 68 + WARN_ON(!target); 69 + 70 + regmap_write(port->target, ocelot->map[target][reg & REG_MASK], val); 59 71 } 60 72 EXPORT_SYMBOL(ocelot_port_writel); 61 73
+2 -3
drivers/net/ethernet/mscc/ocelot_net.c
··· 1005 1005 .notifier_call = ocelot_switchdev_blocking_event, 1006 1006 }; 1007 1007 1008 - int ocelot_probe_port(struct ocelot *ocelot, u8 port, 1009 - void __iomem *regs, 1008 + int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target, 1010 1009 struct phy_device *phy) 1011 1010 { 1012 1011 struct ocelot_port_private *priv; ··· 1023 1024 priv->chip_port = port; 1024 1025 ocelot_port = &priv->port; 1025 1026 ocelot_port->ocelot = ocelot; 1026 - ocelot_port->regs = regs; 1027 + ocelot_port->target = target; 1027 1028 ocelot->ports[port] = ocelot_port; 1028 1029 1029 1030 dev->netdev_ops = &ocelot_port_netdev_ops;
+48 -5
drivers/net/ethernet/mscc/ocelot_vsc7514.c
··· 263 263 REG(PTP_CLK_CFG_ADJ_FREQ, 0x0000a8), 264 264 }; 265 265 266 - static const u32 *ocelot_regmap[] = { 266 + static const u32 ocelot_dev_gmii_regmap[] = { 267 + REG(DEV_CLOCK_CFG, 0x0), 268 + REG(DEV_PORT_MISC, 0x4), 269 + REG(DEV_EVENTS, 0x8), 270 + REG(DEV_EEE_CFG, 0xc), 271 + REG(DEV_RX_PATH_DELAY, 0x10), 272 + REG(DEV_TX_PATH_DELAY, 0x14), 273 + REG(DEV_PTP_PREDICT_CFG, 0x18), 274 + REG(DEV_MAC_ENA_CFG, 0x1c), 275 + REG(DEV_MAC_MODE_CFG, 0x20), 276 + REG(DEV_MAC_MAXLEN_CFG, 0x24), 277 + REG(DEV_MAC_TAGS_CFG, 0x28), 278 + REG(DEV_MAC_ADV_CHK_CFG, 0x2c), 279 + REG(DEV_MAC_IFG_CFG, 0x30), 280 + REG(DEV_MAC_HDX_CFG, 0x34), 281 + REG(DEV_MAC_DBG_CFG, 0x38), 282 + REG(DEV_MAC_FC_MAC_LOW_CFG, 0x3c), 283 + REG(DEV_MAC_FC_MAC_HIGH_CFG, 0x40), 284 + REG(DEV_MAC_STICKY, 0x44), 285 + REG(PCS1G_CFG, 0x48), 286 + REG(PCS1G_MODE_CFG, 0x4c), 287 + REG(PCS1G_SD_CFG, 0x50), 288 + REG(PCS1G_ANEG_CFG, 0x54), 289 + REG(PCS1G_ANEG_NP_CFG, 0x58), 290 + REG(PCS1G_LB_CFG, 0x5c), 291 + REG(PCS1G_DBG_CFG, 0x60), 292 + REG(PCS1G_CDET_CFG, 0x64), 293 + REG(PCS1G_ANEG_STATUS, 0x68), 294 + REG(PCS1G_ANEG_NP_STATUS, 0x6c), 295 + REG(PCS1G_LINK_STATUS, 0x70), 296 + REG(PCS1G_LINK_DOWN_CNT, 0x74), 297 + REG(PCS1G_STICKY, 0x78), 298 + REG(PCS1G_DEBUG_STATUS, 0x7c), 299 + REG(PCS1G_LPI_CFG, 0x80), 300 + REG(PCS1G_LPI_WAKE_ERROR_CNT, 0x84), 301 + REG(PCS1G_LPI_STATUS, 0x88), 302 + REG(PCS1G_TSTPAT_MODE_CFG, 0x8c), 303 + REG(PCS1G_TSTPAT_STATUS, 0x90), 304 + REG(DEV_PCS_FX100_CFG, 0x94), 305 + REG(DEV_PCS_FX100_STATUS, 0x98), 306 + }; 307 + 308 + static const u32 *ocelot_regmap[TARGET_MAX] = { 267 309 [ANA] = ocelot_ana_regmap, 268 310 [QS] = ocelot_qs_regmap, 269 311 [QSYS] = ocelot_qsys_regmap, ··· 313 271 [SYS] = ocelot_sys_regmap, 314 272 [S2] = ocelot_s2_regmap, 315 273 [PTP] = ocelot_ptp_regmap, 274 + [DEV_GMII] = ocelot_dev_gmii_regmap, 316 275 }; 317 276 318 277 static const struct reg_field ocelot_regfields[] = { ··· 991 948 struct device_node *phy_node; 992 949 phy_interface_t phy_mode; 993 950 struct phy_device *phy; 951 + struct regmap *target; 994 952 struct resource *res; 995 953 struct phy *serdes; 996 - void __iomem *regs; 997 954 char res_name[8]; 998 955 u32 port; 999 956 ··· 1004 961 1005 962 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 1006 963 res_name); 1007 - regs = devm_ioremap_resource(&pdev->dev, res); 1008 - if (IS_ERR(regs)) 964 + target = ocelot_regmap_init(ocelot, res); 965 + if (IS_ERR(target)) 1009 966 continue; 1010 967 1011 968 phy_node = of_parse_phandle(portnp, "phy-handle", 0); ··· 1017 974 if (!phy) 1018 975 continue; 1019 976 1020 - err = ocelot_probe_port(ocelot, port, regs, phy); 977 + err = ocelot_probe_port(ocelot, port, target, phy); 1021 978 if (err) { 1022 979 of_node_put(portnp); 1023 980 goto out_put_ports;
+41 -1
include/soc/mscc/ocelot.h
··· 126 126 HSIO, 127 127 PTP, 128 128 GCB, 129 + DEV_GMII, 129 130 TARGET_MAX, 130 131 }; 131 132 ··· 409 408 PTP_CLK_CFG_ADJ_CFG, 410 409 PTP_CLK_CFG_ADJ_FREQ, 411 410 GCB_SOFT_RST = GCB << TARGET_OFFSET, 411 + DEV_CLOCK_CFG = DEV_GMII << TARGET_OFFSET, 412 + DEV_PORT_MISC, 413 + DEV_EVENTS, 414 + DEV_EEE_CFG, 415 + DEV_RX_PATH_DELAY, 416 + DEV_TX_PATH_DELAY, 417 + DEV_PTP_PREDICT_CFG, 418 + DEV_MAC_ENA_CFG, 419 + DEV_MAC_MODE_CFG, 420 + DEV_MAC_MAXLEN_CFG, 421 + DEV_MAC_TAGS_CFG, 422 + DEV_MAC_ADV_CHK_CFG, 423 + DEV_MAC_IFG_CFG, 424 + DEV_MAC_HDX_CFG, 425 + DEV_MAC_DBG_CFG, 426 + DEV_MAC_FC_MAC_LOW_CFG, 427 + DEV_MAC_FC_MAC_HIGH_CFG, 428 + DEV_MAC_STICKY, 429 + PCS1G_CFG, 430 + PCS1G_MODE_CFG, 431 + PCS1G_SD_CFG, 432 + PCS1G_ANEG_CFG, 433 + PCS1G_ANEG_NP_CFG, 434 + PCS1G_LB_CFG, 435 + PCS1G_DBG_CFG, 436 + PCS1G_CDET_CFG, 437 + PCS1G_ANEG_STATUS, 438 + PCS1G_ANEG_NP_STATUS, 439 + PCS1G_LINK_STATUS, 440 + PCS1G_LINK_DOWN_CNT, 441 + PCS1G_STICKY, 442 + PCS1G_DEBUG_STATUS, 443 + PCS1G_LPI_CFG, 444 + PCS1G_LPI_WAKE_ERROR_CNT, 445 + PCS1G_LPI_STATUS, 446 + PCS1G_TSTPAT_MODE_CFG, 447 + PCS1G_TSTPAT_STATUS, 448 + DEV_PCS_FX100_CFG, 449 + DEV_PCS_FX100_STATUS, 412 450 }; 413 451 414 452 enum ocelot_regfield { ··· 534 494 struct ocelot_port { 535 495 struct ocelot *ocelot; 536 496 537 - void __iomem *regs; 497 + struct regmap *target; 538 498 539 499 bool vlan_aware; 540 500
-78
include/soc/mscc/ocelot_dev.h
··· 8 8 #ifndef _MSCC_OCELOT_DEV_H_ 9 9 #define _MSCC_OCELOT_DEV_H_ 10 10 11 - #define DEV_CLOCK_CFG 0x0 12 - 13 11 #define DEV_CLOCK_CFG_MAC_TX_RST BIT(7) 14 12 #define DEV_CLOCK_CFG_MAC_RX_RST BIT(6) 15 13 #define DEV_CLOCK_CFG_PCS_TX_RST BIT(5) ··· 17 19 #define DEV_CLOCK_CFG_LINK_SPEED(x) ((x) & GENMASK(1, 0)) 18 20 #define DEV_CLOCK_CFG_LINK_SPEED_M GENMASK(1, 0) 19 21 20 - #define DEV_PORT_MISC 0x4 21 - 22 22 #define DEV_PORT_MISC_FWD_ERROR_ENA BIT(4) 23 23 #define DEV_PORT_MISC_FWD_PAUSE_ENA BIT(3) 24 24 #define DEV_PORT_MISC_FWD_CTRL_ENA BIT(2) 25 25 #define DEV_PORT_MISC_DEV_LOOP_ENA BIT(1) 26 26 #define DEV_PORT_MISC_HDX_FAST_DIS BIT(0) 27 - 28 - #define DEV_EVENTS 0x8 29 - 30 - #define DEV_EEE_CFG 0xc 31 27 32 28 #define DEV_EEE_CFG_EEE_ENA BIT(22) 33 29 #define DEV_EEE_CFG_EEE_TIMER_AGE(x) (((x) << 15) & GENMASK(21, 15)) ··· 35 43 #define DEV_EEE_CFG_EEE_TIMER_HOLDOFF_X(x) (((x) & GENMASK(7, 1)) >> 1) 36 44 #define DEV_EEE_CFG_PORT_LPI BIT(0) 37 45 38 - #define DEV_RX_PATH_DELAY 0x10 39 - 40 - #define DEV_TX_PATH_DELAY 0x14 41 - 42 - #define DEV_PTP_PREDICT_CFG 0x18 43 - 44 46 #define DEV_PTP_PREDICT_CFG_PTP_PHY_PREDICT_CFG(x) (((x) << 4) & GENMASK(11, 4)) 45 47 #define DEV_PTP_PREDICT_CFG_PTP_PHY_PREDICT_CFG_M GENMASK(11, 4) 46 48 #define DEV_PTP_PREDICT_CFG_PTP_PHY_PREDICT_CFG_X(x) (((x) & GENMASK(11, 4)) >> 4) 47 49 #define DEV_PTP_PREDICT_CFG_PTP_PHASE_PREDICT_CFG(x) ((x) & GENMASK(3, 0)) 48 50 #define DEV_PTP_PREDICT_CFG_PTP_PHASE_PREDICT_CFG_M GENMASK(3, 0) 49 51 50 - #define DEV_MAC_ENA_CFG 0x1c 51 - 52 52 #define DEV_MAC_ENA_CFG_RX_ENA BIT(4) 53 53 #define DEV_MAC_ENA_CFG_TX_ENA BIT(0) 54 - 55 - #define DEV_MAC_MODE_CFG 0x20 56 54 57 55 #define DEV_MAC_MODE_CFG_FC_WORD_SYNC_ENA BIT(8) 58 56 #define DEV_MAC_MODE_CFG_GIGA_MODE_ENA BIT(4) 59 57 #define DEV_MAC_MODE_CFG_FDX_ENA BIT(0) 60 - 61 - #define DEV_MAC_MAXLEN_CFG 0x24 62 - 63 - #define DEV_MAC_TAGS_CFG 0x28 64 58 65 59 #define DEV_MAC_TAGS_CFG_TAG_ID(x) (((x) << 16) & GENMASK(31, 16)) 66 60 #define DEV_MAC_TAGS_CFG_TAG_ID_M GENMASK(31, 16) ··· 55 77 #define DEV_MAC_TAGS_CFG_VLAN_DBL_AWR_ENA BIT(1) 56 78 #define DEV_MAC_TAGS_CFG_VLAN_AWR_ENA BIT(0) 57 79 58 - #define DEV_MAC_ADV_CHK_CFG 0x2c 59 - 60 80 #define DEV_MAC_ADV_CHK_CFG_LEN_DROP_ENA BIT(0) 61 - 62 - #define DEV_MAC_IFG_CFG 0x30 63 81 64 82 #define DEV_MAC_IFG_CFG_RESTORE_OLD_IPG_CHECK BIT(17) 65 83 #define DEV_MAC_IFG_CFG_REDUCED_TX_IFG BIT(16) ··· 68 94 #define DEV_MAC_IFG_CFG_RX_IFG1(x) ((x) & GENMASK(3, 0)) 69 95 #define DEV_MAC_IFG_CFG_RX_IFG1_M GENMASK(3, 0) 70 96 71 - #define DEV_MAC_HDX_CFG 0x34 72 - 73 97 #define DEV_MAC_HDX_CFG_BYPASS_COL_SYNC BIT(26) 74 98 #define DEV_MAC_HDX_CFG_OB_ENA BIT(25) 75 99 #define DEV_MAC_HDX_CFG_WEXC_DIS BIT(24) ··· 79 107 #define DEV_MAC_HDX_CFG_LATE_COL_POS(x) ((x) & GENMASK(6, 0)) 80 108 #define DEV_MAC_HDX_CFG_LATE_COL_POS_M GENMASK(6, 0) 81 109 82 - #define DEV_MAC_DBG_CFG 0x38 83 - 84 110 #define DEV_MAC_DBG_CFG_TBI_MODE BIT(4) 85 111 #define DEV_MAC_DBG_CFG_IFG_CRS_EXT_CHK_ENA BIT(0) 86 - 87 - #define DEV_MAC_FC_MAC_LOW_CFG 0x3c 88 - 89 - #define DEV_MAC_FC_MAC_HIGH_CFG 0x40 90 - 91 - #define DEV_MAC_STICKY 0x44 92 112 93 113 #define DEV_MAC_STICKY_RX_IPG_SHRINK_STICKY BIT(9) 94 114 #define DEV_MAC_STICKY_RX_PREAM_SHRINK_STICKY BIT(8) ··· 93 129 #define DEV_MAC_STICKY_TX_FRM_LEN_OVR_STICKY BIT(1) 94 130 #define DEV_MAC_STICKY_TX_ABORT_STICKY BIT(0) 95 131 96 - #define PCS1G_CFG 0x48 97 - 98 132 #define PCS1G_CFG_LINK_STATUS_TYPE BIT(4) 99 133 #define PCS1G_CFG_AN_LINK_CTRL_ENA BIT(1) 100 134 #define PCS1G_CFG_PCS_ENA BIT(0) 101 135 102 - #define PCS1G_MODE_CFG 0x4c 103 - 104 136 #define PCS1G_MODE_CFG_UNIDIR_MODE_ENA BIT(4) 105 137 #define PCS1G_MODE_CFG_SGMII_MODE_ENA BIT(0) 106 - 107 - #define PCS1G_SD_CFG 0x50 108 138 109 139 #define PCS1G_SD_CFG_SD_SEL BIT(8) 110 140 #define PCS1G_SD_CFG_SD_POL BIT(4) 111 141 #define PCS1G_SD_CFG_SD_ENA BIT(0) 112 - 113 - #define PCS1G_ANEG_CFG 0x54 114 142 115 143 #define PCS1G_ANEG_CFG_ADV_ABILITY(x) (((x) << 16) & GENMASK(31, 16)) 116 144 #define PCS1G_ANEG_CFG_ADV_ABILITY_M GENMASK(31, 16) ··· 111 155 #define PCS1G_ANEG_CFG_ANEG_RESTART_ONE_SHOT BIT(1) 112 156 #define PCS1G_ANEG_CFG_ANEG_ENA BIT(0) 113 157 114 - #define PCS1G_ANEG_NP_CFG 0x58 115 - 116 158 #define PCS1G_ANEG_NP_CFG_NP_TX(x) (((x) << 16) & GENMASK(31, 16)) 117 159 #define PCS1G_ANEG_NP_CFG_NP_TX_M GENMASK(31, 16) 118 160 #define PCS1G_ANEG_NP_CFG_NP_TX_X(x) (((x) & GENMASK(31, 16)) >> 16) 119 161 #define PCS1G_ANEG_NP_CFG_NP_LOADED_ONE_SHOT BIT(0) 120 162 121 - #define PCS1G_LB_CFG 0x5c 122 - 123 163 #define PCS1G_LB_CFG_RA_ENA BIT(4) 124 164 #define PCS1G_LB_CFG_GMII_PHY_LB_ENA BIT(1) 125 165 #define PCS1G_LB_CFG_TBI_HOST_LB_ENA BIT(0) 126 166 127 - #define PCS1G_DBG_CFG 0x60 128 - 129 167 #define PCS1G_DBG_CFG_UDLT BIT(0) 130 168 131 - #define PCS1G_CDET_CFG 0x64 132 - 133 169 #define PCS1G_CDET_CFG_CDET_ENA BIT(0) 134 - 135 - #define PCS1G_ANEG_STATUS 0x68 136 170 137 171 #define PCS1G_ANEG_STATUS_LP_ADV_ABILITY(x) (((x) << 16) & GENMASK(31, 16)) 138 172 #define PCS1G_ANEG_STATUS_LP_ADV_ABILITY_M GENMASK(31, 16) ··· 131 185 #define PCS1G_ANEG_STATUS_PAGE_RX_STICKY BIT(3) 132 186 #define PCS1G_ANEG_STATUS_ANEG_COMPLETE BIT(0) 133 187 134 - #define PCS1G_ANEG_NP_STATUS 0x6c 135 - 136 - #define PCS1G_LINK_STATUS 0x70 137 - 138 188 #define PCS1G_LINK_STATUS_DELAY_VAR(x) (((x) << 12) & GENMASK(15, 12)) 139 189 #define PCS1G_LINK_STATUS_DELAY_VAR_M GENMASK(15, 12) 140 190 #define PCS1G_LINK_STATUS_DELAY_VAR_X(x) (((x) & GENMASK(15, 12)) >> 12) ··· 138 196 #define PCS1G_LINK_STATUS_LINK_STATUS BIT(4) 139 197 #define PCS1G_LINK_STATUS_SYNC_STATUS BIT(0) 140 198 141 - #define PCS1G_LINK_DOWN_CNT 0x74 142 - 143 - #define PCS1G_STICKY 0x78 144 - 145 199 #define PCS1G_STICKY_LINK_DOWN_STICKY BIT(4) 146 200 #define PCS1G_STICKY_OUT_OF_SYNC_STICKY BIT(0) 147 - 148 - #define PCS1G_DEBUG_STATUS 0x7c 149 - 150 - #define PCS1G_LPI_CFG 0x80 151 201 152 202 #define PCS1G_LPI_CFG_QSGMII_MS_SEL BIT(20) 153 203 #define PCS1G_LPI_CFG_RX_LPI_OUT_DIS BIT(17) ··· 149 215 #define PCS1G_LPI_CFG_LPI_RX_WTIM_X(x) (((x) & GENMASK(5, 4)) >> 4) 150 216 #define PCS1G_LPI_CFG_TX_ASSERT_LPIDLE BIT(0) 151 217 152 - #define PCS1G_LPI_WAKE_ERROR_CNT 0x84 153 - 154 - #define PCS1G_LPI_STATUS 0x88 155 - 156 218 #define PCS1G_LPI_STATUS_RX_LPI_FAIL BIT(16) 157 219 #define PCS1G_LPI_STATUS_RX_LPI_EVENT_STICKY BIT(12) 158 220 #define PCS1G_LPI_STATUS_RX_QUIET BIT(9) ··· 157 227 #define PCS1G_LPI_STATUS_TX_QUIET BIT(1) 158 228 #define PCS1G_LPI_STATUS_TX_LPI_MODE BIT(0) 159 229 160 - #define PCS1G_TSTPAT_MODE_CFG 0x8c 161 - 162 - #define PCS1G_TSTPAT_STATUS 0x90 163 - 164 230 #define PCS1G_TSTPAT_STATUS_JTP_ERR_CNT(x) (((x) << 8) & GENMASK(15, 8)) 165 231 #define PCS1G_TSTPAT_STATUS_JTP_ERR_CNT_M GENMASK(15, 8) 166 232 #define PCS1G_TSTPAT_STATUS_JTP_ERR_CNT_X(x) (((x) & GENMASK(15, 8)) >> 8) 167 233 #define PCS1G_TSTPAT_STATUS_JTP_ERR BIT(4) 168 234 #define PCS1G_TSTPAT_STATUS_JTP_LOCK BIT(0) 169 - 170 - #define DEV_PCS_FX100_CFG 0x94 171 235 172 236 #define DEV_PCS_FX100_CFG_SD_SEL BIT(26) 173 237 #define DEV_PCS_FX100_CFG_SD_POL BIT(25) ··· 182 258 #define DEV_PCS_FX100_CFG_FEFCHK_ENA BIT(2) 183 259 #define DEV_PCS_FX100_CFG_FEFGEN_ENA BIT(1) 184 260 #define DEV_PCS_FX100_CFG_PCS_ENA BIT(0) 185 - 186 - #define DEV_PCS_FX100_STATUS 0x98 187 261 188 262 #define DEV_PCS_FX100_STATUS_EDGE_POS_PTP(x) (((x) << 8) & GENMASK(11, 8)) 189 263 #define DEV_PCS_FX100_STATUS_EDGE_POS_PTP_M GENMASK(11, 8)