1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Microchip lan969x Switch driver
4 * Copyright (c) 2024 Microchip Technology Inc. and its subsidiaries.
10 #include "../sparx5/sparx5_main.h"
11 #include "../sparx5/sparx5_regs.h"
12 #include "../sparx5/sparx5_vcap_impl.h"
15 extern const struct sparx5_match_data lan969x_desc
;
17 /* lan969x_vcap_ag_api.c */
18 extern const struct vcap_statistics lan969x_vcap_stats
;
19 extern const struct vcap_info lan969x_vcaps
[];
21 /* lan969x_vcap_impl.c */
22 extern const struct sparx5_vcap_inst lan969x_vcap_inst_cfg
[];
25 extern const unsigned int lan969x_tsize
[TSIZE_LAST
];
26 extern const unsigned int lan969x_raddr
[RADDR_LAST
];
27 extern const unsigned int lan969x_rcnt
[RCNT_LAST
];
28 extern const unsigned int lan969x_gaddr
[GADDR_LAST
];
29 extern const unsigned int lan969x_gcnt
[GCNT_LAST
];
30 extern const unsigned int lan969x_gsize
[GSIZE_LAST
];
31 extern const unsigned int lan969x_fpos
[FPOS_LAST
];
32 extern const unsigned int lan969x_fsize
[FSIZE_LAST
];
34 static inline bool lan969x_port_is_2g5(int portno
)
36 return portno
== 1 || portno
== 2 || portno
== 3 ||
37 portno
== 5 || portno
== 6 || portno
== 7 ||
38 portno
== 10 || portno
== 11 || portno
== 14 ||
39 portno
== 15 || portno
== 18 || portno
== 19 ||
40 portno
== 22 || portno
== 23;
43 static inline bool lan969x_port_is_5g(int portno
)
45 return portno
== 9 || portno
== 13 || portno
== 17 ||
49 static inline bool lan969x_port_is_10g(int portno
)
51 return portno
== 0 || portno
== 4 || portno
== 8 ||
52 portno
== 12 || portno
== 16 || portno
== 20 ||
53 portno
== 24 || portno
== 25 || portno
== 26 ||
57 static inline bool lan969x_port_is_25g(int portno
)
62 /* lan969x_calendar.c */
63 int lan969x_dsm_calendar_calc(struct sparx5
*sparx5
, u32 taxi
,
64 struct sparx5_calendar_data
*data
);