@@ -9640,18 +9640,10 @@ static inline void mlxsw_reg_mtbr_temp_unpack(char *payload, int rec_ind,
9640
9640
*/
9641
9641
9642
9642
#define MLXSW_REG_MCIA_ID 0x9014
9643
- #define MLXSW_REG_MCIA_LEN 0x40
9643
+ #define MLXSW_REG_MCIA_LEN 0x94
9644
9644
9645
9645
MLXSW_REG_DEFINE (mcia , MLXSW_REG_MCIA_ID , MLXSW_REG_MCIA_LEN );
9646
9646
9647
- /* reg_mcia_l
9648
- * Lock bit. Setting this bit will lock the access to the specific
9649
- * cable. Used for updating a full page in a cable EPROM. Any access
9650
- * other then subsequence writes will fail while the port is locked.
9651
- * Access: RW
9652
- */
9653
- MLXSW_ITEM32 (reg , mcia , l , 0x00 , 31 , 1 );
9654
-
9655
9647
/* reg_mcia_module
9656
9648
* Module number.
9657
9649
* Access: Index
@@ -9716,7 +9708,6 @@ MLXSW_ITEM32(reg, mcia, size, 0x08, 0, 16);
9716
9708
9717
9709
#define MLXSW_REG_MCIA_EEPROM_PAGE_LENGTH 256
9718
9710
#define MLXSW_REG_MCIA_EEPROM_UP_PAGE_LENGTH 128
9719
- #define MLXSW_REG_MCIA_EEPROM_SIZE 48
9720
9711
#define MLXSW_REG_MCIA_I2C_ADDR_LOW 0x50
9721
9712
#define MLXSW_REG_MCIA_I2C_ADDR_HIGH 0x51
9722
9713
#define MLXSW_REG_MCIA_PAGE0_LO_OFF 0xa0
@@ -9753,7 +9744,7 @@ enum mlxsw_reg_mcia_eeprom_module_info {
9753
9744
* Bytes to read/write.
9754
9745
* Access: RW
9755
9746
*/
9756
- MLXSW_ITEM_BUF (reg , mcia , eeprom , 0x10 , MLXSW_REG_MCIA_EEPROM_SIZE );
9747
+ MLXSW_ITEM_BUF (reg , mcia , eeprom , 0x10 , 128 );
9757
9748
9758
9749
/* This is used to access the optional upper pages (1-3) in the QSFP+
9759
9750
* memory map. Page 1 is available on offset 256 through 383, page 2 -
@@ -9764,14 +9755,12 @@ MLXSW_ITEM_BUF(reg, mcia, eeprom, 0x10, MLXSW_REG_MCIA_EEPROM_SIZE);
9764
9755
MLXSW_REG_MCIA_EEPROM_UP_PAGE_LENGTH + 1)
9765
9756
9766
9757
static inline void mlxsw_reg_mcia_pack (char * payload , u8 slot_index , u8 module ,
9767
- u8 lock , u8 page_number ,
9768
- u16 device_addr , u8 size ,
9758
+ u8 page_number , u16 device_addr , u8 size ,
9769
9759
u8 i2c_device_addr )
9770
9760
{
9771
9761
MLXSW_REG_ZERO (mcia , payload );
9772
9762
mlxsw_reg_mcia_slot_set (payload , slot_index );
9773
9763
mlxsw_reg_mcia_module_set (payload , module );
9774
- mlxsw_reg_mcia_l_set (payload , lock );
9775
9764
mlxsw_reg_mcia_page_number_set (payload , page_number );
9776
9765
mlxsw_reg_mcia_device_address_set (payload , device_addr );
9777
9766
mlxsw_reg_mcia_size_set (payload , size );
@@ -10581,6 +10570,79 @@ static inline void mlxsw_reg_mcda_pack(char *payload, u32 update_handle,
10581
10570
mlxsw_reg_mcda_data_set (payload , i , * (u32 * ) & data [i * 4 ]);
10582
10571
}
10583
10572
10573
+ /* MCAM - Management Capabilities Mask Register
10574
+ * --------------------------------------------
10575
+ * Reports the device supported management features.
10576
+ */
10577
+ #define MLXSW_REG_MCAM_ID 0x907F
10578
+ #define MLXSW_REG_MCAM_LEN 0x48
10579
+
10580
+ MLXSW_REG_DEFINE (mcam , MLXSW_REG_MCAM_ID , MLXSW_REG_MCAM_LEN );
10581
+
10582
+ enum mlxsw_reg_mcam_feature_group {
10583
+ /* Enhanced features. */
10584
+ MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES ,
10585
+ };
10586
+
10587
+ /* reg_mcam_feature_group
10588
+ * Feature list mask index.
10589
+ * Access: Index
10590
+ */
10591
+ MLXSW_ITEM32 (reg , mcam , feature_group , 0x00 , 16 , 8 );
10592
+
10593
+ enum mlxsw_reg_mcam_mng_feature_cap_mask_bits {
10594
+ /* If set, MCIA supports 128 bytes payloads. Otherwise, 48 bytes. */
10595
+ MLXSW_REG_MCAM_MCIA_128B = 34 ,
10596
+ };
10597
+
10598
+ #define MLXSW_REG_BYTES_PER_DWORD 0x4
10599
+
10600
+ /* reg_mcam_mng_feature_cap_mask
10601
+ * Supported port's enhanced features.
10602
+ * Based on feature_group index.
10603
+ * When bit is set, the feature is supported in the device.
10604
+ * Access: RO
10605
+ */
10606
+ #define MLXSW_REG_MCAM_MNG_FEATURE_CAP_MASK_DWORD (_dw_num , _offset ) \
10607
+ MLXSW_ITEM_BIT_ARRAY(reg, mcam, mng_feature_cap_mask_dw##_dw_num, \
10608
+ _offset, MLXSW_REG_BYTES_PER_DWORD, 1)
10609
+
10610
+ /* The access to the bits in the field 'mng_feature_cap_mask' is not same to
10611
+ * other mask fields in other registers. In most of the cases bit #0 is the
10612
+ * first one in the last dword. In MCAM register, the first dword contains bits
10613
+ * #0-#31 and so on, so the access to the bits is simpler using bit array per
10614
+ * dword. Declare each dword of 'mng_feature_cap_mask' field separately.
10615
+ */
10616
+ MLXSW_REG_MCAM_MNG_FEATURE_CAP_MASK_DWORD (0 , 0x28 );
10617
+ MLXSW_REG_MCAM_MNG_FEATURE_CAP_MASK_DWORD (1 , 0x2C );
10618
+ MLXSW_REG_MCAM_MNG_FEATURE_CAP_MASK_DWORD (2 , 0x30 );
10619
+ MLXSW_REG_MCAM_MNG_FEATURE_CAP_MASK_DWORD (3 , 0x34 );
10620
+
10621
+ static inline void
10622
+ mlxsw_reg_mcam_pack (char * payload , enum mlxsw_reg_mcam_feature_group feat_group )
10623
+ {
10624
+ MLXSW_REG_ZERO (mcam , payload );
10625
+ mlxsw_reg_mcam_feature_group_set (payload , feat_group );
10626
+ }
10627
+
10628
+ static inline void
10629
+ mlxsw_reg_mcam_unpack (char * payload ,
10630
+ enum mlxsw_reg_mcam_mng_feature_cap_mask_bits bit ,
10631
+ bool * p_mng_feature_cap_val )
10632
+ {
10633
+ int offset = bit % (MLXSW_REG_BYTES_PER_DWORD * BITS_PER_BYTE );
10634
+ int dword = bit / (MLXSW_REG_BYTES_PER_DWORD * BITS_PER_BYTE );
10635
+ u8 (* getters [])(const char * , u16 ) = {
10636
+ mlxsw_reg_mcam_mng_feature_cap_mask_dw0_get ,
10637
+ mlxsw_reg_mcam_mng_feature_cap_mask_dw1_get ,
10638
+ mlxsw_reg_mcam_mng_feature_cap_mask_dw2_get ,
10639
+ mlxsw_reg_mcam_mng_feature_cap_mask_dw3_get ,
10640
+ };
10641
+
10642
+ if (!WARN_ON_ONCE (dword >= ARRAY_SIZE (getters )))
10643
+ * p_mng_feature_cap_val = getters [dword ](payload , offset );
10644
+ }
10645
+
10584
10646
/* MPSC - Monitoring Packet Sampling Configuration Register
10585
10647
* --------------------------------------------------------
10586
10648
* MPSC Register is used to configure the Packet Sampling mechanism.
@@ -12974,10 +13036,11 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
12974
13036
MLXSW_REG (mcion ),
12975
13037
MLXSW_REG (mtpps ),
12976
13038
MLXSW_REG (mtutc ),
12977
- MLXSW_REG (mpsc ),
12978
13039
MLXSW_REG (mcqi ),
12979
13040
MLXSW_REG (mcc ),
12980
13041
MLXSW_REG (mcda ),
13042
+ MLXSW_REG (mcam ),
13043
+ MLXSW_REG (mpsc ),
12981
13044
MLXSW_REG (mgpc ),
12982
13045
MLXSW_REG (mprs ),
12983
13046
MLXSW_REG (mogcr ),
0 commit comments