| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Marvell 88E6xxx Switch Global (1) Registers support |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (c) 2016-2017 Savoir-faire Linux Inc. |
|---|
| 7 | 8 | * Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | 9 | */ |
|---|
| 14 | 10 | |
|---|
| 15 | 11 | #ifndef _MV88E6XXX_GLOBAL1_H |
|---|
| .. | .. |
|---|
| 113 | 109 | /* Offset 0x0A: ATU Control Register */ |
|---|
| 114 | 110 | #define MV88E6XXX_G1_ATU_CTL 0x0a |
|---|
| 115 | 111 | #define MV88E6XXX_G1_ATU_CTL_LEARN2ALL 0x0008 |
|---|
| 112 | +#define MV88E6161_G1_ATU_CTL_HASH_MASK 0x0003 |
|---|
| 116 | 113 | |
|---|
| 117 | 114 | /* Offset 0x0B: ATU Operation Register */ |
|---|
| 118 | 115 | #define MV88E6XXX_G1_ATU_OP 0x0b |
|---|
| .. | .. |
|---|
| 132 | 129 | #define MV88E6XXX_G1_ATU_OP_FULL_VIOLATION BIT(4) |
|---|
| 133 | 130 | |
|---|
| 134 | 131 | /* Offset 0x0C: ATU Data Register */ |
|---|
| 135 | | -#define MV88E6XXX_G1_ATU_DATA 0x0c |
|---|
| 136 | | -#define MV88E6XXX_G1_ATU_DATA_TRUNK 0x8000 |
|---|
| 137 | | -#define MV88E6XXX_G1_ATU_DATA_TRUNK_ID_MASK 0x00f0 |
|---|
| 138 | | -#define MV88E6XXX_G1_ATU_DATA_PORT_VECTOR_MASK 0x3ff0 |
|---|
| 139 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_MASK 0x000f |
|---|
| 140 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_UNUSED 0x0000 |
|---|
| 141 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_UC_MGMT 0x000d |
|---|
| 142 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC 0x000e |
|---|
| 143 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_UC_PRIO_OVER 0x000f |
|---|
| 144 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_MC_NONE_RATE 0x0005 |
|---|
| 145 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC 0x0007 |
|---|
| 146 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_MC_MGMT 0x000e |
|---|
| 147 | | -#define MV88E6XXX_G1_ATU_DATA_STATE_MC_PRIO_OVER 0x000f |
|---|
| 132 | +#define MV88E6XXX_G1_ATU_DATA 0x0c |
|---|
| 133 | +#define MV88E6XXX_G1_ATU_DATA_TRUNK 0x8000 |
|---|
| 134 | +#define MV88E6XXX_G1_ATU_DATA_TRUNK_ID_MASK 0x00f0 |
|---|
| 135 | +#define MV88E6XXX_G1_ATU_DATA_PORT_VECTOR_MASK 0x3ff0 |
|---|
| 136 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MASK 0x000f |
|---|
| 137 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_UNUSED 0x0000 |
|---|
| 138 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_1_OLDEST 0x0001 |
|---|
| 139 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_2 0x0002 |
|---|
| 140 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_3 0x0003 |
|---|
| 141 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_4 0x0004 |
|---|
| 142 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_5 0x0005 |
|---|
| 143 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_6 0x0006 |
|---|
| 144 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_AGE_7_NEWEST 0x0007 |
|---|
| 145 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_POLICY 0x0008 |
|---|
| 146 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_POLICY_PO 0x0009 |
|---|
| 147 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_AVB_NRL 0x000a |
|---|
| 148 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_AVB_NRL_PO 0x000b |
|---|
| 149 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_DA_MGMT 0x000c |
|---|
| 150 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_DA_MGMT_PO 0x000d |
|---|
| 151 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC 0x000e |
|---|
| 152 | +#define MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC_PO 0x000f |
|---|
| 153 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_UNUSED 0x0000 |
|---|
| 154 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_POLICY 0x0004 |
|---|
| 155 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_AVB_NRL 0x0005 |
|---|
| 156 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_DA_MGMT 0x0006 |
|---|
| 157 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC 0x0007 |
|---|
| 158 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_POLICY_PO 0x000c |
|---|
| 159 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_AVB_NRL_PO 0x000d |
|---|
| 160 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_DA_MGMT_PO 0x000e |
|---|
| 161 | +#define MV88E6XXX_G1_ATU_DATA_STATE_MC_STATIC_PO 0x000f |
|---|
| 148 | 162 | |
|---|
| 149 | 163 | /* Offset 0x0D: ATU MAC Address Register Bytes 0 & 1 |
|---|
| 150 | 164 | * Offset 0x0E: ATU MAC Address Register Bytes 2 & 3 |
|---|
| .. | .. |
|---|
| 190 | 204 | #define MV88E6390_G1_MONITOR_MGMT_CTL 0x1a |
|---|
| 191 | 205 | #define MV88E6390_G1_MONITOR_MGMT_CTL_UPDATE 0x8000 |
|---|
| 192 | 206 | #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_MASK 0x3f00 |
|---|
| 193 | | -#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C280000000XLO 0x0000 |
|---|
| 194 | | -#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C280000000XHI 0x0100 |
|---|
| 195 | | -#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C280000002XLO 0x0200 |
|---|
| 196 | | -#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C280000002XHI 0x0300 |
|---|
| 207 | +#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C200000XLO 0x0000 |
|---|
| 208 | +#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C200000XHI 0x0100 |
|---|
| 209 | +#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C200002XLO 0x0200 |
|---|
| 210 | +#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_0180C200002XHI 0x0300 |
|---|
| 197 | 211 | #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_INGRESS_DEST 0x2000 |
|---|
| 198 | 212 | #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_EGRESS_DEST 0x2100 |
|---|
| 199 | 213 | #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST 0x3000 |
|---|
| .. | .. |
|---|
| 254 | 268 | |
|---|
| 255 | 269 | int mv88e6xxx_g1_read(struct mv88e6xxx_chip *chip, int reg, u16 *val); |
|---|
| 256 | 270 | int mv88e6xxx_g1_write(struct mv88e6xxx_chip *chip, int reg, u16 val); |
|---|
| 257 | | -int mv88e6xxx_g1_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask); |
|---|
| 271 | +int mv88e6xxx_g1_wait_bit(struct mv88e6xxx_chip *chip, int reg, int |
|---|
| 272 | + bit, int val); |
|---|
| 273 | +int mv88e6xxx_g1_wait_mask(struct mv88e6xxx_chip *chip, int reg, |
|---|
| 274 | + u16 mask, u16 val); |
|---|
| 258 | 275 | |
|---|
| 259 | 276 | int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr); |
|---|
| 260 | 277 | |
|---|
| 261 | 278 | int mv88e6185_g1_reset(struct mv88e6xxx_chip *chip); |
|---|
| 262 | 279 | int mv88e6352_g1_reset(struct mv88e6xxx_chip *chip); |
|---|
| 280 | +int mv88e6250_g1_reset(struct mv88e6xxx_chip *chip); |
|---|
| 263 | 281 | |
|---|
| 264 | 282 | int mv88e6185_g1_ppu_enable(struct mv88e6xxx_chip *chip); |
|---|
| 265 | 283 | int mv88e6185_g1_ppu_disable(struct mv88e6xxx_chip *chip); |
|---|
| 266 | 284 | |
|---|
| 267 | | -int mv88e6xxx_g1_stats_wait(struct mv88e6xxx_chip *chip); |
|---|
| 285 | +int mv88e6185_g1_set_max_frame_size(struct mv88e6xxx_chip *chip, int mtu); |
|---|
| 286 | + |
|---|
| 268 | 287 | int mv88e6xxx_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port); |
|---|
| 269 | 288 | int mv88e6320_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port); |
|---|
| 270 | 289 | int mv88e6390_g1_stats_snapshot(struct mv88e6xxx_chip *chip, int port); |
|---|
| .. | .. |
|---|
| 272 | 291 | int mv88e6390_g1_stats_set_histogram(struct mv88e6xxx_chip *chip); |
|---|
| 273 | 292 | void mv88e6xxx_g1_stats_read(struct mv88e6xxx_chip *chip, int stat, u32 *val); |
|---|
| 274 | 293 | int mv88e6xxx_g1_stats_clear(struct mv88e6xxx_chip *chip); |
|---|
| 275 | | -int mv88e6095_g1_set_egress_port(struct mv88e6xxx_chip *chip, int port); |
|---|
| 276 | | -int mv88e6390_g1_set_egress_port(struct mv88e6xxx_chip *chip, int port); |
|---|
| 294 | +int mv88e6095_g1_set_egress_port(struct mv88e6xxx_chip *chip, |
|---|
| 295 | + enum mv88e6xxx_egress_direction direction, |
|---|
| 296 | + int port); |
|---|
| 297 | +int mv88e6390_g1_set_egress_port(struct mv88e6xxx_chip *chip, |
|---|
| 298 | + enum mv88e6xxx_egress_direction direction, |
|---|
| 299 | + int port); |
|---|
| 277 | 300 | int mv88e6095_g1_set_cpu_port(struct mv88e6xxx_chip *chip, int port); |
|---|
| 278 | 301 | int mv88e6390_g1_set_cpu_port(struct mv88e6xxx_chip *chip, int port); |
|---|
| 279 | 302 | int mv88e6390_g1_mgmt_rsvd2cpu(struct mv88e6xxx_chip *chip); |
|---|
| 280 | 303 | |
|---|
| 281 | 304 | int mv88e6085_g1_ip_pri_map(struct mv88e6xxx_chip *chip); |
|---|
| 305 | + |
|---|
| 282 | 306 | int mv88e6085_g1_ieee_pri_map(struct mv88e6xxx_chip *chip); |
|---|
| 307 | +int mv88e6250_g1_ieee_pri_map(struct mv88e6xxx_chip *chip); |
|---|
| 283 | 308 | |
|---|
| 284 | 309 | int mv88e6185_g1_set_cascade_port(struct mv88e6xxx_chip *chip, int port); |
|---|
| 285 | 310 | |
|---|
| .. | .. |
|---|
| 301 | 326 | bool all); |
|---|
| 302 | 327 | int mv88e6xxx_g1_atu_prob_irq_setup(struct mv88e6xxx_chip *chip); |
|---|
| 303 | 328 | void mv88e6xxx_g1_atu_prob_irq_free(struct mv88e6xxx_chip *chip); |
|---|
| 329 | +int mv88e6165_g1_atu_get_hash(struct mv88e6xxx_chip *chip, u8 *hash); |
|---|
| 330 | +int mv88e6165_g1_atu_set_hash(struct mv88e6xxx_chip *chip, u8 hash); |
|---|
| 304 | 331 | |
|---|
| 305 | 332 | int mv88e6185_g1_vtu_getnext(struct mv88e6xxx_chip *chip, |
|---|
| 306 | 333 | struct mv88e6xxx_vtu_entry *entry); |
|---|
| 307 | 334 | int mv88e6185_g1_vtu_loadpurge(struct mv88e6xxx_chip *chip, |
|---|
| 335 | + struct mv88e6xxx_vtu_entry *entry); |
|---|
| 336 | +int mv88e6250_g1_vtu_getnext(struct mv88e6xxx_chip *chip, |
|---|
| 337 | + struct mv88e6xxx_vtu_entry *entry); |
|---|
| 338 | +int mv88e6250_g1_vtu_loadpurge(struct mv88e6xxx_chip *chip, |
|---|
| 308 | 339 | struct mv88e6xxx_vtu_entry *entry); |
|---|
| 309 | 340 | int mv88e6352_g1_vtu_getnext(struct mv88e6xxx_chip *chip, |
|---|
| 310 | 341 | struct mv88e6xxx_vtu_entry *entry); |
|---|
| .. | .. |
|---|
| 317 | 348 | int mv88e6xxx_g1_vtu_flush(struct mv88e6xxx_chip *chip); |
|---|
| 318 | 349 | int mv88e6xxx_g1_vtu_prob_irq_setup(struct mv88e6xxx_chip *chip); |
|---|
| 319 | 350 | void mv88e6xxx_g1_vtu_prob_irq_free(struct mv88e6xxx_chip *chip); |
|---|
| 351 | +int mv88e6xxx_g1_atu_get_next(struct mv88e6xxx_chip *chip, u16 fid); |
|---|
| 320 | 352 | |
|---|
| 321 | 353 | #endif /* _MV88E6XXX_GLOBAL1_H */ |
|---|