18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Microsemi Ocelot Switch driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2017 Microsemi Corporation
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _MSCC_OCELOT_QSYS_H_
98c2ecf20Sopenharmony_ci#define _MSCC_OCELOT_QSYS_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define QSYS_PORT_MODE_RSZ                                0x4
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define QSYS_PORT_MODE_DEQUEUE_DIS                        BIT(1)
148c2ecf20Sopenharmony_ci#define QSYS_PORT_MODE_DEQUEUE_LATE                       BIT(0)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define QSYS_STAT_CNT_CFG_TX_GREEN_CNT_MODE               BIT(5)
178c2ecf20Sopenharmony_ci#define QSYS_STAT_CNT_CFG_TX_YELLOW_CNT_MODE              BIT(4)
188c2ecf20Sopenharmony_ci#define QSYS_STAT_CNT_CFG_DROP_GREEN_CNT_MODE             BIT(3)
198c2ecf20Sopenharmony_ci#define QSYS_STAT_CNT_CFG_DROP_YELLOW_CNT_MODE            BIT(2)
208c2ecf20Sopenharmony_ci#define QSYS_STAT_CNT_CFG_DROP_COUNT_ONCE                 BIT(1)
218c2ecf20Sopenharmony_ci#define QSYS_STAT_CNT_CFG_DROP_COUNT_EGRESS               BIT(0)
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define QSYS_EEE_CFG_RSZ                                  0x4
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define QSYS_EEE_THRES_EEE_HIGH_BYTES(x)                  (((x) << 8) & GENMASK(15, 8))
268c2ecf20Sopenharmony_ci#define QSYS_EEE_THRES_EEE_HIGH_BYTES_M                   GENMASK(15, 8)
278c2ecf20Sopenharmony_ci#define QSYS_EEE_THRES_EEE_HIGH_BYTES_X(x)                (((x) & GENMASK(15, 8)) >> 8)
288c2ecf20Sopenharmony_ci#define QSYS_EEE_THRES_EEE_HIGH_FRAMES(x)                 ((x) & GENMASK(7, 0))
298c2ecf20Sopenharmony_ci#define QSYS_EEE_THRES_EEE_HIGH_FRAMES_M                  GENMASK(7, 0)
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#define QSYS_SW_STATUS_RSZ                                0x4
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define QSYS_EXT_CPU_CFG_EXT_CPU_PORT(x)                  (((x) << 8) & GENMASK(12, 8))
348c2ecf20Sopenharmony_ci#define QSYS_EXT_CPU_CFG_EXT_CPU_PORT_M                   GENMASK(12, 8)
358c2ecf20Sopenharmony_ci#define QSYS_EXT_CPU_CFG_EXT_CPU_PORT_X(x)                (((x) & GENMASK(12, 8)) >> 8)
368c2ecf20Sopenharmony_ci#define QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK(x)                  ((x) & GENMASK(7, 0))
378c2ecf20Sopenharmony_ci#define QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M                   GENMASK(7, 0)
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define QSYS_QMAP_GSZ                                     0x4
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_BASE(x)                              (((x) << 5) & GENMASK(12, 5))
428c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_BASE_M                               GENMASK(12, 5)
438c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_BASE_X(x)                            (((x) & GENMASK(12, 5)) >> 5)
448c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_IDX_SEL(x)                           (((x) << 2) & GENMASK(4, 2))
458c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_IDX_SEL_M                            GENMASK(4, 2)
468c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_IDX_SEL_X(x)                         (((x) & GENMASK(4, 2)) >> 2)
478c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_INP_SEL(x)                           ((x) & GENMASK(1, 0))
488c2ecf20Sopenharmony_ci#define QSYS_QMAP_SE_INP_SEL_M                            GENMASK(1, 0)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci#define QSYS_ISDX_SGRP_GSZ                                0x4
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci#define QSYS_TIMED_FRAME_ENTRY_GSZ                        0x4
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_CANCEL_SLOT(x)               (((x) << 9) & GENMASK(18, 9))
558c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_CANCEL_SLOT_M                GENMASK(18, 9)
568c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_CANCEL_SLOT_X(x)             (((x) & GENMASK(18, 9)) >> 9)
578c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_CANCEL_1SHOT                 BIT(8)
588c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_SLOT_MODE_MC                 BIT(7)
598c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_ENTRY_FAST_CNT(x)            ((x) & GENMASK(6, 0))
608c2ecf20Sopenharmony_ci#define QSYS_TFRM_MISC_TIMED_ENTRY_FAST_CNT_M             GENMASK(6, 0)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define QSYS_RED_PROFILE_RSZ                              0x4
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define QSYS_RED_PROFILE_WM_RED_LOW(x)                    (((x) << 8) & GENMASK(15, 8))
658c2ecf20Sopenharmony_ci#define QSYS_RED_PROFILE_WM_RED_LOW_M                     GENMASK(15, 8)
668c2ecf20Sopenharmony_ci#define QSYS_RED_PROFILE_WM_RED_LOW_X(x)                  (((x) & GENMASK(15, 8)) >> 8)
678c2ecf20Sopenharmony_ci#define QSYS_RED_PROFILE_WM_RED_HIGH(x)                   ((x) & GENMASK(7, 0))
688c2ecf20Sopenharmony_ci#define QSYS_RED_PROFILE_WM_RED_HIGH_M                    GENMASK(7, 0)
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci#define QSYS_RES_CFG_GSZ                                  0x8
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#define QSYS_RES_STAT_GSZ                                 0x8
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#define QSYS_RES_STAT_INUSE(x)                            (((x) << 12) & GENMASK(23, 12))
758c2ecf20Sopenharmony_ci#define QSYS_RES_STAT_INUSE_M                             GENMASK(23, 12)
768c2ecf20Sopenharmony_ci#define QSYS_RES_STAT_INUSE_X(x)                          (((x) & GENMASK(23, 12)) >> 12)
778c2ecf20Sopenharmony_ci#define QSYS_RES_STAT_MAXUSE(x)                           ((x) & GENMASK(11, 0))
788c2ecf20Sopenharmony_ci#define QSYS_RES_STAT_MAXUSE_M                            GENMASK(11, 0)
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#define QSYS_EVENTS_CORE_EV_FDC(x)                        (((x) << 2) & GENMASK(4, 2))
818c2ecf20Sopenharmony_ci#define QSYS_EVENTS_CORE_EV_FDC_M                         GENMASK(4, 2)
828c2ecf20Sopenharmony_ci#define QSYS_EVENTS_CORE_EV_FDC_X(x)                      (((x) & GENMASK(4, 2)) >> 2)
838c2ecf20Sopenharmony_ci#define QSYS_EVENTS_CORE_EV_FRD(x)                        ((x) & GENMASK(1, 0))
848c2ecf20Sopenharmony_ci#define QSYS_EVENTS_CORE_EV_FRD_M                         GENMASK(1, 0)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_0_RSZ                            0x4
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_1_RSZ                            0x4
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_2_RSZ                            0x4
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_3_RSZ                            0x4
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_4_RSZ                            0x4
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_5_RSZ                            0x4
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_6_RSZ                            0x4
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define QSYS_QMAXSDU_CFG_7_RSZ                            0x4
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_RSZ                           0x4
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_P_QUEUES(x)                   ((x) & GENMASK(7, 0))
1058c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_P_QUEUES_M                    GENMASK(7, 0)
1068c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE(x)           (((x) << 8) & GENMASK(9, 8))
1078c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_M            GENMASK(9, 8)
1088c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_X(x)         (((x) & GENMASK(9, 8)) >> 8)
1098c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_STRICT_IPG(x)                 (((x) << 12) & GENMASK(13, 12))
1108c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_STRICT_IPG_M                  GENMASK(13, 12)
1118c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_STRICT_IPG_X(x)               (((x) & GENMASK(13, 12)) >> 12)
1128c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_HOLD_ADVANCE(x)               (((x) << 16) & GENMASK(31, 16))
1138c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_HOLD_ADVANCE_M                GENMASK(31, 16)
1148c2ecf20Sopenharmony_ci#define QSYS_PREEMPTION_CFG_HOLD_ADVANCE_X(x)             (((x) & GENMASK(31, 16)) >> 16)
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#define QSYS_CIR_CFG_GSZ                                  0x80
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci#define QSYS_CIR_CFG_CIR_RATE(x)                          (((x) << 6) & GENMASK(20, 6))
1198c2ecf20Sopenharmony_ci#define QSYS_CIR_CFG_CIR_RATE_M                           GENMASK(20, 6)
1208c2ecf20Sopenharmony_ci#define QSYS_CIR_CFG_CIR_RATE_X(x)                        (((x) & GENMASK(20, 6)) >> 6)
1218c2ecf20Sopenharmony_ci#define QSYS_CIR_CFG_CIR_BURST(x)                         ((x) & GENMASK(5, 0))
1228c2ecf20Sopenharmony_ci#define QSYS_CIR_CFG_CIR_BURST_M                          GENMASK(5, 0)
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_GSZ                                  0x80
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_RATE(x)                          (((x) << 7) & GENMASK(21, 7))
1278c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_RATE_M                           GENMASK(21, 7)
1288c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_RATE_X(x)                        (((x) & GENMASK(21, 7)) >> 7)
1298c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_BURST(x)                         (((x) << 1) & GENMASK(6, 1))
1308c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_BURST_M                          GENMASK(6, 1)
1318c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_BURST_X(x)                       (((x) & GENMASK(6, 1)) >> 1)
1328c2ecf20Sopenharmony_ci#define QSYS_EIR_CFG_EIR_MARK_ENA                         BIT(0)
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_GSZ                                   0x80
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_DWRR_CNT(x)                        (((x) << 6) & GENMASK(9, 6))
1378c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_DWRR_CNT_M                         GENMASK(9, 6)
1388c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_DWRR_CNT_X(x)                      (((x) & GENMASK(9, 6)) >> 6)
1398c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_RR_ENA                             BIT(5)
1408c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_AVB_ENA                            BIT(4)
1418c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_FRM_MODE(x)                        (((x) << 2) & GENMASK(3, 2))
1428c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_FRM_MODE_M                         GENMASK(3, 2)
1438c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_FRM_MODE_X(x)                      (((x) & GENMASK(3, 2)) >> 2)
1448c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_EXC_ENA                            BIT(1)
1458c2ecf20Sopenharmony_ci#define QSYS_SE_CFG_SE_EXC_FWD                            BIT(0)
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci#define QSYS_SE_DWRR_CFG_GSZ                              0x80
1488c2ecf20Sopenharmony_ci#define QSYS_SE_DWRR_CFG_RSZ                              0x4
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_GSZ                               0x80
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_OUTP_IDX(x)                    (((x) << 17) & GENMASK(24, 17))
1538c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_OUTP_IDX_M                     GENMASK(24, 17)
1548c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_OUTP_IDX_X(x)                  (((x) & GENMASK(24, 17)) >> 17)
1558c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_INP_IDX(x)                     (((x) << 9) & GENMASK(16, 9))
1568c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_INP_IDX_M                      GENMASK(16, 9)
1578c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_INP_IDX_X(x)                   (((x) & GENMASK(16, 9)) >> 9)
1588c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_OUTP_CON(x)                    (((x) << 5) & GENMASK(8, 5))
1598c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_OUTP_CON_M                     GENMASK(8, 5)
1608c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_OUTP_CON_X(x)                  (((x) & GENMASK(8, 5)) >> 5)
1618c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_INP_CNT(x)                     (((x) << 1) & GENMASK(4, 1))
1628c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_INP_CNT_M                      GENMASK(4, 1)
1638c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_INP_CNT_X(x)                   (((x) & GENMASK(4, 1)) >> 1)
1648c2ecf20Sopenharmony_ci#define QSYS_SE_CONNECT_SE_TERMINAL                       BIT(0)
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_GSZ                             0x80
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_PRIO(x)                  (((x) << 11) & GENMASK(13, 11))
1698c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_PRIO_M                   GENMASK(13, 11)
1708c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_PRIO_X(x)                (((x) & GENMASK(13, 11)) >> 11)
1718c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_SPORT(x)                 (((x) << 7) & GENMASK(10, 7))
1728c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_SPORT_M                  GENMASK(10, 7)
1738c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_SPORT_X(x)               (((x) & GENMASK(10, 7)) >> 7)
1748c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_DPORT(x)                 (((x) << 3) & GENMASK(6, 3))
1758c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_DPORT_M                  GENMASK(6, 3)
1768c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_DPORT_X(x)               (((x) & GENMASK(6, 3)) >> 3)
1778c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_PRIO_ENA                 BIT(2)
1788c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_SPORT_ENA                BIT(1)
1798c2ecf20Sopenharmony_ci#define QSYS_SE_DLB_SENSE_SE_DLB_DPORT_ENA                BIT(0)
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci#define QSYS_CIR_STATE_GSZ                                0x80
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define QSYS_CIR_STATE_CIR_LVL(x)                         (((x) << 4) & GENMASK(25, 4))
1848c2ecf20Sopenharmony_ci#define QSYS_CIR_STATE_CIR_LVL_M                          GENMASK(25, 4)
1858c2ecf20Sopenharmony_ci#define QSYS_CIR_STATE_CIR_LVL_X(x)                       (((x) & GENMASK(25, 4)) >> 4)
1868c2ecf20Sopenharmony_ci#define QSYS_CIR_STATE_SHP_TIME(x)                        ((x) & GENMASK(3, 0))
1878c2ecf20Sopenharmony_ci#define QSYS_CIR_STATE_SHP_TIME_M                         GENMASK(3, 0)
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci#define QSYS_EIR_STATE_GSZ                                0x80
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci#define QSYS_SE_STATE_GSZ                                 0x80
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define QSYS_SE_STATE_SE_OUTP_LVL(x)                      (((x) << 1) & GENMASK(2, 1))
1948c2ecf20Sopenharmony_ci#define QSYS_SE_STATE_SE_OUTP_LVL_M                       GENMASK(2, 1)
1958c2ecf20Sopenharmony_ci#define QSYS_SE_STATE_SE_OUTP_LVL_X(x)                    (((x) & GENMASK(2, 1)) >> 1)
1968c2ecf20Sopenharmony_ci#define QSYS_SE_STATE_SE_WAS_YEL                          BIT(0)
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_SE_CONNECT_VLD                 BIT(8)
1998c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_FRM_ADJ(x)                     (((x) << 3) & GENMASK(7, 3))
2008c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_FRM_ADJ_M                      GENMASK(7, 3)
2018c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_FRM_ADJ_X(x)                   (((x) & GENMASK(7, 3)) >> 3)
2028c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_LEAK_DIS                       BIT(2)
2038c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_QSHP_EXC_ENA                   BIT(1)
2048c2ecf20Sopenharmony_ci#define QSYS_HSCH_MISC_CFG_PFC_BYP_UPD                    BIT(0)
2058c2ecf20Sopenharmony_ci
2068c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_RSZ                               0x4
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_ENABLE                            BIT(0)
2098c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_LINK_SPEED(x)                     (((x) << 4) & GENMASK(5, 4))
2108c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_LINK_SPEED_M                      GENMASK(5, 4)
2118c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_LINK_SPEED_X(x)                   (((x) & GENMASK(5, 4)) >> 4)
2128c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_INIT_GATE_STATE(x)                (((x) << 8) & GENMASK(15, 8))
2138c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_INIT_GATE_STATE_M                 GENMASK(15, 8)
2148c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_INIT_GATE_STATE_X(x)              (((x) & GENMASK(15, 8)) >> 8)
2158c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_SCH_TRAFFIC_QUEUES(x)             (((x) << 16) & GENMASK(23, 16))
2168c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_SCH_TRAFFIC_QUEUES_M              GENMASK(23, 16)
2178c2ecf20Sopenharmony_ci#define QSYS_TAG_CONFIG_SCH_TRAFFIC_QUEUES_X(x)           (((x) & GENMASK(23, 16)) >> 16)
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci#define QSYS_TAS_PARAM_CFG_CTRL_PORT_NUM(x)               ((x) & GENMASK(7, 0))
2208c2ecf20Sopenharmony_ci#define QSYS_TAS_PARAM_CFG_CTRL_PORT_NUM_M                GENMASK(7, 0)
2218c2ecf20Sopenharmony_ci#define QSYS_TAS_PARAM_CFG_CTRL_ALWAYS_GUARD_BAND_SCH_Q   BIT(8)
2228c2ecf20Sopenharmony_ci#define QSYS_TAS_PARAM_CFG_CTRL_CONFIG_CHANGE             BIT(16)
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define QSYS_PORT_MAX_SDU_RSZ                             0x4
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_ci#define QSYS_PARAM_CFG_REG_3_BASE_TIME_SEC_MSB(x)         ((x) & GENMASK(15, 0))
2278c2ecf20Sopenharmony_ci#define QSYS_PARAM_CFG_REG_3_BASE_TIME_SEC_MSB_M          GENMASK(15, 0)
2288c2ecf20Sopenharmony_ci#define QSYS_PARAM_CFG_REG_3_LIST_LENGTH(x)               (((x) << 16) & GENMASK(31, 16))
2298c2ecf20Sopenharmony_ci#define QSYS_PARAM_CFG_REG_3_LIST_LENGTH_M                GENMASK(31, 16)
2308c2ecf20Sopenharmony_ci#define QSYS_PARAM_CFG_REG_3_LIST_LENGTH_X(x)             (((x) & GENMASK(31, 16)) >> 16)
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ci#define QSYS_GCL_CFG_REG_1_GCL_ENTRY_NUM(x)               ((x) & GENMASK(5, 0))
2338c2ecf20Sopenharmony_ci#define QSYS_GCL_CFG_REG_1_GCL_ENTRY_NUM_M                GENMASK(5, 0)
2348c2ecf20Sopenharmony_ci#define QSYS_GCL_CFG_REG_1_GATE_STATE(x)                  (((x) << 8) & GENMASK(15, 8))
2358c2ecf20Sopenharmony_ci#define QSYS_GCL_CFG_REG_1_GATE_STATE_M                   GENMASK(15, 8)
2368c2ecf20Sopenharmony_ci#define QSYS_GCL_CFG_REG_1_GATE_STATE_X(x)                (((x) & GENMASK(15, 8)) >> 8)
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_3_BASE_TIME_SEC_MSB(x)      ((x) & GENMASK(15, 0))
2398c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_3_BASE_TIME_SEC_MSB_M       GENMASK(15, 0)
2408c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_3_LIST_LENGTH(x)            (((x) << 16) & GENMASK(31, 16))
2418c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_3_LIST_LENGTH_M             GENMASK(31, 16)
2428c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_3_LIST_LENGTH_X(x)          (((x) & GENMASK(31, 16)) >> 16)
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_8_CFG_CHG_TIME_SEC_MSB(x)   ((x) & GENMASK(15, 0))
2458c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_8_CFG_CHG_TIME_SEC_MSB_M    GENMASK(15, 0)
2468c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_8_OPER_GATE_STATE(x)        (((x) << 16) & GENMASK(23, 16))
2478c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_8_OPER_GATE_STATE_M         GENMASK(23, 16)
2488c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_8_OPER_GATE_STATE_X(x)      (((x) & GENMASK(23, 16)) >> 16)
2498c2ecf20Sopenharmony_ci#define QSYS_PARAM_STATUS_REG_8_CONFIG_PENDING            BIT(24)
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci#define QSYS_GCL_STATUS_REG_1_GCL_ENTRY_NUM(x)            ((x) & GENMASK(5, 0))
2528c2ecf20Sopenharmony_ci#define QSYS_GCL_STATUS_REG_1_GCL_ENTRY_NUM_M             GENMASK(5, 0)
2538c2ecf20Sopenharmony_ci#define QSYS_GCL_STATUS_REG_1_GATE_STATE(x)               (((x) << 8) & GENMASK(15, 8))
2548c2ecf20Sopenharmony_ci#define QSYS_GCL_STATUS_REG_1_GATE_STATE_M                GENMASK(15, 8)
2558c2ecf20Sopenharmony_ci#define QSYS_GCL_STATUS_REG_1_GATE_STATE_X(x)             (((x) & GENMASK(15, 8)) >> 8)
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci#endif
258