diff --git a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/port_config.ini b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/port_config.ini new file mode 100644 index 0000000000..39f5c8f3a3 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/port_config.ini @@ -0,0 +1,55 @@ +# name lanes alias index +Ethernet0 1 twentyfiveGigE1 1 +Ethernet1 2 twentyfiveGigE2 2 +Ethernet2 3 twentyfiveGigE3 3 +Ethernet3 4 twentyfiveGigE4 4 +Ethernet4 5 twentyfiveGigE5 5 +Ethernet5 6 twentyfiveGigE6 6 +Ethernet6 7 twentyfiveGigE7 7 +Ethernet7 8 twentyfiveGigE8 8 +Ethernet8 9 twentyfiveGigE9 9 +Ethernet9 10 twentyfiveGigE10 10 +Ethernet10 11 twentyfiveGigE11 11 +Ethernet11 12 twentyfiveGigE12 12 +Ethernet12 13 twentyfiveGigE13 13 +Ethernet13 14 twentyfiveGigE14 14 +Ethernet14 15 twentyfiveGigE15 15 +Ethernet15 16 twentyfiveGigE16 16 +Ethernet16 17 twentyfiveGigE17 17 +Ethernet17 18 twentyfiveGigE18 18 +Ethernet18 19 twentyfiveGigE19 19 +Ethernet19 20 twentyfiveGigE20 20 +Ethernet20 21 twentyfiveGigE21 21 +Ethernet21 22 twentyfiveGigE22 22 +Ethernet22 23 twentyfiveGigE23 23 +Ethernet23 24 twentyfiveGigE24 24 +Ethernet24 53 twentyfiveGigE25 25 +Ethernet25 54 twentyfiveGigE26 26 +Ethernet26 55 twentyfiveGigE27 27 +Ethernet27 56 twentyfiveGigE28 28 +Ethernet28 57 twentyfiveGigE29 29 +Ethernet29 58 twentyfiveGigE30 30 +Ethernet30 59 twentyfiveGigE31 31 +Ethernet31 60 twentyfiveGigE32 32 +Ethernet32 61 twentyfiveGigE33 33 +Ethernet33 62 twentyfiveGigE34 34 +Ethernet34 63 twentyfiveGigE35 35 +Ethernet35 64 twentyfiveGigE36 36 +Ethernet36 65 twentyfiveGigE37 37 +Ethernet37 66 twentyfiveGigE38 38 +Ethernet38 67 twentyfiveGigE39 39 +Ethernet39 68 twentyfiveGigE40 40 +Ethernet40 69 twentyfiveGigE41 41 +Ethernet41 70 twentyfiveGigE42 42 +Ethernet42 71 twentyfiveGigE43 43 +Ethernet43 72 twentyfiveGigE44 44 +Ethernet44 73 twentyfiveGigE45 45 +Ethernet45 74 twentyfiveGigE46 46 +Ethernet46 75 twentyfiveGigE47 47 +Ethernet47 76 twentyfiveGigE48 48 +Ethernet48 29,30,31,32 hundredGigE49 49 +Ethernet52 33,34,35,36 hundredGigE50 53 +Ethernet56 37,38,39,40 hundredGigE51 57 +Ethernet60 41,42,43,44 hundredGigE52 61 +Ethernet64 45,46,47,48 hundredGigE53 65 +Ethernet68 49,50,51,52 hundredGigE54 69 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile new file mode 100644 index 0000000000..04c02ee586 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/etc/bcm/td3-as5835-48x10G+6x100G.config.bcm diff --git a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/td3-as5835-48x10G+6x100G.config.bcm b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/td3-as5835-48x10G+6x100G.config.bcm new file mode 100644 index 0000000000..e72a490b04 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/td3-as5835-48x10G+6x100G.config.bcm @@ -0,0 +1,467 @@ +#polarity/lanemap is using TH2 style. +core_clock_frequency=1525 +dpp_clock_ratio=2:3 + +ptp_ts_pll_fref=50000000 +ptp_bs_fref_0=50000000 +ptp_bs_fref_1=50000000 + +oversubscribe_mode=1 + +pbmp_xport_xe=0x1FFFFFFFFFFFFFFFE + +parity_enable=0 +mem_cache_enable=0 + +l2_mem_entries=32768 +#l3_mem_entries=49152 +#fpem_mem_entries=16384 +l2xmsg_mode=1 + +#FC0 +dport_map_port_1=1 +dport_map_port_2=2 +dport_map_port_3=3 +dport_map_port_4=4 +portmap_1=1:10 +portmap_2=2:10 +portmap_3=3:10 +portmap_4=4:10 +phy_chain_rx_lane_map_physical{1.0}=0x0123 +phy_chain_rx_lane_map_physical{2.0}=0x0123 +phy_chain_rx_lane_map_physical{3.0}=0x0123 +phy_chain_rx_lane_map_physical{4.0}=0x0123 +phy_chain_tx_lane_map_physical{1.0}=0x0123 +phy_chain_tx_lane_map_physical{2.0}=0x0123 +phy_chain_tx_lane_map_physical{3.0}=0x0123 +phy_chain_tx_lane_map_physical{4.0}=0x0123 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{2.0}=0x1 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 + +#FC1 +dport_map_port_5=5 +dport_map_port_6=6 +dport_map_port_7=7 +dport_map_port_8=8 +portmap_5=5:10 +portmap_6=6:10 +portmap_7=7:10 +portmap_8=8:10 +phy_chain_rx_lane_map_physical{5.0}=0x0123 +phy_chain_rx_lane_map_physical{6.0}=0x0123 +phy_chain_rx_lane_map_physical{7.0}=0x0123 +phy_chain_rx_lane_map_physical{8.0}=0x0123 +phy_chain_tx_lane_map_physical{5.0}=0x0123 +phy_chain_tx_lane_map_physical{6.0}=0x0123 +phy_chain_tx_lane_map_physical{7.0}=0x0123 +phy_chain_tx_lane_map_physical{8.0}=0x0123 +phy_chain_rx_polarity_flip_physical{5.0}=0x0 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x0 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x0 +phy_chain_tx_polarity_flip_physical{8.0}=0x1 + +#FC2 +dport_map_port_9=9 +dport_map_port_10=10 +dport_map_port_11=11 +dport_map_port_12=12 +portmap_9=9:10 +portmap_10=10:10 +portmap_11=11:10 +portmap_12=12:10 +phy_chain_rx_lane_map_physical{9.0}=0x0123 +phy_chain_rx_lane_map_physical{10.0}=0x0123 +phy_chain_rx_lane_map_physical{11.0}=0x0123 +phy_chain_rx_lane_map_physical{12.0}=0x0123 +phy_chain_tx_lane_map_physical{9.0}=0x0123 +phy_chain_tx_lane_map_physical{10.0}=0x0123 +phy_chain_tx_lane_map_physical{11.0}=0x0123 +phy_chain_tx_lane_map_physical{12.0}=0x0123 +phy_chain_rx_polarity_flip_physical{9.0}=0x0 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x0 +phy_chain_rx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{11.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x1 + +#FC3 +dport_map_port_13=13 +dport_map_port_14=14 +dport_map_port_15=15 +dport_map_port_16=16 +portmap_13=13:10 +portmap_14=14:10 +portmap_15=15:10 +portmap_16=16:10 +phy_chain_rx_lane_map_physical{13.0}=0x0123 +phy_chain_rx_lane_map_physical{14.0}=0x0123 +phy_chain_rx_lane_map_physical{15.0}=0x0123 +phy_chain_rx_lane_map_physical{16.0}=0x0123 +phy_chain_tx_lane_map_physical{13.0}=0x0123 +phy_chain_tx_lane_map_physical{14.0}=0x0123 +phy_chain_tx_lane_map_physical{15.0}=0x0123 +phy_chain_tx_lane_map_physical{16.0}=0x0123 +phy_chain_rx_polarity_flip_physical{13.0}=0x0 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x0 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x1 + +#FC4 +dport_map_port_17=17 +dport_map_port_18=18 +dport_map_port_19=19 +dport_map_port_20=20 +portmap_17=17:10 +portmap_18=18:10 +portmap_19=19:10 +portmap_20=20:10 +phy_chain_rx_lane_map_physical{17.0}=0x0123 +phy_chain_rx_lane_map_physical{18.0}=0x0123 +phy_chain_rx_lane_map_physical{19.0}=0x0123 +phy_chain_rx_lane_map_physical{20.0}=0x0123 +phy_chain_tx_lane_map_physical{17.0}=0x0123 +phy_chain_tx_lane_map_physical{18.0}=0x0123 +phy_chain_tx_lane_map_physical{19.0}=0x0123 +phy_chain_tx_lane_map_physical{20.0}=0x0123 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{18.0}=0x1 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 + +#FC5 +dport_map_port_21=21 +dport_map_port_22=22 +dport_map_port_23=23 +dport_map_port_24=24 +portmap_21=21:10 +portmap_22=22:10 +portmap_23=23:10 +portmap_24=24:10 +phy_chain_rx_lane_map_physical{21.0}=0x0123 +phy_chain_rx_lane_map_physical{22.0}=0x0123 +phy_chain_rx_lane_map_physical{23.0}=0x0123 +phy_chain_rx_lane_map_physical{24.0}=0x0123 +phy_chain_tx_lane_map_physical{21.0}=0x0123 +phy_chain_tx_lane_map_physical{22.0}=0x0123 +phy_chain_tx_lane_map_physical{23.0}=0x0123 +phy_chain_tx_lane_map_physical{24.0}=0x0123 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x0 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x1 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{24.0}=0x1 + +#FC6 + +#FC7 +dport_map_port_25=50 +portmap_25=29:100:4 +phy_chain_rx_lane_map_physical{29.0}=0x1302 +phy_chain_rx_lane_map_physical{30.0}=0x1302 +phy_chain_rx_lane_map_physical{31.0}=0x1302 +phy_chain_rx_lane_map_physical{32.0}=0x1302 +phy_chain_tx_lane_map_physical{29.0}=0x2031 +phy_chain_tx_lane_map_physical{30.0}=0x2031 +phy_chain_tx_lane_map_physical{31.0}=0x2031 +phy_chain_tx_lane_map_physical{32.0}=0x2031 +phy_chain_rx_polarity_flip_physical{29.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x1 +phy_chain_rx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x1 + +#FC8 +dport_map_port_26=51 +portmap_26=33:100:4 +phy_chain_rx_lane_map_physical{33.0}=0x1203 +phy_chain_rx_lane_map_physical{34.0}=0x1203 +phy_chain_rx_lane_map_physical{35.0}=0x1203 +phy_chain_rx_lane_map_physical{36.0}=0x1203 +phy_chain_tx_lane_map_physical{33.0}=0x3120 +phy_chain_tx_lane_map_physical{34.0}=0x3120 +phy_chain_tx_lane_map_physical{35.0}=0x3120 +phy_chain_tx_lane_map_physical{36.0}=0x3120 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x0 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x1 +phy_chain_tx_polarity_flip_physical{36.0}=0x0 + +#FC9 +dport_map_port_27=49 +dport_map_port_28=52 +dport_map_port_29=53 +dport_map_port_30=54 +portmap_27=37:100:4 +phy_chain_rx_lane_map_physical{37.0}=0x2130 +phy_chain_rx_lane_map_physical{38.0}=0x2130 +phy_chain_rx_lane_map_physical{39.0}=0x2130 +phy_chain_rx_lane_map_physical{40.0}=0x2130 +phy_chain_tx_lane_map_physical{37.0}=0x3210 +phy_chain_tx_lane_map_physical{38.0}=0x3210 +phy_chain_tx_lane_map_physical{39.0}=0x3210 +phy_chain_tx_lane_map_physical{40.0}=0x3210 +phy_chain_rx_polarity_flip_physical{37.0}=0x0 +phy_chain_rx_polarity_flip_physical{38.0}=0x0 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{37.0}=0x0 +phy_chain_tx_polarity_flip_physical{38.0}=0x0 +phy_chain_tx_polarity_flip_physical{39.0}=0x0 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 + +#FC10 +dport_map_port_33=57 +portmap_33=41:100:4 +phy_chain_rx_lane_map_physical{41.0}=0x1320 +phy_chain_rx_lane_map_physical{42.0}=0x1320 +phy_chain_rx_lane_map_physical{43.0}=0x1320 +phy_chain_rx_lane_map_physical{44.0}=0x1320 +phy_chain_tx_lane_map_physical{41.0}=0x3210 +phy_chain_tx_lane_map_physical{42.0}=0x3210 +phy_chain_tx_lane_map_physical{43.0}=0x3210 +phy_chain_tx_lane_map_physical{44.0}=0x3210 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x0 +phy_chain_rx_polarity_flip_physical{43.0}=0x0 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 + +#FC11 +dport_map_port_34=56 +portmap_34=45:100:4 +phy_chain_rx_lane_map_physical{45.0}=0x3201 +phy_chain_rx_lane_map_physical{46.0}=0x3201 +phy_chain_rx_lane_map_physical{47.0}=0x3201 +phy_chain_rx_lane_map_physical{48.0}=0x3201 +phy_chain_tx_lane_map_physical{45.0}=0x3210 +phy_chain_tx_lane_map_physical{46.0}=0x3210 +phy_chain_tx_lane_map_physical{47.0}=0x3210 +phy_chain_tx_lane_map_physical{48.0}=0x3210 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x1 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x0 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x0 +phy_chain_tx_polarity_flip_physical{48.0}=0x0 + +#FC12 +dport_map_port_35=55 +dport_map_port_36=58 +dport_map_port_37=59 +dport_map_port_38=60 +portmap_35=49:100:4 +phy_chain_rx_lane_map_physical{49.0}=0x0312 +phy_chain_rx_lane_map_physical{50.0}=0x0312 +phy_chain_rx_lane_map_physical{51.0}=0x0312 +phy_chain_rx_lane_map_physical{52.0}=0x0312 +phy_chain_tx_lane_map_physical{49.0}=0x3210 +phy_chain_tx_lane_map_physical{50.0}=0x3210 +phy_chain_tx_lane_map_physical{51.0}=0x3210 +phy_chain_tx_lane_map_physical{52.0}=0x3210 +phy_chain_rx_polarity_flip_physical{49.0}=0x0 +phy_chain_rx_polarity_flip_physical{50.0}=0x0 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x0 + +#FC13 +dport_map_port_39=25 +dport_map_port_40=26 +dport_map_port_41=27 +dport_map_port_42=28 +portmap_39=53:10 +portmap_40=54:10 +portmap_41=55:10 +portmap_42=56:10 +phy_chain_rx_lane_map_physical{53.0}=0x3120 +phy_chain_rx_lane_map_physical{54.0}=0x3120 +phy_chain_rx_lane_map_physical{55.0}=0x3120 +phy_chain_rx_lane_map_physical{56.0}=0x3120 +phy_chain_tx_lane_map_physical{53.0}=0x3102 +phy_chain_tx_lane_map_physical{54.0}=0x3102 +phy_chain_tx_lane_map_physical{55.0}=0x3102 +phy_chain_tx_lane_map_physical{56.0}=0x3102 +phy_chain_rx_polarity_flip_physical{53.0}=0x1 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +phy_chain_rx_polarity_flip_physical{56.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x0 +phy_chain_tx_polarity_flip_physical{56.0}=0x1 + +#FC14 +dport_map_port_43=29 +dport_map_port_44=30 +dport_map_port_45=31 +dport_map_port_46=32 +portmap_43=57:10 +portmap_44=58:10 +portmap_45=59:10 +portmap_46=60:10 +phy_chain_rx_lane_map_physical{57.0}=0x3210 +phy_chain_rx_lane_map_physical{58.0}=0x3210 +phy_chain_rx_lane_map_physical{59.0}=0x3210 +phy_chain_rx_lane_map_physical{60.0}=0x3210 +phy_chain_tx_lane_map_physical{57.0}=0x3210 +phy_chain_tx_lane_map_physical{58.0}=0x3210 +phy_chain_tx_lane_map_physical{59.0}=0x3210 +phy_chain_tx_lane_map_physical{60.0}=0x3210 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x0 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 + +#FC15 +dport_map_port_47=33 +dport_map_port_48=34 +dport_map_port_49=35 +dport_map_port_50=36 +portmap_47=61:10 +portmap_48=62:10 +portmap_49=63:10 +portmap_50=64:10 +phy_chain_rx_lane_map_physical{61.0}=0x3210 +phy_chain_rx_lane_map_physical{62.0}=0x3210 +phy_chain_rx_lane_map_physical{63.0}=0x3210 +phy_chain_rx_lane_map_physical{64.0}=0x3210 +phy_chain_tx_lane_map_physical{61.0}=0x3210 +phy_chain_tx_lane_map_physical{62.0}=0x3210 +phy_chain_tx_lane_map_physical{63.0}=0x3210 +phy_chain_tx_lane_map_physical{64.0}=0x3210 +phy_chain_rx_polarity_flip_physical{61.0}=0x1 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x0 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 + +#FC16 +dport_map_port_51=37 +dport_map_port_52=38 +dport_map_port_53=39 +dport_map_port_54=40 +portmap_51=65:10 +portmap_52=66:10 +portmap_53=67:10 +portmap_54=68:10 +phy_chain_rx_lane_map_physical{65.0}=0x3210 +phy_chain_rx_lane_map_physical{66.0}=0x3210 +phy_chain_rx_lane_map_physical{67.0}=0x3210 +phy_chain_rx_lane_map_physical{68.0}=0x3210 +phy_chain_tx_lane_map_physical{65.0}=0x3210 +phy_chain_tx_lane_map_physical{66.0}=0x3210 +phy_chain_tx_lane_map_physical{67.0}=0x3210 +phy_chain_tx_lane_map_physical{68.0}=0x3210 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x1 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x0 +phy_chain_tx_polarity_flip_physical{68.0}=0x1 + +#FC17 +dport_map_port_55=41 +dport_map_port_56=42 +dport_map_port_57=43 +dport_map_port_58=44 +portmap_55=69:10 +portmap_56=70:10 +portmap_57=71:10 +portmap_58=72:10 +phy_chain_rx_lane_map_physical{69.0}=0x3210 +phy_chain_rx_lane_map_physical{70.0}=0x3210 +phy_chain_rx_lane_map_physical{71.0}=0x3210 +phy_chain_rx_lane_map_physical{72.0}=0x3210 +phy_chain_tx_lane_map_physical{69.0}=0x3210 +phy_chain_tx_lane_map_physical{70.0}=0x3210 +phy_chain_tx_lane_map_physical{71.0}=0x3210 +phy_chain_tx_lane_map_physical{72.0}=0x3210 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x0 +phy_chain_rx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x0 +phy_chain_tx_polarity_flip_physical{72.0}=0x1 + +#FC18 +dport_map_port_59=45 +dport_map_port_60=46 +dport_map_port_61=47 +dport_map_port_62=48 +portmap_59=73:10 +portmap_60=74:10 +portmap_61=75:10 +portmap_62=76:10 +phy_chain_rx_lane_map_physical{73.0}=0x3210 +phy_chain_rx_lane_map_physical{74.0}=0x3210 +phy_chain_rx_lane_map_physical{75.0}=0x3210 +phy_chain_rx_lane_map_physical{76.0}=0x3210 +phy_chain_tx_lane_map_physical{73.0}=0x0231 +phy_chain_tx_lane_map_physical{74.0}=0x0231 +phy_chain_tx_lane_map_physical{75.0}=0x0231 +phy_chain_tx_lane_map_physical{76.0}=0x0231 +phy_chain_rx_polarity_flip_physical{73.0}=0x0 +phy_chain_rx_polarity_flip_physical{74.0}=0x0 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x0 +phy_chain_tx_polarity_flip_physical{74.0}=0x1 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 + +#FC19 + +dport_map_port_64=64 +portmap_64=81:10:m +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 + diff --git a/device/accton/x86_64-accton_as5835_54x-r0/default_sku b/device/accton/x86_64-accton_as5835_54x-r0/default_sku new file mode 100644 index 0000000000..c00cdbf64e --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/default_sku @@ -0,0 +1 @@ +Accton-AS5835-54X t1 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/installer.conf b/device/accton/x86_64-accton_as5835_54x-r0/installer.conf new file mode 100644 index 0000000000..925a32fc0c --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/installer.conf @@ -0,0 +1,3 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/plugins/eeprom.py b/device/accton/x86_64-accton_as5835_54x-r0/plugins/eeprom.py new file mode 100644 index 0000000000..7681caafee --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/plugins/eeprom.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +try: + import exceptions + import binascii + import time + import optparse + import warnings + import os + import sys + from sonic_eeprom import eeprom_base + from sonic_eeprom import eeprom_tlvinfo + import subprocess +except ImportError, e: + raise ImportError (str(e) + "- required module not found") + +class board(eeprom_tlvinfo.TlvInfoDecoder): + _TLV_INFO_MAX_LEN = 256 + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom" + #Two i2c buses might get flipped order, check them both. + if not os.path.exists(self.eeprom_path): + self.eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/plugins/psuutil.py b/device/accton/x86_64-accton_as5835_54x-r0/plugins/psuutil.py new file mode 100644 index 0000000000..c95bc27897 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/plugins/psuutil.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +############################################################################# +# Accton +# +# Module contains an implementation of SONiC PSU Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + def __init__(self): + PsuBase.__init__(self) + + self.psu_path = "/sys/bus/i2c/devices/" + self.psu_presence = "/psu_present" + self.psu_oper_status = "/psu_power_good" + self.psu_mapping = { + 1: "11-0050", + 2: "12-0053", + } + + def get_num_psus(self): + return len(self.psu_mapping) + + def get_psu_status(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index]+self.psu_oper_status + try: + with open(node, 'r') as power_status: + status = int(power_status.read()) + except IOError: + return False + + return status == 1 + + def get_psu_presence(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index] + self.psu_presence + try: + with open(node, 'r') as presence_status: + status = int(presence_status.read()) + except IOError: + return False + + return status == 1 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py new file mode 100644 index 0000000000..9a9db688e7 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py @@ -0,0 +1,297 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + import string + from ctypes import create_string_buffer + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 1 + PORT_END = 72 + PORTS_IN_BLOCK = 72 + QSFP_PORT_START = 49 + QSFP_PORT_END = 72 + + BASE_VAL_PATH = "/sys/class/i2c-adapter/i2c-{0}/{1}-0050/" + + _port_to_is_present = {} + _port_to_lp_mode = {} + + _port_to_eeprom_mapping = {} + _cpld_mapping = { + 0: "3-0060", + 1: "3-0061", + 2: "3-0062", + } + _port_to_i2c_mapping = { + 1: 42, + 2: 43, + 3: 44, + 4: 45, + 5: 46, + 6: 47, + 7: 48, + 8: 49, + 9: 50, + 10: 51, + 11: 52, + 12: 53, + 13: 54, + 14: 55, + 15: 56, + 16: 57, + 17: 58, + 18: 59, + 19: 60, + 20: 61, + 21: 62, + 22: 63, + 23: 64, + 24: 65, + 25: 66, + 26: 67, + 27: 68, + 28: 69, + 29: 70, + 30: 71, + 31: 72, + 32: 73, + 33: 74, + 34: 75, + 35: 76, + 36: 77, + 37: 78, + 38: 79, + 39: 80, + 40: 81, + 41: 82, + 42: 83, + 43: 84, + 44: 85, + 45: 86, + 46: 87, + 47: 88, + 48: 89, + 49: 28, #QSFP49 + 50: 28, + 51: 28, + 52: 28, + 53: 29, #QSFP50 + 54: 29, + 55: 29, + 56: 29, + 57: 26, #QSFP51 + 58: 26, + 59: 26, + 60: 26, + 61: 30, #QSFP52 + 62: 30, + 63: 30, + 64: 30, + 65: 31, #QSFP53 + 66: 31, + 67: 31, + 68: 31, + 69: 27, #QSFP54 + 70: 27, + 71: 27, + 72: 27, + } + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_port_start(self): + return self.QSFP_PORT_START + + @property + def qsfp_port_end(self): + return self.QSFP_PORT_END + + @property + def qsfp_ports(self): + return range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + for x in range(self.port_start, self.port_end+1): + self.port_to_eeprom_mapping[x] = eeprom_path.format( + self._port_to_i2c_mapping[x]) + + SfpUtilBase.__init__(self) + + + # For port 49~54 are QSFP, here presumed they're all split to 4 lanes. + def get_cage_num(self, port_num): + cage_num = port_num + if (port_num >= self.QSFP_PORT_START): + cage_num = (port_num - self.QSFP_PORT_START)/4 + cage_num = cage_num + self.QSFP_PORT_START + + return cage_num + + # For cage 1~38 are at cpld2, others are at cpld3. + def get_cpld_num(self, port_num): + return 1 if (port_num < 39) else 2 + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + cage_num = self.get_cage_num(port_num) + cpld_i = self.get_cpld_num(port_num) + + cpld_ps = self._cpld_mapping[cpld_i] + path = "/sys/bus/i2c/devices/{0}/module_present_{1}" + port_ps = path.format(cpld_ps, cage_num) + + try: + val_file = open(port_ps) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def get_low_power_mode_cpld(self, port_num): + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + cage_num = self.get_cage_num(port_num) + cpld_i = self.get_cpld_num(port_num) + + cpld_ps = self._cpld_mapping[cpld_i] + path = "/sys/bus/i2c/devices/{0}/module_lpmode_{1}" + lp_mode_path = path.format(cpld_ps, cage_num) + + try: + val_file = open(lp_mode_path) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + # content is a string, either "0" or "1" + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + if not self.get_presence(port_num): + return False + + try: + eeprom = None + + eeprom = open(self.port_to_eeprom_mapping[port_num], "rb") + eeprom.seek(93) + lpmode = ord(eeprom.read(1)) + + if not (lpmode & 0x1): # 'Power override' bit is 0 + return self.get_low_power_mode_cpld(port_num) + else: + if ((lpmode & 0x2) == 0x2): + return True # Low Power Mode if "Power set" bit is 1 + else: + return False # High Power Mode if "Power set" bit is 0 + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def set_low_power_mode(self, port_num, lpmode): + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + try: + eeprom = None + + if not self.get_presence(port_num): + return False # Port is not present, unable to set the eeprom + + # Fill in write buffer + regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode + buffer = create_string_buffer(1) + buffer[0] = chr(regval) + + # Write to eeprom + eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b") + eeprom.seek(93) + eeprom.write(buffer[0]) + return True + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def reset(self, port_num): + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + cage_num = self.get_cage_num(port_num) + cpld_i = self.get_cpld_num(port_num) + cpld_ps = self._cpld_mapping[cpld_i] + path = "/sys/bus/i2c/devices/{0}/module_reset_{1}" + port_ps = path.format(cpld_ps, cage_num) + try: + reg_file = open(port_ps, 'w') + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + #toggle reset + reg_file.seek(0) + reg_file.write('0') + time.sleep(1) + reg_file.seek(0) + reg_file.write('1') + reg_file.close() + + return True + + def get_transceiver_change_event(self): + """ + TODO: This function need to be implemented + when decide to support monitoring SFP(Xcvrd) + on this platform. + """ + raise NotImplementedError diff --git a/device/arista/x86_64-arista_7050_qx32/plugins b/device/arista/x86_64-arista_7050_qx32/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/plugins/eeprom.py b/device/arista/x86_64-arista_7050_qx32/plugins/eeprom.py deleted file mode 100644 index 9da54dbf1b..0000000000 --- a/device/arista/x86_64-arista_7050_qx32/plugins/eeprom.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -""" -Arista 7050QX-32 eeprom plugin -Uses the arista driver library to obtain the TlvInfoDecoder -""" - -try: - import arista.utils.sonic_eeprom as arista_eeprom -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7050_qx32/plugins/led_control.py b/device/arista/x86_64-arista_7050_qx32/plugins/led_control.py deleted file mode 100644 index 8d387e513c..0000000000 --- a/device/arista/x86_64-arista_7050_qx32/plugins/led_control.py +++ /dev/null @@ -1,6 +0,0 @@ -try: - import arista.utils.sonic_leds as arista_leds -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7050_qx32/plugins/psuutil.py b/device/arista/x86_64-arista_7050_qx32/plugins/psuutil.py deleted file mode 100644 index 1a8682ae3c..0000000000 --- a/device/arista/x86_64-arista_7050_qx32/plugins/psuutil.py +++ /dev/null @@ -1,12 +0,0 @@ -# psuutil.py -# -# Platform-specific PSU interface for SONiC -# - -try: - import arista.utils.sonic_psu as arista_psuutil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py b/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py deleted file mode 100644 index 9a6d770d46..0000000000 --- a/device/arista/x86_64-arista_7050_qx32/plugins/sfputil.py +++ /dev/null @@ -1,12 +0,0 @@ -# sfputil.py -# -# Platform-specific SFP transceiver interface for SONiC -# - -try: - import arista.utils.sonic_sfputil as arista_sfputil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins b/device/arista/x86_64-arista_7050_qx32s/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins/eeprom.py b/device/arista/x86_64-arista_7050_qx32s/plugins/eeprom.py deleted file mode 100644 index d1c6212219..0000000000 --- a/device/arista/x86_64-arista_7050_qx32s/plugins/eeprom.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -""" -Arista 7050QX-32S eeprom plugin -Uses the arista driver library to obtain the TlvInfoDecoder -""" - -try: - import arista.utils.sonic_eeprom as arista_eeprom -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins/led_control.py b/device/arista/x86_64-arista_7050_qx32s/plugins/led_control.py deleted file mode 100644 index 8d387e513c..0000000000 --- a/device/arista/x86_64-arista_7050_qx32s/plugins/led_control.py +++ /dev/null @@ -1,6 +0,0 @@ -try: - import arista.utils.sonic_leds as arista_leds -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins/psuutil.py b/device/arista/x86_64-arista_7050_qx32s/plugins/psuutil.py deleted file mode 100644 index 1a8682ae3c..0000000000 --- a/device/arista/x86_64-arista_7050_qx32s/plugins/psuutil.py +++ /dev/null @@ -1,12 +0,0 @@ -# psuutil.py -# -# Platform-specific PSU interface for SONiC -# - -try: - import arista.utils.sonic_psu as arista_psuutil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py b/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py deleted file mode 100644 index 9a6d770d46..0000000000 --- a/device/arista/x86_64-arista_7050_qx32s/plugins/sfputil.py +++ /dev/null @@ -1,12 +0,0 @@ -# sfputil.py -# -# Platform-specific SFP transceiver interface for SONiC -# - -try: - import arista.utils.sonic_sfputil as arista_sfputil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins b/device/arista/x86_64-arista_7060_cx32s/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/eeprom.py b/device/arista/x86_64-arista_7060_cx32s/plugins/eeprom.py deleted file mode 100644 index 0cfe5109a3..0000000000 --- a/device/arista/x86_64-arista_7060_cx32s/plugins/eeprom.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -""" -Arista 7060CX-32S eeprom plugin -Uses the arista driver library to obtain the TlvInfoDecoder -""" - -try: - import arista.utils.sonic_eeprom as arista_eeprom -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py b/device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py deleted file mode 100644 index 8d387e513c..0000000000 --- a/device/arista/x86_64-arista_7060_cx32s/plugins/led_control.py +++ /dev/null @@ -1,6 +0,0 @@ -try: - import arista.utils.sonic_leds as arista_leds -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/psuutil.py b/device/arista/x86_64-arista_7060_cx32s/plugins/psuutil.py deleted file mode 100644 index 1a8682ae3c..0000000000 --- a/device/arista/x86_64-arista_7060_cx32s/plugins/psuutil.py +++ /dev/null @@ -1,12 +0,0 @@ -# psuutil.py -# -# Platform-specific PSU interface for SONiC -# - -try: - import arista.utils.sonic_psu as arista_psuutil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py b/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py deleted file mode 100644 index 9a6d770d46..0000000000 --- a/device/arista/x86_64-arista_7060_cx32s/plugins/sfputil.py +++ /dev/null @@ -1,12 +0,0 @@ -# sfputil.py -# -# Platform-specific SFP transceiver interface for SONiC -# - -try: - import arista.utils.sonic_sfputil as arista_sfputil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/port_config.ini b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/port_config.ini new file mode 100644 index 0000000000..3a64359864 --- /dev/null +++ b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/port_config.ini @@ -0,0 +1,67 @@ +# name lanes alias index speed +Ethernet0 1,2,3,4 Ethernet1/1 1 100000 +Ethernet4 5,6,7,8 Ethernet1/5 1 100000 +Ethernet8 9,10,11,12 Ethernet2/1 2 100000 +Ethernet12 13,14,15,16 Ethernet2/5 2 100000 +Ethernet16 17,18,19,20 Ethernet3/1 3 100000 +Ethernet20 21,22,23,24 Ethernet3/5 3 100000 +Ethernet24 25,26,27,28 Ethernet4/1 4 100000 +Ethernet28 29,30,31,32 Ethernet4/5 4 100000 +Ethernet32 33,34,35,36 Ethernet5/1 5 100000 +Ethernet36 37,38,39,40 Ethernet5/5 5 100000 +Ethernet40 41,42,43,44 Ethernet6/1 6 100000 +Ethernet44 45,46,47,48 Ethernet6/5 6 100000 +Ethernet48 49,50,51,52 Ethernet7/1 7 100000 +Ethernet52 53,54,55,56 Ethernet7/5 7 100000 +Ethernet56 57,58,59,60 Ethernet8/1 8 100000 +Ethernet60 61,62,63,64 Ethernet8/5 8 100000 +Ethernet64 65,66,67,68 Ethernet9/1 9 100000 +Ethernet68 69,70,71,72 Ethernet9/5 9 100000 +Ethernet72 73,74,75,76 Ethernet10/1 10 100000 +Ethernet76 77,78,79,80 Ethernet10/5 10 100000 +Ethernet80 81,82,83,84 Ethernet11/1 11 100000 +Ethernet84 85,86,87,88 Ethernet11/5 11 100000 +Ethernet88 89,90,91,92 Ethernet12/1 12 100000 +Ethernet92 93,94,95,96 Ethernet12/5 12 100000 +Ethernet96 97,98,99,100 Ethernet13/1 13 100000 +Ethernet100 101,102,103,104 Ethernet13/5 13 100000 +Ethernet104 105,106,107,108 Ethernet14/1 14 100000 +Ethernet108 109,110,111,112 Ethernet14/5 14 100000 +Ethernet112 113,114,115,116 Ethernet15/1 15 100000 +Ethernet116 117,118,119,120 Ethernet15/5 15 100000 +Ethernet120 121,122,123,124 Ethernet16/1 16 100000 +Ethernet124 125,126,127,128 Ethernet16/5 16 100000 +Ethernet128 129,130,131,132 Ethernet17/1 17 100000 +Ethernet132 133,134,135,136 Ethernet17/5 17 100000 +Ethernet136 137,138,139,140 Ethernet18/1 18 100000 +Ethernet140 141,142,143,144 Ethernet18/5 18 100000 +Ethernet144 145,146,147,148 Ethernet19/1 19 100000 +Ethernet148 149,150,151,152 Ethernet19/5 19 100000 +Ethernet152 153,154,155,156 Ethernet20/1 20 100000 +Ethernet156 157,158,159,160 Ethernet20/5 20 100000 +Ethernet160 161,162,163,164 Ethernet21/1 21 100000 +Ethernet164 165,166,167,168 Ethernet21/5 21 100000 +Ethernet168 169,170,171,172 Ethernet22/1 22 100000 +Ethernet172 173,174,175,176 Ethernet22/5 22 100000 +Ethernet176 177,178,179,180 Ethernet23/1 23 100000 +Ethernet180 181,182,183,184 Ethernet23/5 23 100000 +Ethernet184 185,186,187,188 Ethernet24/1 24 100000 +Ethernet188 189,190,191,192 Ethernet24/5 24 100000 +Ethernet192 193,194,195,196 Ethernet25/1 25 100000 +Ethernet196 197,198,199,200 Ethernet25/5 25 100000 +Ethernet200 201,202,203,204 Ethernet26/1 26 100000 +Ethernet204 205,206,207,208 Ethernet26/5 26 100000 +Ethernet208 209,210,211,212 Ethernet27/1 27 100000 +Ethernet212 213,214,215,216 Ethernet27/5 27 100000 +Ethernet216 217,218,219,220 Ethernet28/1 28 100000 +Ethernet220 221,222,223,224 Ethernet28/5 28 100000 +Ethernet224 225,226,227,228 Ethernet29/1 29 100000 +Ethernet228 229,230,231,232 Ethernet29/5 29 100000 +Ethernet232 233,234,235,236 Ethernet30/1 30 100000 +Ethernet236 237,238,239,240 Ethernet30/5 30 100000 +Ethernet240 241,242,243,244 Ethernet31/1 31 100000 +Ethernet244 245,246,247,248 Ethernet31/5 31 100000 +Ethernet248 249,250,251,252 Ethernet32/1 32 100000 +Ethernet252 253,254,255,256 Ethernet32/5 32 100000 +Ethernet256 258 Ethernet33 33 10000 +Ethernet260 257 Ethernet34 34 10000 diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/sai.profile b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/sai.profile new file mode 100644 index 0000000000..8f820cb0f0 --- /dev/null +++ b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th3-a7060px4-32-64x100G.config.bcm diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm new file mode 100644 index 0000000000..d5e8cf66f6 --- /dev/null +++ b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm @@ -0,0 +1,877 @@ +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile.0=2 +bcm_num_cos.0=8 +bcm_stat_flags=1 +bcm_stat_jumbo.0=9236 +cdma_timeout_usec.0=15000000 +dma_desc_timeout_usec.0=15000000 +dpr_clock_frequency.0=1000 +higig2_hdr_mode.0=1 +ipv6_lpm_128b_enable.0=0 +l2xmsg_mode.0=1 +l2_mem_entries.0=8192 +l3_alpm_enable.0=2 +l3_mem_entries.0=16384 +max_vp_lags.0=0 +miim_intr_enable.0=0 +module_64ports.0=1 +multicast_l2_range.0=511 +num_ipv6_lpm_128b_entries.0=0 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe.0=0xf0000f4000f0000f0000f0000f4000f0001e +phy_an_c37_38.0=2 +phy_an_c37_118.0=2 +phy_an_c37_1.0=1 +phy_an_c37_2.0=1 +phy_an_c37_3.0=1 +phy_an_c37_4.0=1 +phy_an_c37_5.0=1 +phy_an_c37_6.0=1 +phy_an_c37_7.0=1 +phy_an_c37_8.0=1 +phy_an_c37_20.0=1 +phy_an_c37_21.0=1 +phy_an_c37_22.0=1 +phy_an_c37_23.0=1 +phy_an_c37_24.0=1 +phy_an_c37_25.0=1 +phy_an_c37_26.0=1 +phy_an_c37_27.0=1 +phy_an_c37_38.0=0 +phy_an_c37_40.0=1 +phy_an_c37_41.0=1 +phy_an_c37_42.0=1 +phy_an_c37_43.0=1 +phy_an_c37_44.0=1 +phy_an_c37_45.0=1 +phy_an_c37_46.0=1 +phy_an_c37_47.0=1 +phy_an_c37_60.0=1 +phy_an_c37_61.0=1 +phy_an_c37_62.0=1 +phy_an_c37_63.0=1 +phy_an_c37_64.0=1 +phy_an_c37_65.0=1 +phy_an_c37_66.0=1 +phy_an_c37_67.0=1 +phy_an_c37_80.0=1 +phy_an_c37_81.0=1 +phy_an_c37_82.0=1 +phy_an_c37_83.0=1 +phy_an_c37_84.0=1 +phy_an_c37_85.0=1 +phy_an_c37_86.0=1 +phy_an_c37_87.0=1 +phy_an_c37_100.0=1 +phy_an_c37_101.0=1 +phy_an_c37_102.0=1 +phy_an_c37_103.0=1 +phy_an_c37_104.0=1 +phy_an_c37_105.0=1 +phy_an_c37_106.0=1 +phy_an_c37_107.0=1 +phy_an_c37_118.0=0 +phy_an_c37_120.0=1 +phy_an_c37_121.0=1 +phy_an_c37_122.0=1 +phy_an_c37_123.0=1 +phy_an_c37_124.0=1 +phy_an_c37_125.0=1 +phy_an_c37_126.0=1 +phy_an_c37_127.0=1 +phy_an_c37_140.0=1 +phy_an_c37_141.0=1 +phy_an_c37_142.0=1 +phy_an_c37_143.0=1 +phy_an_c37_144.0=1 +phy_an_c37_145.0=1 +phy_an_c37_146.0=1 +phy_an_c37_147.0=1 +phy_chain_rx_lane_map_physical{1.0}=0x72634150 +phy_chain_rx_lane_map_physical{9.0}=0x63725041 +phy_chain_rx_lane_map_physical{17.0}=0x23071465 +phy_chain_rx_lane_map_physical{25.0}=0x03125746 +phy_chain_rx_lane_map_physical{33.0}=0x12063574 +phy_chain_rx_lane_map_physical{41.0}=0x03125647 +phy_chain_rx_lane_map_physical{49.0}=0x12053467 +phy_chain_rx_lane_map_physical{57.0}=0x03125647 +phy_chain_rx_lane_map_physical{65.0}=0x12043576 +phy_chain_rx_lane_map_physical{73.0}=0x03125746 +phy_chain_rx_lane_map_physical{81.0}=0x12043576 +phy_chain_rx_lane_map_physical{89.0}=0x03125746 +phy_chain_rx_lane_map_physical{97.0}=0x40165327 +phy_chain_rx_lane_map_physical{105.0}=0x56470213 +phy_chain_rx_lane_map_physical{113.0}=0x21340576 +phy_chain_rx_lane_map_physical{121.0}=0x47562130 +phy_chain_rx_lane_map_physical{129.0}=0x56437201 +phy_chain_rx_lane_map_physical{137.0}=0x03125647 +phy_chain_rx_lane_map_physical{145.0}=0x12043576 +phy_chain_rx_lane_map_physical{153.0}=0x54106723 +phy_chain_rx_lane_map_physical{161.0}=0x63257014 +phy_chain_rx_lane_map_physical{169.0}=0x03125647 +phy_chain_rx_lane_map_physical{177.0}=0x12043567 +phy_chain_rx_lane_map_physical{185.0}=0x03125647 +phy_chain_rx_lane_map_physical{193.0}=0x12043567 +phy_chain_rx_lane_map_physical{201.0}=0x03125647 +phy_chain_rx_lane_map_physical{209.0}=0x12043576 +phy_chain_rx_lane_map_physical{217.0}=0x03125467 +phy_chain_rx_lane_map_physical{225.0}=0x12073465 +phy_chain_rx_lane_map_physical{233.0}=0x30215647 +phy_chain_rx_lane_map_physical{241.0}=0x23071564 +phy_chain_rx_lane_map_physical{249.0}=0x72634150 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x0 +phy_chain_rx_polarity_flip_physical{6.0}=0x1 +phy_chain_rx_polarity_flip_physical{7.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x0 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{13.0}=0x0 +phy_chain_rx_polarity_flip_physical{14.0}=0x1 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{17.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{22.0}=0x1 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x1 +phy_chain_rx_polarity_flip_physical{25.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x1 +phy_chain_rx_polarity_flip_physical{27.0}=0x0 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{30.0}=0x1 +phy_chain_rx_polarity_flip_physical{31.0}=0x1 +phy_chain_rx_polarity_flip_physical{32.0}=0x0 +phy_chain_rx_polarity_flip_physical{33.0}=0x1 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x0 +phy_chain_rx_polarity_flip_physical{36.0}=0x0 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x0 +phy_chain_rx_polarity_flip_physical{45.0}=0x0 +phy_chain_rx_polarity_flip_physical{46.0}=0x1 +phy_chain_rx_polarity_flip_physical{47.0}=0x1 +phy_chain_rx_polarity_flip_physical{48.0}=0x0 +phy_chain_rx_polarity_flip_physical{49.0}=0x0 +phy_chain_rx_polarity_flip_physical{50.0}=0x0 +phy_chain_rx_polarity_flip_physical{51.0}=0x1 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x1 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x1 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{60.0}=0x0 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x0 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x0 +phy_chain_rx_polarity_flip_physical{69.0}=0x1 +phy_chain_rx_polarity_flip_physical{70.0}=0x1 +phy_chain_rx_polarity_flip_physical{71.0}=0x0 +phy_chain_rx_polarity_flip_physical{72.0}=0x0 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x1 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x0 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x1 +phy_chain_rx_polarity_flip_physical{91.0}=0x0 +phy_chain_rx_polarity_flip_physical{92.0}=0x0 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x1 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x0 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x1 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x0 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x1 +phy_chain_rx_polarity_flip_physical{107.0}=0x0 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x1 +phy_chain_rx_polarity_flip_physical{112.0}=0x0 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x1 +phy_chain_rx_polarity_flip_physical{115.0}=0x0 +phy_chain_rx_polarity_flip_physical{116.0}=0x1 +phy_chain_rx_polarity_flip_physical{117.0}=0x1 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x1 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x0 +phy_chain_rx_polarity_flip_physical{124.0}=0x1 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x0 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{130.0}=0x0 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x0 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x0 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x1 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x0 +phy_chain_rx_polarity_flip_physical{142.0}=0x1 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x1 +phy_chain_rx_polarity_flip_physical{147.0}=0x0 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x0 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x0 +phy_chain_rx_polarity_flip_physical{156.0}=0x1 +phy_chain_rx_polarity_flip_physical{157.0}=0x1 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x1 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x0 +phy_chain_rx_polarity_flip_physical{168.0}=0x0 +phy_chain_rx_polarity_flip_physical{169.0}=0x0 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x1 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x1 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x0 +phy_chain_rx_polarity_flip_physical{177.0}=0x0 +phy_chain_rx_polarity_flip_physical{178.0}=0x0 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x1 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x0 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{190.0}=0x1 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x0 +phy_chain_rx_polarity_flip_physical{196.0}=0x0 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x1 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x0 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x1 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x1 +phy_chain_rx_polarity_flip_physical{214.0}=0x1 +phy_chain_rx_polarity_flip_physical{215.0}=0x0 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x1 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{220.0}=0x0 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x1 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x0 +phy_chain_rx_polarity_flip_physical{225.0}=0x0 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x1 +phy_chain_rx_polarity_flip_physical{228.0}=0x0 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{230.0}=0x1 +phy_chain_rx_polarity_flip_physical{231.0}=0x0 +phy_chain_rx_polarity_flip_physical{232.0}=0x0 +phy_chain_rx_polarity_flip_physical{233.0}=0x0 +phy_chain_rx_polarity_flip_physical{234.0}=0x1 +phy_chain_rx_polarity_flip_physical{235.0}=0x1 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x1 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x0 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x0 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x1 +phy_chain_rx_polarity_flip_physical{249.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x0 +phy_chain_rx_polarity_flip_physical{253.0}=0x0 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x1 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{258.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x13245076 +phy_chain_tx_lane_map_physical{9.0}=0x76501423 +phy_chain_tx_lane_map_physical{17.0}=0x75643120 +phy_chain_tx_lane_map_physical{25.0}=0x74653201 +phy_chain_tx_lane_map_physical{33.0}=0x75603124 +phy_chain_tx_lane_map_physical{41.0}=0x64753120 +phy_chain_tx_lane_map_physical{49.0}=0x65741032 +phy_chain_tx_lane_map_physical{57.0}=0x64753210 +phy_chain_tx_lane_map_physical{65.0}=0x65740132 +phy_chain_tx_lane_map_physical{73.0}=0x64753210 +phy_chain_tx_lane_map_physical{81.0}=0x65740132 +phy_chain_tx_lane_map_physical{89.0}=0x64753210 +phy_chain_tx_lane_map_physical{97.0}=0x63057124 +phy_chain_tx_lane_map_physical{105.0}=0x67453021 +phy_chain_tx_lane_map_physical{113.0}=0x76502413 +phy_chain_tx_lane_map_physical{121.0}=0x13257064 +phy_chain_tx_lane_map_physical{129.0}=0x32146057 +phy_chain_tx_lane_map_physical{137.0}=0x57613420 +phy_chain_tx_lane_map_physical{145.0}=0x76502413 +phy_chain_tx_lane_map_physical{153.0}=0x64173520 +phy_chain_tx_lane_map_physical{161.0}=0x56742031 +phy_chain_tx_lane_map_physical{169.0}=0x74601523 +phy_chain_tx_lane_map_physical{177.0}=0x56742031 +phy_chain_tx_lane_map_physical{185.0}=0x74601523 +phy_chain_tx_lane_map_physical{193.0}=0x56742031 +phy_chain_tx_lane_map_physical{201.0}=0x74601523 +phy_chain_tx_lane_map_physical{209.0}=0x56742031 +phy_chain_tx_lane_map_physical{217.0}=0x74603512 +phy_chain_tx_lane_map_physical{225.0}=0x75642031 +phy_chain_tx_lane_map_physical{233.0}=0x57612430 +phy_chain_tx_lane_map_physical{241.0}=0x65742031 +phy_chain_tx_lane_map_physical{249.0}=0x52316470 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{9.0}=0x1 +phy_chain_tx_polarity_flip_physical{10.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{12.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{14.0}=0x0 +phy_chain_tx_polarity_flip_physical{15.0}=0x1 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x1 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x1 +phy_chain_tx_polarity_flip_physical{23.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x1 +phy_chain_tx_polarity_flip_physical{29.0}=0x0 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x1 +phy_chain_tx_polarity_flip_physical{44.0}=0x1 +phy_chain_tx_polarity_flip_physical{45.0}=0x0 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x1 +phy_chain_tx_polarity_flip_physical{51.0}=0x1 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x0 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x1 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x0 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x0 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x1 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x0 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x0 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x1 +phy_chain_tx_polarity_flip_physical{73.0}=0x0 +phy_chain_tx_polarity_flip_physical{74.0}=0x1 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x1 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{80.0}=0x1 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x0 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x0 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x1 +phy_chain_tx_polarity_flip_physical{88.0}=0x1 +phy_chain_tx_polarity_flip_physical{89.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x0 +phy_chain_tx_polarity_flip_physical{92.0}=0x1 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x1 +phy_chain_tx_polarity_flip_physical{96.0}=0x1 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x0 +phy_chain_tx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x1 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x1 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x1 +phy_chain_tx_polarity_flip_physical{106.0}=0x0 +phy_chain_tx_polarity_flip_physical{107.0}=0x0 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x1 +phy_chain_tx_polarity_flip_physical{112.0}=0x0 +phy_chain_tx_polarity_flip_physical{113.0}=0x0 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x0 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x1 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x1 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x0 +phy_chain_tx_polarity_flip_physical{128.0}=0x0 +phy_chain_tx_polarity_flip_physical{129.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x1 +phy_chain_tx_polarity_flip_physical{131.0}=0x0 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x0 +phy_chain_tx_polarity_flip_physical{135.0}=0x0 +phy_chain_tx_polarity_flip_physical{136.0}=0x0 +phy_chain_tx_polarity_flip_physical{137.0}=0x0 +phy_chain_tx_polarity_flip_physical{138.0}=0x0 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x1 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x0 +phy_chain_tx_polarity_flip_physical{144.0}=0x0 +phy_chain_tx_polarity_flip_physical{145.0}=0x0 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x0 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x0 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x1 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x1 +phy_chain_tx_polarity_flip_physical{159.0}=0x1 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x0 +phy_chain_tx_polarity_flip_physical{166.0}=0x0 +phy_chain_tx_polarity_flip_physical{167.0}=0x0 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x1 +phy_chain_tx_polarity_flip_physical{170.0}=0x0 +phy_chain_tx_polarity_flip_physical{171.0}=0x0 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x1 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x0 +phy_chain_tx_polarity_flip_physical{178.0}=0x1 +phy_chain_tx_polarity_flip_physical{179.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x0 +phy_chain_tx_polarity_flip_physical{185.0}=0x1 +phy_chain_tx_polarity_flip_physical{186.0}=0x0 +phy_chain_tx_polarity_flip_physical{187.0}=0x0 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{190.0}=0x1 +phy_chain_tx_polarity_flip_physical{191.0}=0x1 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x0 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x0 +phy_chain_tx_polarity_flip_physical{199.0}=0x0 +phy_chain_tx_polarity_flip_physical{200.0}=0x0 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x0 +phy_chain_tx_polarity_flip_physical{203.0}=0x0 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x0 +phy_chain_tx_polarity_flip_physical{209.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x0 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x0 +phy_chain_tx_polarity_flip_physical{217.0}=0x0 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x1 +phy_chain_tx_polarity_flip_physical{223.0}=0x1 +phy_chain_tx_polarity_flip_physical{224.0}=0x0 +phy_chain_tx_polarity_flip_physical{225.0}=0x0 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x0 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x1 +phy_chain_tx_polarity_flip_physical{235.0}=0x1 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x0 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x0 +phy_chain_tx_polarity_flip_physical{246.0}=0x0 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x1 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x0 +phy_chain_tx_polarity_flip_physical{254.0}=0x0 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x1 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{258.0}=0x0 +portmap_1.0=1:100:4 +portmap_2.0=5:100:4 +portmap_3.0=9:100:4 +portmap_4.0=13:100:4 +portmap_5.0=17:100:4 +portmap_6.0=21:100:4 +portmap_7.0=25:100:4 +portmap_8.0=29:100:4 +portmap_20.0=33:100:4 +portmap_21.0=37:100:4 +portmap_22.0=41:100:4 +portmap_23.0=45:100:4 +portmap_24.0=49:100:4 +portmap_25.0=53:100:4 +portmap_26.0=57:100:4 +portmap_27.0=61:100:4 +portmap_38.0=257:10 +portmap_40.0=65:100:4 +portmap_41.0=69:100:4 +portmap_42.0=73:100:4 +portmap_43.0=77:100:4 +portmap_44.0=81:100:4 +portmap_45.0=85:100:4 +portmap_46.0=89:100:4 +portmap_47.0=93:100:4 +portmap_60.0=97:100:4 +portmap_61.0=101:100:4 +portmap_62.0=105:100:4 +portmap_63.0=109:100:4 +portmap_64.0=113:100:4 +portmap_65.0=117:100:4 +portmap_66.0=121:100:4 +portmap_67.0=125:100:4 +portmap_80.0=129:100:4 +portmap_81.0=133:100:4 +portmap_82.0=137:100:4 +portmap_83.0=141:100:4 +portmap_84.0=145:100:4 +portmap_85.0=149:100:4 +portmap_86.0=153:100:4 +portmap_87.0=157:100:4 +portmap_100.0=161:100:4 +portmap_101.0=165:100:4 +portmap_102.0=169:100:4 +portmap_103.0=173:100:4 +portmap_104.0=177:100:4 +portmap_105.0=181:100:4 +portmap_106.0=185:100:4 +portmap_107.0=189:100:4 +portmap_118.0=258:10 +portmap_120.0=193:100:4 +portmap_121.0=197:100:4 +portmap_122.0=201:100:4 +portmap_123.0=205:100:4 +portmap_124.0=209:100:4 +portmap_125.0=213:100:4 +portmap_126.0=217:100:4 +portmap_127.0=221:100:4 +portmap_140.0=225:100:4 +portmap_141.0=229:100:4 +portmap_142.0=233:100:4 +portmap_143.0=237:100:4 +portmap_144.0=241:100:4 +portmap_145.0=245:100:4 +portmap_146.0=249:100:4 +portmap_147.0=253:100:4 +port_init_autoneg_1.0=0 +port_init_autoneg_2.0=0 +port_init_autoneg_3.0=0 +port_init_autoneg_4.0=0 +port_init_autoneg_5.0=0 +port_init_autoneg_6.0=0 +port_init_autoneg_7.0=0 +port_init_autoneg_8.0=0 +port_init_autoneg_20.0=0 +port_init_autoneg_21.0=0 +port_init_autoneg_22.0=0 +port_init_autoneg_23.0=0 +port_init_autoneg_24.0=0 +port_init_autoneg_25.0=0 +port_init_autoneg_26.0=0 +port_init_autoneg_27.0=0 +port_init_autoneg_38.0=0 +port_init_autoneg_40.0=0 +port_init_autoneg_41.0=0 +port_init_autoneg_42.0=0 +port_init_autoneg_43.0=0 +port_init_autoneg_44.0=0 +port_init_autoneg_45.0=0 +port_init_autoneg_46.0=0 +port_init_autoneg_47.0=0 +port_init_autoneg_60.0=0 +port_init_autoneg_61.0=0 +port_init_autoneg_62.0=0 +port_init_autoneg_63.0=0 +port_init_autoneg_64.0=0 +port_init_autoneg_65.0=0 +port_init_autoneg_66.0=0 +port_init_autoneg_67.0=0 +port_init_autoneg_80.0=0 +port_init_autoneg_81.0=0 +port_init_autoneg_82.0=0 +port_init_autoneg_83.0=0 +port_init_autoneg_84.0=0 +port_init_autoneg_85.0=0 +port_init_autoneg_86.0=0 +port_init_autoneg_87.0=0 +port_init_autoneg_100.0=0 +port_init_autoneg_101.0=0 +port_init_autoneg_102.0=0 +port_init_autoneg_103.0=0 +port_init_autoneg_104.0=0 +port_init_autoneg_105.0=0 +port_init_autoneg_106.0=0 +port_init_autoneg_107.0=0 +port_init_autoneg_118.0=0 +port_init_autoneg_120.0=0 +port_init_autoneg_121.0=0 +port_init_autoneg_122.0=0 +port_init_autoneg_123.0=0 +port_init_autoneg_124.0=0 +port_init_autoneg_125.0=0 +port_init_autoneg_126.0=0 +port_init_autoneg_127.0=0 +port_init_autoneg_140.0=0 +port_init_autoneg_141.0=0 +port_init_autoneg_142.0=0 +port_init_autoneg_143.0=0 +port_init_autoneg_144.0=0 +port_init_autoneg_145.0=0 +port_init_autoneg_146.0=0 +port_init_autoneg_147.0=0 +port_phy_addr_1.0=0xff +port_phy_addr_2.0=0xff +port_phy_addr_3.0=0xff +port_phy_addr_4.0=0xff +port_phy_addr_5.0=0xff +port_phy_addr_6.0=0xff +port_phy_addr_7.0=0xff +port_phy_addr_8.0=0xff +port_phy_addr_20.0=0xff +port_phy_addr_21.0=0xff +port_phy_addr_22.0=0xff +port_phy_addr_23.0=0xff +port_phy_addr_24.0=0xff +port_phy_addr_25.0=0xff +port_phy_addr_26.0=0xff +port_phy_addr_27.0=0xff +port_phy_addr_38.0=0xff +port_phy_addr_40.0=0xff +port_phy_addr_41.0=0xff +port_phy_addr_42.0=0xff +port_phy_addr_43.0=0xff +port_phy_addr_44.0=0xff +port_phy_addr_45.0=0xff +port_phy_addr_46.0=0xff +port_phy_addr_47.0=0xff +port_phy_addr_60.0=0xff +port_phy_addr_61.0=0xff +port_phy_addr_62.0=0xff +port_phy_addr_63.0=0xff +port_phy_addr_64.0=0xff +port_phy_addr_65.0=0xff +port_phy_addr_66.0=0xff +port_phy_addr_67.0=0xff +port_phy_addr_80.0=0xff +port_phy_addr_81.0=0xff +port_phy_addr_82.0=0xff +port_phy_addr_83.0=0xff +port_phy_addr_84.0=0xff +port_phy_addr_85.0=0xff +port_phy_addr_86.0=0xff +port_phy_addr_87.0=0xff +port_phy_addr_100.0=0xff +port_phy_addr_101.0=0xff +port_phy_addr_102.0=0xff +port_phy_addr_103.0=0xff +port_phy_addr_104.0=0xff +port_phy_addr_105.0=0xff +port_phy_addr_106.0=0xff +port_phy_addr_107.0=0xff +port_phy_addr_118.0=0xff +port_phy_addr_120.0=0xff +port_phy_addr_121.0=0xff +port_phy_addr_122.0=0xff +port_phy_addr_123.0=0xff +port_phy_addr_124.0=0xff +port_phy_addr_125.0=0xff +port_phy_addr_126.0=0xff +port_phy_addr_127.0=0xff +port_phy_addr_140.0=0xff +port_phy_addr_141.0=0xff +port_phy_addr_142.0=0xff +port_phy_addr_143.0=0xff +port_phy_addr_144.0=0xff +port_phy_addr_145.0=0xff +port_phy_addr_146.0=0xff +port_phy_addr_147.0=0xff +robust_hash_disable_egress_vlan.0=1 +robust_hash_disable_mpls.0=1 +robust_hash_disable_vlan.0=1 +sram_scan_enable.0=0 +tdma_timeout_usec.0=15000000 +tslam_timeout_usec.0=15000000 diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm new file mode 100644 index 0000000000..c887433952 --- /dev/null +++ b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm @@ -0,0 +1,749 @@ +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile.0=2 +bcm_num_cos.0=8 +bcm_stat_flags=1 +bcm_stat_jumbo.0=9236 +cdma_timeout_usec.0=15000000 +dma_desc_timeout_usec.0=15000000 +dpr_clock_frequency.0=1000 +higig2_hdr_mode.0=1 +ipv6_lpm_128b_enable.0=0 +l2xmsg_mode.0=1 +l2_mem_entries.0=8192 +l3_alpm_enable.0=2 +l3_mem_entries.0=16384 +max_vp_lags.0=0 +miim_intr_enable.0=0 +module_64ports.0=1 +multicast_l2_range.0=511 +num_ipv6_lpm_128b_entries.0=0 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe.0=0xf0000f4000f0000f0000f0000f4000f0001e +phy_an_c37_38.0=2 +phy_an_c37_118.0=2 +phy_an_c73_1.0=1 +phy_an_c73_2.0=1 +phy_an_c73_3.0=1 +phy_an_c73_4.0=1 +phy_an_c73_20.0=1 +phy_an_c73_21.0=1 +phy_an_c73_22.0=1 +phy_an_c73_23.0=1 +phy_an_c73_38.0=0 +phy_an_c73_40.0=1 +phy_an_c73_41.0=1 +phy_an_c73_42.0=1 +phy_an_c73_43.0=1 +phy_an_c73_60.0=1 +phy_an_c73_61.0=1 +phy_an_c73_62.0=1 +phy_an_c73_63.0=1 +phy_an_c73_80.0=1 +phy_an_c73_81.0=1 +phy_an_c73_82.0=1 +phy_an_c73_83.0=1 +phy_an_c73_100.0=1 +phy_an_c73_101.0=1 +phy_an_c73_102.0=1 +phy_an_c73_103.0=1 +phy_an_c73_118.0=0 +phy_an_c73_120.0=1 +phy_an_c73_121.0=1 +phy_an_c73_122.0=1 +phy_an_c73_123.0=1 +phy_an_c73_140.0=1 +phy_an_c73_141.0=1 +phy_an_c73_142.0=1 +phy_an_c73_143.0=1 +phy_chain_rx_lane_map_physical{1.0}=0x72634150 +phy_chain_rx_lane_map_physical{9.0}=0x63725041 +phy_chain_rx_lane_map_physical{17.0}=0x23071465 +phy_chain_rx_lane_map_physical{25.0}=0x03125746 +phy_chain_rx_lane_map_physical{33.0}=0x12063574 +phy_chain_rx_lane_map_physical{41.0}=0x03125647 +phy_chain_rx_lane_map_physical{49.0}=0x12053467 +phy_chain_rx_lane_map_physical{57.0}=0x03125647 +phy_chain_rx_lane_map_physical{65.0}=0x12043576 +phy_chain_rx_lane_map_physical{73.0}=0x03125746 +phy_chain_rx_lane_map_physical{81.0}=0x12043576 +phy_chain_rx_lane_map_physical{89.0}=0x03125746 +phy_chain_rx_lane_map_physical{97.0}=0x40165327 +phy_chain_rx_lane_map_physical{105.0}=0x56470213 +phy_chain_rx_lane_map_physical{113.0}=0x21340576 +phy_chain_rx_lane_map_physical{121.0}=0x47562130 +phy_chain_rx_lane_map_physical{129.0}=0x56437201 +phy_chain_rx_lane_map_physical{137.0}=0x03125647 +phy_chain_rx_lane_map_physical{145.0}=0x12043576 +phy_chain_rx_lane_map_physical{153.0}=0x54106723 +phy_chain_rx_lane_map_physical{161.0}=0x63257014 +phy_chain_rx_lane_map_physical{169.0}=0x03125647 +phy_chain_rx_lane_map_physical{177.0}=0x12043567 +phy_chain_rx_lane_map_physical{185.0}=0x03125647 +phy_chain_rx_lane_map_physical{193.0}=0x12043567 +phy_chain_rx_lane_map_physical{201.0}=0x03125647 +phy_chain_rx_lane_map_physical{209.0}=0x12043576 +phy_chain_rx_lane_map_physical{217.0}=0x03125467 +phy_chain_rx_lane_map_physical{225.0}=0x12073465 +phy_chain_rx_lane_map_physical{233.0}=0x30215647 +phy_chain_rx_lane_map_physical{241.0}=0x23071564 +phy_chain_rx_lane_map_physical{249.0}=0x72634150 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x0 +phy_chain_rx_polarity_flip_physical{6.0}=0x1 +phy_chain_rx_polarity_flip_physical{7.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x0 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{13.0}=0x0 +phy_chain_rx_polarity_flip_physical{14.0}=0x1 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{17.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{22.0}=0x1 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x1 +phy_chain_rx_polarity_flip_physical{25.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x1 +phy_chain_rx_polarity_flip_physical{27.0}=0x0 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{30.0}=0x1 +phy_chain_rx_polarity_flip_physical{31.0}=0x1 +phy_chain_rx_polarity_flip_physical{32.0}=0x0 +phy_chain_rx_polarity_flip_physical{33.0}=0x1 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x0 +phy_chain_rx_polarity_flip_physical{36.0}=0x0 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x0 +phy_chain_rx_polarity_flip_physical{45.0}=0x0 +phy_chain_rx_polarity_flip_physical{46.0}=0x1 +phy_chain_rx_polarity_flip_physical{47.0}=0x1 +phy_chain_rx_polarity_flip_physical{48.0}=0x0 +phy_chain_rx_polarity_flip_physical{49.0}=0x0 +phy_chain_rx_polarity_flip_physical{50.0}=0x0 +phy_chain_rx_polarity_flip_physical{51.0}=0x1 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x1 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x1 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{60.0}=0x0 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x0 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x0 +phy_chain_rx_polarity_flip_physical{69.0}=0x1 +phy_chain_rx_polarity_flip_physical{70.0}=0x1 +phy_chain_rx_polarity_flip_physical{71.0}=0x0 +phy_chain_rx_polarity_flip_physical{72.0}=0x0 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x1 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x0 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x1 +phy_chain_rx_polarity_flip_physical{91.0}=0x0 +phy_chain_rx_polarity_flip_physical{92.0}=0x0 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x1 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x0 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x1 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x0 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x1 +phy_chain_rx_polarity_flip_physical{107.0}=0x0 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x1 +phy_chain_rx_polarity_flip_physical{112.0}=0x0 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x1 +phy_chain_rx_polarity_flip_physical{115.0}=0x0 +phy_chain_rx_polarity_flip_physical{116.0}=0x1 +phy_chain_rx_polarity_flip_physical{117.0}=0x1 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x1 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x0 +phy_chain_rx_polarity_flip_physical{124.0}=0x1 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x0 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{130.0}=0x0 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x0 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x0 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x1 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x0 +phy_chain_rx_polarity_flip_physical{142.0}=0x1 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x1 +phy_chain_rx_polarity_flip_physical{147.0}=0x0 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x0 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x0 +phy_chain_rx_polarity_flip_physical{156.0}=0x1 +phy_chain_rx_polarity_flip_physical{157.0}=0x1 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x1 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x0 +phy_chain_rx_polarity_flip_physical{168.0}=0x0 +phy_chain_rx_polarity_flip_physical{169.0}=0x0 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x1 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x1 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x0 +phy_chain_rx_polarity_flip_physical{177.0}=0x0 +phy_chain_rx_polarity_flip_physical{178.0}=0x0 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x1 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x0 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{190.0}=0x1 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x0 +phy_chain_rx_polarity_flip_physical{196.0}=0x0 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x1 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x0 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x1 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x1 +phy_chain_rx_polarity_flip_physical{214.0}=0x1 +phy_chain_rx_polarity_flip_physical{215.0}=0x0 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x1 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{220.0}=0x0 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x1 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x0 +phy_chain_rx_polarity_flip_physical{225.0}=0x0 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x1 +phy_chain_rx_polarity_flip_physical{228.0}=0x0 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{230.0}=0x1 +phy_chain_rx_polarity_flip_physical{231.0}=0x0 +phy_chain_rx_polarity_flip_physical{232.0}=0x0 +phy_chain_rx_polarity_flip_physical{233.0}=0x0 +phy_chain_rx_polarity_flip_physical{234.0}=0x1 +phy_chain_rx_polarity_flip_physical{235.0}=0x1 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x1 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x0 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x0 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x1 +phy_chain_rx_polarity_flip_physical{249.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x0 +phy_chain_rx_polarity_flip_physical{253.0}=0x0 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x1 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{258.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x13245076 +phy_chain_tx_lane_map_physical{9.0}=0x76501423 +phy_chain_tx_lane_map_physical{17.0}=0x75643120 +phy_chain_tx_lane_map_physical{25.0}=0x74653201 +phy_chain_tx_lane_map_physical{33.0}=0x75603124 +phy_chain_tx_lane_map_physical{41.0}=0x64753120 +phy_chain_tx_lane_map_physical{49.0}=0x65741032 +phy_chain_tx_lane_map_physical{57.0}=0x64753210 +phy_chain_tx_lane_map_physical{65.0}=0x65740132 +phy_chain_tx_lane_map_physical{73.0}=0x64753210 +phy_chain_tx_lane_map_physical{81.0}=0x65740132 +phy_chain_tx_lane_map_physical{89.0}=0x64753210 +phy_chain_tx_lane_map_physical{97.0}=0x63057124 +phy_chain_tx_lane_map_physical{105.0}=0x67453021 +phy_chain_tx_lane_map_physical{113.0}=0x76502413 +phy_chain_tx_lane_map_physical{121.0}=0x13257064 +phy_chain_tx_lane_map_physical{129.0}=0x32146057 +phy_chain_tx_lane_map_physical{137.0}=0x57613420 +phy_chain_tx_lane_map_physical{145.0}=0x76502413 +phy_chain_tx_lane_map_physical{153.0}=0x64173520 +phy_chain_tx_lane_map_physical{161.0}=0x56742031 +phy_chain_tx_lane_map_physical{169.0}=0x74601523 +phy_chain_tx_lane_map_physical{177.0}=0x56742031 +phy_chain_tx_lane_map_physical{185.0}=0x74601523 +phy_chain_tx_lane_map_physical{193.0}=0x56742031 +phy_chain_tx_lane_map_physical{201.0}=0x74601523 +phy_chain_tx_lane_map_physical{209.0}=0x56742031 +phy_chain_tx_lane_map_physical{217.0}=0x74603512 +phy_chain_tx_lane_map_physical{225.0}=0x75642031 +phy_chain_tx_lane_map_physical{233.0}=0x57612430 +phy_chain_tx_lane_map_physical{241.0}=0x65742031 +phy_chain_tx_lane_map_physical{249.0}=0x52316470 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{9.0}=0x1 +phy_chain_tx_polarity_flip_physical{10.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{12.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{14.0}=0x0 +phy_chain_tx_polarity_flip_physical{15.0}=0x1 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x1 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x1 +phy_chain_tx_polarity_flip_physical{23.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x1 +phy_chain_tx_polarity_flip_physical{29.0}=0x0 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x1 +phy_chain_tx_polarity_flip_physical{44.0}=0x1 +phy_chain_tx_polarity_flip_physical{45.0}=0x0 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x1 +phy_chain_tx_polarity_flip_physical{51.0}=0x1 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x0 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x1 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x0 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x0 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x1 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x0 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x0 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x1 +phy_chain_tx_polarity_flip_physical{73.0}=0x0 +phy_chain_tx_polarity_flip_physical{74.0}=0x1 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x1 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{80.0}=0x1 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x0 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x0 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x1 +phy_chain_tx_polarity_flip_physical{88.0}=0x1 +phy_chain_tx_polarity_flip_physical{89.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x0 +phy_chain_tx_polarity_flip_physical{92.0}=0x1 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x1 +phy_chain_tx_polarity_flip_physical{96.0}=0x1 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x0 +phy_chain_tx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x1 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x1 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x1 +phy_chain_tx_polarity_flip_physical{106.0}=0x0 +phy_chain_tx_polarity_flip_physical{107.0}=0x0 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x1 +phy_chain_tx_polarity_flip_physical{112.0}=0x0 +phy_chain_tx_polarity_flip_physical{113.0}=0x0 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x0 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x1 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x1 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x0 +phy_chain_tx_polarity_flip_physical{128.0}=0x0 +phy_chain_tx_polarity_flip_physical{129.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x1 +phy_chain_tx_polarity_flip_physical{131.0}=0x0 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x0 +phy_chain_tx_polarity_flip_physical{135.0}=0x0 +phy_chain_tx_polarity_flip_physical{136.0}=0x0 +phy_chain_tx_polarity_flip_physical{137.0}=0x0 +phy_chain_tx_polarity_flip_physical{138.0}=0x0 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x1 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x0 +phy_chain_tx_polarity_flip_physical{144.0}=0x0 +phy_chain_tx_polarity_flip_physical{145.0}=0x0 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x0 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x0 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x1 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x1 +phy_chain_tx_polarity_flip_physical{159.0}=0x1 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x0 +phy_chain_tx_polarity_flip_physical{166.0}=0x0 +phy_chain_tx_polarity_flip_physical{167.0}=0x0 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x1 +phy_chain_tx_polarity_flip_physical{170.0}=0x0 +phy_chain_tx_polarity_flip_physical{171.0}=0x0 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x1 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x0 +phy_chain_tx_polarity_flip_physical{178.0}=0x1 +phy_chain_tx_polarity_flip_physical{179.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x0 +phy_chain_tx_polarity_flip_physical{185.0}=0x1 +phy_chain_tx_polarity_flip_physical{186.0}=0x0 +phy_chain_tx_polarity_flip_physical{187.0}=0x0 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{190.0}=0x1 +phy_chain_tx_polarity_flip_physical{191.0}=0x1 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x0 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x0 +phy_chain_tx_polarity_flip_physical{199.0}=0x0 +phy_chain_tx_polarity_flip_physical{200.0}=0x0 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x0 +phy_chain_tx_polarity_flip_physical{203.0}=0x0 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x0 +phy_chain_tx_polarity_flip_physical{209.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x0 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x0 +phy_chain_tx_polarity_flip_physical{217.0}=0x0 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x1 +phy_chain_tx_polarity_flip_physical{223.0}=0x1 +phy_chain_tx_polarity_flip_physical{224.0}=0x0 +phy_chain_tx_polarity_flip_physical{225.0}=0x0 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x0 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x1 +phy_chain_tx_polarity_flip_physical{235.0}=0x1 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x0 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x0 +phy_chain_tx_polarity_flip_physical{246.0}=0x0 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x1 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x0 +phy_chain_tx_polarity_flip_physical{254.0}=0x0 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x1 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{258.0}=0x0 +portmap_1.0=1:400 +portmap_2.0=9:400 +portmap_3.0=17:400 +portmap_4.0=25:400 +portmap_20.0=33:400 +portmap_21.0=41:400 +portmap_22.0=49:400 +portmap_23.0=57:400 +portmap_38.0=257:10 +portmap_40.0=65:400 +portmap_41.0=73:400 +portmap_42.0=81:400 +portmap_43.0=89:400 +portmap_60.0=97:400 +portmap_61.0=105:400 +portmap_62.0=113:400 +portmap_63.0=121:400 +portmap_80.0=129:400 +portmap_81.0=137:400 +portmap_82.0=145:400 +portmap_83.0=153:400 +portmap_100.0=161:400 +portmap_101.0=169:400 +portmap_102.0=177:400 +portmap_103.0=185:400 +portmap_118.0=258:10 +portmap_120.0=193:400 +portmap_121.0=201:400 +portmap_122.0=209:400 +portmap_123.0=217:400 +portmap_140.0=225:400 +portmap_141.0=233:400 +portmap_142.0=241:400 +portmap_143.0=249:400 +port_init_autoneg_1.0=0 +port_init_autoneg_2.0=0 +port_init_autoneg_3.0=0 +port_init_autoneg_4.0=0 +port_init_autoneg_20.0=0 +port_init_autoneg_21.0=0 +port_init_autoneg_22.0=0 +port_init_autoneg_23.0=0 +port_init_autoneg_38.0=0 +port_init_autoneg_40.0=0 +port_init_autoneg_41.0=0 +port_init_autoneg_42.0=0 +port_init_autoneg_43.0=0 +port_init_autoneg_60.0=0 +port_init_autoneg_61.0=0 +port_init_autoneg_62.0=0 +port_init_autoneg_63.0=0 +port_init_autoneg_80.0=0 +port_init_autoneg_81.0=0 +port_init_autoneg_82.0=0 +port_init_autoneg_83.0=0 +port_init_autoneg_100.0=0 +port_init_autoneg_101.0=0 +port_init_autoneg_102.0=0 +port_init_autoneg_103.0=0 +port_init_autoneg_118.0=0 +port_init_autoneg_120.0=0 +port_init_autoneg_121.0=0 +port_init_autoneg_122.0=0 +port_init_autoneg_123.0=0 +port_init_autoneg_140.0=0 +port_init_autoneg_141.0=0 +port_init_autoneg_142.0=0 +port_init_autoneg_143.0=0 +port_phy_addr_1.0=0xff +port_phy_addr_2.0=0xff +port_phy_addr_3.0=0xff +port_phy_addr_4.0=0xff +port_phy_addr_20.0=0xff +port_phy_addr_21.0=0xff +port_phy_addr_22.0=0xff +port_phy_addr_23.0=0xff +port_phy_addr_38.0=0xff +port_phy_addr_40.0=0xff +port_phy_addr_41.0=0xff +port_phy_addr_42.0=0xff +port_phy_addr_43.0=0xff +port_phy_addr_60.0=0xff +port_phy_addr_61.0=0xff +port_phy_addr_62.0=0xff +port_phy_addr_63.0=0xff +port_phy_addr_80.0=0xff +port_phy_addr_81.0=0xff +port_phy_addr_82.0=0xff +port_phy_addr_83.0=0xff +port_phy_addr_100.0=0xff +port_phy_addr_101.0=0xff +port_phy_addr_102.0=0xff +port_phy_addr_103.0=0xff +port_phy_addr_118.0=0xff +port_phy_addr_120.0=0xff +port_phy_addr_121.0=0xff +port_phy_addr_122.0=0xff +port_phy_addr_123.0=0xff +port_phy_addr_140.0=0xff +port_phy_addr_141.0=0xff +port_phy_addr_142.0=0xff +port_phy_addr_143.0=0xff +robust_hash_disable_egress_vlan.0=1 +robust_hash_disable_mpls.0=1 +robust_hash_disable_vlan.0=1 +sram_scan_enable.0=0 +tdma_timeout_usec.0=15000000 +tslam_timeout_usec.0=15000000 diff --git a/device/arista/x86_64-arista_7060px4_32/plugins b/device/arista/x86_64-arista_7060px4_32/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7060px4_32/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7170_64c/plugins b/device/arista/x86_64-arista_7170_64c/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7170_64c/plugins/eeprom.py b/device/arista/x86_64-arista_7170_64c/plugins/eeprom.py deleted file mode 100644 index d439e442ee..0000000000 --- a/device/arista/x86_64-arista_7170_64c/plugins/eeprom.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -try: - import arista.utils.sonic_eeprom as arista_eeprom -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7170_64c/plugins/led_control.py b/device/arista/x86_64-arista_7170_64c/plugins/led_control.py deleted file mode 100644 index fae2d504be..0000000000 --- a/device/arista/x86_64-arista_7170_64c/plugins/led_control.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -try: - import arista.utils.sonic_leds as arista_leds -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7170_64c/plugins/psuutil.py b/device/arista/x86_64-arista_7170_64c/plugins/psuutil.py deleted file mode 100644 index 1a8682ae3c..0000000000 --- a/device/arista/x86_64-arista_7170_64c/plugins/psuutil.py +++ /dev/null @@ -1,12 +0,0 @@ -# psuutil.py -# -# Platform-specific PSU interface for SONiC -# - -try: - import arista.utils.sonic_psu as arista_psuutil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7170_64c/plugins/sfputil.py b/device/arista/x86_64-arista_7170_64c/plugins/sfputil.py deleted file mode 100644 index 1357ad7864..0000000000 --- a/device/arista/x86_64-arista_7170_64c/plugins/sfputil.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -try: - import arista.utils.sonic_sfputil as arista_sfputil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins b/device/arista/x86_64-arista_7260cx3_64/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins/eeprom.py b/device/arista/x86_64-arista_7260cx3_64/plugins/eeprom.py deleted file mode 100644 index c4485e8959..0000000000 --- a/device/arista/x86_64-arista_7260cx3_64/plugins/eeprom.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -""" -Arista 7260CX3-64 eeprom plugin -Uses the arista driver library to obtain the TlvInfoDecoder -""" - -try: - import arista.utils.sonic_eeprom as arista_eeprom -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py b/device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py deleted file mode 100644 index 8d387e513c..0000000000 --- a/device/arista/x86_64-arista_7260cx3_64/plugins/led_control.py +++ /dev/null @@ -1,6 +0,0 @@ -try: - import arista.utils.sonic_leds as arista_leds -except ImportError, e: - raise ImportError (str(e) + "- required module not found") - -LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins/psuutil.py b/device/arista/x86_64-arista_7260cx3_64/plugins/psuutil.py deleted file mode 100644 index 1a8682ae3c..0000000000 --- a/device/arista/x86_64-arista_7260cx3_64/plugins/psuutil.py +++ /dev/null @@ -1,12 +0,0 @@ -# psuutil.py -# -# Platform-specific PSU interface for SONiC -# - -try: - import arista.utils.sonic_psu as arista_psuutil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins/sfputil.py b/device/arista/x86_64-arista_7260cx3_64/plugins/sfputil.py deleted file mode 100644 index 9a6d770d46..0000000000 --- a/device/arista/x86_64-arista_7260cx3_64/plugins/sfputil.py +++ /dev/null @@ -1,12 +0,0 @@ -# sfputil.py -# -# Platform-specific SFP transceiver interface for SONiC -# - -try: - import arista.utils.sonic_sfputil as arista_sfputil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - - -SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins b/device/arista/x86_64-arista_7280cr3_32p4/plugins new file mode 120000 index 0000000000..5fbbf98a62 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3_32p4/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/eeprom.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/eeprom.py deleted file mode 100644 index d439e442ee..0000000000 --- a/device/arista/x86_64-arista_7280cr3_32p4/plugins/eeprom.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -try: - import arista.utils.sonic_eeprom as arista_eeprom -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -board = arista_eeprom.getTlvInfoDecoder() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/led_control.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/led_control.py deleted file mode 100644 index fae2d504be..0000000000 --- a/device/arista/x86_64-arista_7280cr3_32p4/plugins/led_control.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -try: - import arista.utils.sonic_leds as arista_leds -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -LedControl = arista_leds.getLedControl() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/psuutil.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/psuutil.py deleted file mode 100644 index d5ff3063dd..0000000000 --- a/device/arista/x86_64-arista_7280cr3_32p4/plugins/psuutil.py +++ /dev/null @@ -1,8 +0,0 @@ -# psuutil.py - -try: - import arista.utils.sonic_psu as arista_psuutil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -PsuUtil = arista_psuutil.getPsuUtil() diff --git a/device/arista/x86_64-arista_7280cr3_32p4/plugins/sfputil.py b/device/arista/x86_64-arista_7280cr3_32p4/plugins/sfputil.py deleted file mode 100644 index 1357ad7864..0000000000 --- a/device/arista/x86_64-arista_7280cr3_32p4/plugins/sfputil.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python - -try: - import arista.utils.sonic_sfputil as arista_sfputil -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -SfpUtil = arista_sfputil.getSfpUtil() diff --git a/device/arista/x86_64-arista_7060px4_32/plugins/eeprom.py b/device/arista/x86_64-arista_common/plugins/eeprom.py similarity index 66% rename from device/arista/x86_64-arista_7060px4_32/plugins/eeprom.py rename to device/arista/x86_64-arista_common/plugins/eeprom.py index 02c7bc84bc..5c02869790 100644 --- a/device/arista/x86_64-arista_7060px4_32/plugins/eeprom.py +++ b/device/arista/x86_64-arista_common/plugins/eeprom.py @@ -1,5 +1,10 @@ #!/usr/bin/env python +# +# Arista eeprom processing for SONiC +# Uses the arista driver library to obtain the TlvInfoDecoder +# + try: import arista.utils.sonic_eeprom as arista_eeprom except ImportError as e: diff --git a/device/arista/x86_64-arista_7060px4_32/plugins/led_control.py b/device/arista/x86_64-arista_common/plugins/led_control.py similarity index 75% rename from device/arista/x86_64-arista_7060px4_32/plugins/led_control.py rename to device/arista/x86_64-arista_common/plugins/led_control.py index e1fb4f2618..febb04ad16 100644 --- a/device/arista/x86_64-arista_7060px4_32/plugins/led_control.py +++ b/device/arista/x86_64-arista_common/plugins/led_control.py @@ -1,3 +1,9 @@ +#!/usr/bin/env python + +# +# Arista LED controls for SONiC +# + try: import arista.utils.sonic_leds as arista_leds except ImportError as e: diff --git a/device/arista/x86_64-arista_7060px4_32/plugins/psuutil.py b/device/arista/x86_64-arista_common/plugins/psuutil.py similarity index 76% rename from device/arista/x86_64-arista_7060px4_32/plugins/psuutil.py rename to device/arista/x86_64-arista_common/plugins/psuutil.py index 075f0e049a..46ec6b32e2 100644 --- a/device/arista/x86_64-arista_7060px4_32/plugins/psuutil.py +++ b/device/arista/x86_64-arista_common/plugins/psuutil.py @@ -1,6 +1,7 @@ -# psuutil.py +#!/usr/bin/env python + # -# Platform-specific PSU interface for SONiC +# Arista PSU interface for SONiC # try: diff --git a/device/arista/x86_64-arista_7060px4_32/plugins/sfputil.py b/device/arista/x86_64-arista_common/plugins/sfputil.py similarity index 73% rename from device/arista/x86_64-arista_7060px4_32/plugins/sfputil.py rename to device/arista/x86_64-arista_common/plugins/sfputil.py index de4de867f0..5e02eef69a 100644 --- a/device/arista/x86_64-arista_7060px4_32/plugins/sfputil.py +++ b/device/arista/x86_64-arista_common/plugins/sfputil.py @@ -1,6 +1,7 @@ -# sfputil.py +#!/usr/bin/env python + # -# Platform-specific SFP transceiver interface for SONiC +# Arista SFP transceiver interface for SONiC # try: diff --git a/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/config_th_32x100.bcm b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/config_th_32x100.bcm new file mode 100644 index 0000000000..16f18dcd2f --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/config_th_32x100.bcm @@ -0,0 +1,77 @@ +portmap_1=1:100 +portmap_2=5:100 +portmap_3=9:100 +portmap_4=13:100 +portmap_5=17:100 +portmap_6=21:100 +portmap_7=25:100 +portmap_8=29:100 +portmap_34=33:100 +portmap_35=37:100 +portmap_36=41:100 +portmap_37=45:100 +portmap_38=49:100 +portmap_39=53:100 +portmap_40=57:100 +portmap_41=61:100 +portmap_68=65:100 +portmap_69=69:100 +portmap_70=73:100 +portmap_71=77:100 +portmap_72=81:100 +portmap_73=85:100 +portmap_74=89:100 +portmap_75=93:100 +portmap_102=97:100 +portmap_103=101:100 +portmap_104=105:100 +portmap_105=109:100 +portmap_106=113:100 +portmap_107=117:100 +portmap_108=121:100 +portmap_109=125:100 +oversubscribe_mode=1 +portmap_66=129:10 +portmap_100=131:10 +pbmp_xport_xe=0x3fd000000ff4000003fc000001fe +portmap_33=132:10 +portmap_67=133:10 +portmap_101=134:10 +portmap_135=135:10 +xgxs_tx_lane_map_ce18=0x1032 +xgxs_rx_lane_map_ce18=0x1032 +xgxs_rx_lane_map_ce19=0x2301 +xgxs_rx_lane_map_ce20=0x2301 +xgxs_rx_lane_map_ce21=0x2301 +xgxs_rx_lane_map_ce22=0x2301 +xgxs_rx_lane_map_ce23=0x2301 +xgxs_rx_lane_map_ce24=0x2301 +xgxs_rx_lane_map_ce25=0x2301 +xgxs_rx_lane_map_ce26=0x2301 +xgxs_rx_lane_map_ce27=0x2301 +xgxs_rx_lane_map_ce28=0x2301 +phy_xaui_rx_polarity_flip_ce4=0x2 +phy_xaui_tx_polarity_flip_ce5=0x8 +phy_xaui_rx_polarity_flip_ce5=0x5 +phy_xaui_rx_polarity_flip_ce6=0x2 +phy_xaui_tx_polarity_flip_ce7=0x8 +phy_xaui_tx_polarity_flip_ce8=0x8 +phy_xaui_rx_polarity_flip_ce8=0x8 +phy_xaui_tx_polarity_flip_ce10=0x8 +phy_xaui_rx_polarity_flip_ce10=0x1 +phy_xaui_rx_polarity_flip_ce11=0x2 +phy_xaui_tx_polarity_flip_ce19=0x2 +phy_xaui_rx_polarity_flip_ce19=0x3 +phy_xaui_tx_polarity_flip_ce20=0x8 +phy_xaui_rx_polarity_flip_ce21=0x4 +phy_xaui_tx_polarity_flip_ce22=0x8 +phy_xaui_rx_polarity_flip_ce22=0x8 +phy_xaui_rx_polarity_flip_ce23=0x4 +phy_xaui_rx_polarity_flip_ce24=0x4 +phy_xaui_tx_polarity_flip_ce25=0x8 +phy_xaui_rx_polarity_flip_ce25=0x8 +phy_xaui_rx_polarity_flip_ce26=0x4 +phy_xaui_tx_polarity_flip_ce27=0x8 +phy_xaui_rx_polarity_flip_ce27=0x8 +l2xmsg_mode=1 +fpem_mem_entries=32768 diff --git a/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/port_config.ini b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/port_config.ini new file mode 100644 index 0000000000..21c7013090 --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/port_config.ini @@ -0,0 +1,33 @@ +# name lanes alias index speed +Ethernet0 1,2,3,4 Ethernet1/0/1 0 100000 +Ethernet4 5,6,7,8 Ethernet1/0/5 1 100000 +Ethernet8 9,10,11,12 Ethernet1/0/9 2 100000 +Ethernet12 13,14,15,16 Ethernet1/0/13 3 100000 +Ethernet16 17,18,19,20 Ethernet1/0/17 4 100000 +Ethernet20 21,22,23,24 Ethernet1/0/21 5 100000 +Ethernet24 25,26,27,28 Ethernet1/0/25 6 100000 +Ethernet28 29,30,31,32 Ethernet1/0/29 7 100000 +Ethernet32 33,34,35,36 Ethernet1/0/33 8 100000 +Ethernet36 37,38,39,40 Ethernet1/0/37 9 100000 +Ethernet40 41,42,43,44 Ethernet1/0/41 10 100000 +Ethernet44 45,46,47,48 Ethernet1/0/45 11 100000 +Ethernet48 49,50,51,52 Ethernet1/0/49 12 100000 +Ethernet52 53,54,55,56 Ethernet1/0/53 13 100000 +Ethernet56 57,58,59,60 Ethernet1/0/57 14 100000 +Ethernet60 61,62,63,64 Ethernet1/0/61 15 100000 +Ethernet64 65,66,67,68 Ethernet1/0/65 16 100000 +Ethernet68 69,70,71,72 Ethernet1/0/69 17 100000 +Ethernet72 73,74,75,76 Ethernet1/0/73 18 100000 +Ethernet76 77,78,79,80 Ethernet1/0/77 19 100000 +Ethernet80 81,82,83,84 Ethernet1/0/81 20 100000 +Ethernet84 85,86,87,88 Ethernet1/0/85 21 100000 +Ethernet88 89,90,91,92 Ethernet1/0/89 22 100000 +Ethernet92 93,94,95,96 Ethernet1/0/93 23 100000 +Ethernet96 97,98,99,100 Ethernet1/0/97 24 100000 +Ethernet100 101,102,103,104 Ethernet1/0/101 25 100000 +Ethernet104 105,106,107,108 Ethernet1/0/105 26 100000 +Ethernet108 109,110,111,112 Ethernet1/0/109 27 100000 +Ethernet112 113,114,115,116 Ethernet1/0/113 28 100000 +Ethernet116 117,118,119,120 Ethernet1/0/117 29 100000 +Ethernet120 121,122,123,124 Ethernet1/0/121 30 100000 +Ethernet124 125,126,127,128 Ethernet1/0/125 31 100000 diff --git a/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/sai.profile b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/sai.profile new file mode 100644 index 0000000000..80aa570ddf --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/config_th_32x100.bcm diff --git a/device/broadcom/x86_64-bcm_xlr-r0/default_sku b/device/broadcom/x86_64-bcm_xlr-r0/default_sku new file mode 100644 index 0000000000..0f9dd1d379 --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/default_sku @@ -0,0 +1 @@ +bcm_xlr t1 diff --git a/device/broadcom/x86_64-bcm_xlr-r0/installer.conf b/device/broadcom/x86_64-bcm_xlr-r0/installer.conf new file mode 100644 index 0000000000..32c7bd1c17 --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/installer.conf @@ -0,0 +1,9 @@ +if [ -d /sys/devices/pci0000:00/0000:00:13.0 ]; then + CONSOLE_PORT=0x3e8 + CONSOLE_DEV=2 +else + CONSOLE_PORT=0x3f8 + CONSOLE_DEV=0 +fi +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.dma=0 libata.noacpi=1" +CONSOLE_SPEED=115200 diff --git a/device/broadcom/x86_64-bcm_xlr-r0/plugins/eeprom.py b/device/broadcom/x86_64-bcm_xlr-r0/plugins/eeprom.py new file mode 100644 index 0000000000..ce122d6ffa --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/plugins/eeprom.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +############################################################################# +# Broadcom XLR/GTS 'eeprom' support +# +# Platform and model specific eeprom subclass, inherits from the base class, +# and provides the followings: +# - the eeprom format definition +# - specific encoder/decoder if there is special need +# +# Note: the file /etc/sys_eeprom.bin is generated by the script +# brcm-xlr-gts-create-eeprom-file.py +############################################################################# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError, e: + raise ImportError (str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/etc/sys_eeprom.bin" + super(board, self).__init__(self.eeprom_path, 0, '', False, True) + + def serial_number_str(self, e): + """Return service tag instead of serial number""" + return "No service tag" diff --git a/device/broadcom/x86_64-bcm_xlr-r0/plugins/psuutil.py b/device/broadcom/x86_64-bcm_xlr-r0/plugins/psuutil.py new file mode 100644 index 0000000000..5cfdda1578 --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/plugins/psuutil.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + def __init__(self): + PsuBase.__init__(self) + + def get_num_psus(self): + """ + Retrieves the number of PSUs available on the device + + :return: An integer, the number of PSUs available on the device + """ + return 0 + + def get_psu_status(self, index): + """ + Retrieves the oprational status of power supply unit (PSU) defined by 1-based index + + :param index: An integer, 1-based index of the PSU of which to query status + :return: Boolean, True if PSU is operating properly, False if PSU is faulty + """ + return False + + def get_psu_presence(self, index): + """ + Retrieves the presence status of power supply unit (PSU) defined by 1-based index + + :param index: An integer, 1-based index of the PSU of which to query status + :return: Boolean, True if PSU is plugged, False if not + """ + return False diff --git a/device/broadcom/x86_64-bcm_xlr-r0/plugins/sfputil.py b/device/broadcom/x86_64-bcm_xlr-r0/plugins/sfputil.py new file mode 100644 index 0000000000..3dc25793ba --- /dev/null +++ b/device/broadcom/x86_64-bcm_xlr-r0/plugins/sfputil.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +try: + import time + import os + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 1 + PORT_END = 52 + _port_to_eeprom_mapping = {} + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return [] + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + return False + + def get_low_power_mode(self, port_num): + raise NotImplementedError + + def set_low_power_mode(self, port_num, lpmode): + raise NotImplementedError + + def reset(self, port_num): + raise NotImplementedError + + def get_transceiver_change_event(self, timeout=0): + raise NotImplementedError diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot b/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot index 6af6ac48df..dc6e3d517a 100755 --- a/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot +++ b/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot @@ -1,13 +1,56 @@ -#!/bin/sh +#!/usr/bin/python +import sys +import os +import struct -# Export GPIO10 if needed -[ -d /sys/class/gpio/gpio10 ] || echo 10 > /sys/class/gpio/export -echo out > /sys/class/gpio/gpio10/direction +NVRAM_RES = '/dev/nvram' +COLD_RESET = 0xE # Cold Reset +WARM_RESET = 0x6 # Warm Reset -#Toggle GPIO10 pin (to reset MUX) -echo 1 > /sys/class/gpio/gpio10/value -echo 0 > /sys/class/gpio/gpio10/value +def io_reg_write(resource, offset, val): + fd = os.open(resource, os.O_RDWR) + if(fd < 0): + print 'file open failed %s" % resource' + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print 'lseek failed on %s' % resource + return + ret = os.write(fd, struct.pack('B', val)) + if(ret != 1): + print 'write failed %d' % ret + return + os.close(fd) -#Power Reset -echo 1 > /sys/devices/platform/dell-s6000-cpld.0/power_reset +def power_reset(val): + with open('/sys/devices/platform/dell-s6000-cpld.0/power_reset', 'w') as p: + p.write(str(int(val)) + '\n') + p.flush() + +def gpio_direction(pin,direction): + kernpath = '/sys/class/gpio/gpio'+str(pin)+'/direction' + with open(('kernpath'), 'w') as p: + p.write(str(direction) + '\n') + p.flush() + +def gpio_set(pin,value): + kernpath = '/sys/class/gpio/gpio'+str(pin)+'/value' + with open(('kernpath'), 'w') as p: + p.write(str(int(value)) + '\n') + p.flush() + +def gpio_export(value): + with open('/sys/class/gpio/export', 'w') as p: + p.write(str(int(value)) + '\n') + p.flush() + + +if __name__ == "__main__": + io_reg_write(NVRAM_RES, 0x49, COLD_RESET) + if not os.path.isdir("/sys/class/gpio/gpio10"): + gpio_export(10) + gpio_direction("10","out") + #Toggle GPIO10 pin (to reset MUX) + gpio_set("10",1) + gpio_set("10",0) + power_reset(1) diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/media_settings.json b/device/dell/x86_64-dell_z9100_c2538-r0/media_settings.json new file mode 100644 index 0000000000..9bb0a75978 --- /dev/null +++ b/device/dell/x86_64-dell_z9100_c2538-r0/media_settings.json @@ -0,0 +1,751 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "AMPHENOL-NDARHF-M201": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x8" + } + }, + "AMPHENOL-NDAAFF-M201": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808", + "lane2":"0x006808", + "lane3":"0x006808" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x8", + "lane2":"0x8", + "lane3":"0x8" + } + }, + "MOLEX-1003461101": { + "preemphasis": { + "lane0":"0x046804", + "lane1":"0x046804" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x8" + } + }, + "AMPHENOL-NDARHF-M206": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb" + } + }, + "AMPHENOL-NDAAFF-M206": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808", + "lane2":"0x006808", + "lane3":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + }, + "AMPHENOL-NDARHJ-M206": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb" + } + }, + "MOLEX-1003463151": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb" + } + }, + "AMPHENOL-NDARHJ-M202": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb" + } + }, + "AMPHENOL-NDAAFJ-M202": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808", + "lane2":"0x006808", + "lane3":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + }, + "MOLEX-1003461201": { + "preemphasis": { + "lane0":"0x046408", + "lane1":"0x046408" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb" + } + }, + "AMPHENOL-NDARHF-M205": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x8" + } + }, + "AMPHENOL-NDAAFF-M205": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808", + "lane2":"0x006808", + "lane3":"0x006808" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x8", + "lane2":"0x8", + "lane3":"0x8" + } + }, + "AMPHENOL-NDARHJ-M203": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808" + }, + "idriver": { + "lane0":"0xe", + "lane1":"0xe" + } + }, + "AMPHENOL-NDAAFJ-M203": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808", + "lane2":"0x006808", + "lane3":"0x006808" + }, + "idriver": { + "lane0":"0xe", + "lane1":"0xe", + "lane2":"0xe", + "lane3":"0xe" + } + }, + "MOLEX-1002979024": { + "preemphasis": { + "lane0":"0x006808", + "lane1":"0x006808", + "lane2":"0x006808", + "lane3":"0x006808" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + }, + "QSFP28-40GBASE-CR4-1M":{ + "preemphasis": { + "lane0":"0x32320c", + "lane1":"0x32320c", + "lane2":"0x32320c", + "lane3":"0x32320c" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x9", + "lane2":"0x9", + "lane3":"0x9" + } + }, + "QSFP28-40GBASE-CR4-2M":{ + "preemphasis": { + "lane0":"0x252f0c", + "lane1":"0x252f0c", + "lane2":"0x252f0c", + "lane3":"0x252f0c" + }, + "idriver": { + "lane0":"0xc", + "lane1":"0xc", + "lane2":"0xc", + "lane3":"0xc" + } + }, + "QSFP28-40GBASE-CR4-3M":{ + "preemphasis": { + "lane0":"0x252f0c", + "lane1":"0x252f0c", + "lane2":"0x252f0c", + "lane3":"0x252f0c" + }, + "idriver": { + "lane0":"0xe", + "lane1":"0xe", + "lane2":"0xe", + "lane3":"0xe" + } + }, + "QSFP28-40GBASE-CR4-5M":{ + "preemphasis": { + "lane0":"0x3d2f04", + "lane1":"0x3d2f04", + "lane2":"0x3d2f04", + "lane3":"0x3d2f04" + }, + "idriver": { + "lane0":"0xf", + "lane1":"0xf", + "lane2":"0xf", + "lane3":"0xf" + } + } + } + }, + "PORT_MEDIA_SETTINGS": { + "1": { + "Default": { + "preemphasis": { + "lane0":"0x2c4004", + "lane1":"0x2b4203", + "lane2":"0x2c4004", + "lane3":"0x2c4004" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + } + }, + "2": { + "Default": { + "preemphasis": { + "lane0":"0x2b4203", + "lane1":"0x294403", + "lane2":"0x2b4203", + "lane3":"0x2b4203" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xa", + "lane2":"0xb", + "lane3":"0xb" + } + } + }, + "3": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x294403", + "lane2":"0x294403", + "lane3":"0x294403" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "4": { + "Default": { + "preemphasis": { + "lane0":"0x284503", + "lane1":"0x284503", + "lane2":"0x284503", + "lane3":"0x294403" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xb", + "lane3":"0xa" + } + } + }, + "5": { + "Default": { + "preemphasis": { + "lane0":"0x284503", + "lane1":"0x284503", + "lane2":"0x264703", + "lane3":"0x284503" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "6": { + "Default": { + "preemphasis": { + "lane0":"0x264703", + "lane1":"0x244903", + "lane2":"0x284503", + "lane3":"0x264703" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "7": { + "Default": { + "preemphasis": { + "lane0":"0x244903", + "lane1":"0x244903", + "lane2":"0x264703", + "lane3":"0x244903" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0x9" + } + } + }, + "8": { + "Default": { + "preemphasis": { + "lane0":"0x234b02", + "lane1":"0x244903", + "lane2":"0x244903", + "lane3":"0x234b02" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0xa", + "lane2":"0x9", + "lane3":"0x9" + } + } + }, + "9": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x2c4004", + "lane2":"0x2b4203", + "lane3":"0x2e3e04" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + } + }, + "10": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x294403", + "lane2":"0x294403", + "lane3":"0x294403" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "11": { + "Default": { + "preemphasis": { + "lane0":"0x244903", + "lane1":"0x274603", + "lane2":"0x284503", + "lane3":"0x244903" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "12": { + "Default": { + "preemphasis": { + "lane0":"0x284503", + "lane1":"0x274603", + "lane2":"0x264703", + "lane3":"0x264703" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "13": { + "Default": { + "preemphasis": { + "lane0":"0x204e02", + "lane1":"0x204e02", + "lane2":"0x1f4f02", + "lane3":"0x1f4f02" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x9", + "lane2":"0x8", + "lane3":"0x8" + } + } + }, + "14": { + "Default": { + "preemphasis": { + "lane0":"0x1e5002", + "lane1":"0x204e02", + "lane2":"0x1e5002", + "lane3":"0x204e02" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x9", + "lane2":"0x8", + "lane3":"0x9" + } + } + }, + "15": { + "Default": { + "preemphasis": { + "lane0":"0x204e02", + "lane1":"0x1e5002", + "lane2":"0x1f4f02", + "lane3":"0x1f4f02" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x8", + "lane2":"0x8", + "lane3":"0x8" + } + } + }, + "16": { + "Default": { + "preemphasis": { + "lane0":"0x204e02", + "lane1":"0x1e5002", + "lane2":"0x204e02", + "lane3":"0x1e5002" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x8", + "lane2":"0x9", + "lane3":"0x8" + } + } + }, + "17": { + "Default": { + "preemphasis": { + "lane0":"0x204e02", + "lane1":"0x1e5002", + "lane2":"0x204e02", + "lane3":"0x1e5002" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x8", + "lane2":"0x9", + "lane3":"0x8" + } + } + }, + "18": { + "Default": { + "preemphasis": { + "lane0":"0x204e02", + "lane1":"0x1e5002", + "lane2":"0x204e02", + "lane3":"0x1e5002" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x8", + "lane2":"0x9", + "lane3":"0x8" + } + } + }, + "19": { + "Default": { + "preemphasis": { + "lane0":"0x1e5002", + "lane1":"0x204e02", + "lane2":"0x1e5002", + "lane3":"0x204e02" + }, + "idriver": { + "lane0":"0x8", + "lane1":"0x9", + "lane2":"0x8", + "lane3":"0x9" + } + } + }, + "20": { + "Default": { + "preemphasis": { + "lane0":"0x204e02", + "lane1":"0x1f4f02", + "lane2":"0x204e02", + "lane3":"0x1f4f02" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x8", + "lane2":"0x9", + "lane3":"0x8" + } + } + }, + "21": { + "Default": { + "preemphasis": { + "lane0":"0x244903", + "lane1":"0x244903", + "lane2":"0x244903", + "lane3":"0x244903" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0x9", + "lane2":"0xa", + "lane3":"0x9" + } + } + }, + "22": { + "Default": { + "preemphasis": { + "lane0":"0x264703", + "lane1":"0x244903", + "lane2":"0x244903", + "lane3":"0x244903" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0x9", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "23": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x244903", + "lane2":"0x244903", + "lane3":"0x284503" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "24": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x2b4203", + "lane2":"0x2c4004", + "lane3":"0x2d3f04" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + } + }, + "25": { + "Default": { + "preemphasis": { + "lane0":"0x234b02", + "lane1":"0x234b02", + "lane2":"0x234b02", + "lane3":"0x234b02" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x9", + "lane2":"0x9", + "lane3":"0x9" + } + } + }, + "26": { + "Default": { + "preemphasis": { + "lane0":"0x234b02", + "lane1":"0x244903", + "lane2":"0x244903", + "lane3":"0x244903" + }, + "idriver": { + "lane0":"0x9", + "lane1":"0x9", + "lane2":"0x9", + "lane3":"0x9" + } + } + }, + "27": { + "Default": { + "preemphasis": { + "lane0":"0x274603", + "lane1":"0x264703", + "lane2":"0x244903", + "lane3":"0x244903" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0x9", + "lane3":"0xa" + } + } + }, + "28": { + "Default": { + "preemphasis": { + "lane0":"0x264703", + "lane1":"0x244903", + "lane2":"0x284503", + "lane3":"0x274603" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "29": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x294403", + "lane2":"0x294403", + "lane3":"0x284503" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "30": { + "Default": { + "preemphasis": { + "lane0":"0x294403", + "lane1":"0x284503", + "lane2":"0x294403", + "lane3":"0x294403" + }, + "idriver": { + "lane0":"0xa", + "lane1":"0xa", + "lane2":"0xa", + "lane3":"0xa" + } + } + }, + "31": { + "Default": { + "preemphasis": { + "lane0":"0x2b4203", + "lane1":"0x294403", + "lane2":"0x2b4203", + "lane3":"0x2b4203" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xa", + "lane2":"0xb", + "lane3":"0xb" + } + } + }, + "32": { + "Default": { + "preemphasis": { + "lane0":"0x2b4203", + "lane1":"0x2b4203", + "lane2":"0x2c4004", + "lane3":"0x2c4004" + }, + "idriver": { + "lane0":"0xb", + "lane1":"0xb", + "lane2":"0xb", + "lane3":"0xb" + } + } + } + } +} + diff --git a/device/dell/x86_64-dellemc_z9264f_c3538-r0/DellEMC-Z9264f-C64/led_proc_init.soc b/device/dell/x86_64-dellemc_z9264f_c3538-r0/DellEMC-Z9264f-C64/led_proc_init.soc new file mode 100644 index 0000000000..d38282b650 --- /dev/null +++ b/device/dell/x86_64-dellemc_z9264f_c3538-r0/DellEMC-Z9264f-C64/led_proc_init.soc @@ -0,0 +1,111 @@ +# LED microprocessor initialization for DellEMC-Z9264f + +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=32 REMAP_PORT_2=33 REMAP_PORT_1=34 REMAP_PORT_0=35 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=36 REMAP_PORT_6=37 REMAP_PORT_5=38 REMAP_PORT_4=39 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=4 REMAP_PORT_10=5 REMAP_PORT_9=6 REMAP_PORT_8=7 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=0 REMAP_PORT_14=1 REMAP_PORT_13=2 REMAP_PORT_12=3 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=56 REMAP_PORT_18=57 REMAP_PORT_17=58 REMAP_PORT_16=59 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=60 REMAP_PORT_22=61 REMAP_PORT_21=62 REMAP_PORT_20=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=28 REMAP_PORT_26=29 REMAP_PORT_25=30 REMAP_PORT_24=31 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=24 REMAP_PORT_30=25 REMAP_PORT_29=26 REMAP_PORT_28=27 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=48 REMAP_PORT_34=49 REMAP_PORT_33=50 REMAP_PORT_32=51 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=52 REMAP_PORT_38=53 REMAP_PORT_37=54 REMAP_PORT_36=55 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=20 REMAP_PORT_42=21 REMAP_PORT_41=22 REMAP_PORT_40=23 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=16 REMAP_PORT_46=17 REMAP_PORT_45=18 REMAP_PORT_44=19 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=40 REMAP_PORT_50=41 REMAP_PORT_49=42 REMAP_PORT_48=43 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=44 REMAP_PORT_54=45 REMAP_PORT_53=46 REMAP_PORT_52=47 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=12 REMAP_PORT_58=13 REMAP_PORT_57=14 REMAP_PORT_56=15 +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=8 REMAP_PORT_62=9 REMAP_PORT_61=10 REMAP_PORT_60=11 +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=0 REMAP_PORT_2=1 REMAP_PORT_1=2 REMAP_PORT_0=3 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=4 REMAP_PORT_6=5 REMAP_PORT_5=6 REMAP_PORT_4=7 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=38 REMAP_PORT_8=39 REMAP_PORT_11=36 REMAP_PORT_10=37 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=32 REMAP_PORT_14=33 REMAP_PORT_13=34 REMAP_PORT_12=35 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=8 REMAP_PORT_18=9 REMAP_PORT_17=10 REMAP_PORT_16=11 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=12 REMAP_PORT_22=13 REMAP_PORT_21=14 REMAP_PORT_20=15 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=44 REMAP_PORT_26=45 REMAP_PORT_25=46 REMAP_PORT_24=47 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=40 REMAP_PORT_30=41 REMAP_PORT_29=42 REMAP_PORT_28=43 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 REMAP_PORT_34=17 REMAP_PORT_33=18 REMAP_PORT_32=19 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 REMAP_PORT_38=21 REMAP_PORT_37=22 REMAP_PORT_36=23 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=52 REMAP_PORT_42=53 REMAP_PORT_41=54 REMAP_PORT_40=55 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=48 REMAP_PORT_46=49 REMAP_PORT_45=50 REMAP_PORT_44=51 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=24 REMAP_PORT_50=25 REMAP_PORT_49=26 REMAP_PORT_48=27 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=28 REMAP_PORT_54=29 REMAP_PORT_53=30 REMAP_PORT_52=31 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=60 REMAP_PORT_58=61 REMAP_PORT_57=62 REMAP_PORT_56=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=56 REMAP_PORT_62=57 REMAP_PORT_61=58 REMAP_PORT_60=59 +m CMIC_LEDUP2_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=60 REMAP_PORT_2=61 REMAP_PORT_1=62 REMAP_PORT_0=63 +m CMIC_LEDUP2_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=56 REMAP_PORT_6=57 REMAP_PORT_5=58 REMAP_PORT_4=59 +m CMIC_LEDUP2_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=24 REMAP_PORT_10=25 REMAP_PORT_9=26 REMAP_PORT_8=27 +m CMIC_LEDUP2_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=28 REMAP_PORT_14=29 REMAP_PORT_13=30 REMAP_PORT_12=31 +m CMIC_LEDUP2_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=52 REMAP_PORT_18=53 REMAP_PORT_17=54 REMAP_PORT_16=55 +m CMIC_LEDUP2_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=48 REMAP_PORT_22=49 REMAP_PORT_21=50 REMAP_PORT_20=51 +m CMIC_LEDUP2_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=16 REMAP_PORT_26=17 REMAP_PORT_25=18 REMAP_PORT_24=19 +m CMIC_LEDUP2_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=20 REMAP_PORT_30=21 REMAP_PORT_29=22 REMAP_PORT_28=23 +m CMIC_LEDUP2_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=44 REMAP_PORT_34=45 REMAP_PORT_33=46 REMAP_PORT_32=47 +m CMIC_LEDUP2_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=40 REMAP_PORT_38=41 REMAP_PORT_37=42 REMAP_PORT_36=43 +m CMIC_LEDUP2_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=8 REMAP_PORT_42=9 REMAP_PORT_41=10 REMAP_PORT_40=11 +m CMIC_LEDUP2_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=12 REMAP_PORT_46=13 REMAP_PORT_45=14 REMAP_PORT_44=15 +m CMIC_LEDUP2_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=36 REMAP_PORT_50=37 REMAP_PORT_49=38 REMAP_PORT_48=39 +m CMIC_LEDUP2_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=32 REMAP_PORT_54=33 REMAP_PORT_53=34 REMAP_PORT_52=35 +m CMIC_LEDUP2_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=0 REMAP_PORT_58=1 REMAP_PORT_57=2 REMAP_PORT_56=3 +m CMIC_LEDUP2_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=4 REMAP_PORT_62=5 REMAP_PORT_61=6 REMAP_PORT_60=7 +m CMIC_LEDUP3_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=28 REMAP_PORT_2=29 REMAP_PORT_1=30 REMAP_PORT_0=31 +m CMIC_LEDUP3_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=24 REMAP_PORT_6=25 REMAP_PORT_5=26 REMAP_PORT_4=27 +m CMIC_LEDUP3_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 REMAP_PORT_10=57 REMAP_PORT_9=58 REMAP_PORT_8=59 +m CMIC_LEDUP3_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 REMAP_PORT_14=61 REMAP_PORT_13=62 REMAP_PORT_12=63 +m CMIC_LEDUP3_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=4 REMAP_PORT_18=5 REMAP_PORT_17=6 REMAP_PORT_16=7 +m CMIC_LEDUP3_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=0 REMAP_PORT_22=1 REMAP_PORT_21=2 REMAP_PORT_20=3 +m CMIC_LEDUP3_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=32 REMAP_PORT_26=33 REMAP_PORT_25=34 REMAP_PORT_24=35 +m CMIC_LEDUP3_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=36 REMAP_PORT_30=37 REMAP_PORT_29=38 REMAP_PORT_28=39 +m CMIC_LEDUP3_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=12 REMAP_PORT_34=13 REMAP_PORT_33=14 REMAP_PORT_32=15 +m CMIC_LEDUP3_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=8 REMAP_PORT_38=9 REMAP_PORT_37=10 REMAP_PORT_36=11 +m CMIC_LEDUP3_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=40 REMAP_PORT_42=41 REMAP_PORT_41=42 REMAP_PORT_40=43 +m CMIC_LEDUP3_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=44 REMAP_PORT_46=45 REMAP_PORT_45=46 REMAP_PORT_44=47 +m CMIC_LEDUP3_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=20 REMAP_PORT_50=21 REMAP_PORT_49=22 REMAP_PORT_48=23 +m CMIC_LEDUP3_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=16 REMAP_PORT_54=17 REMAP_PORT_53=18 REMAP_PORT_52=19 +m CMIC_LEDUP3_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=48 REMAP_PORT_58=49 REMAP_PORT_57=50 REMAP_PORT_56=51 +m CMIC_LEDUP3_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=52 REMAP_PORT_62=53 REMAP_PORT_61=54 REMAP_PORT_60=55 +m CMIC_LEDUP4_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=1 REMAP_PORT_1=0 + +led 0 stop +led 0 prog \ + 02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \ + 12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \ + 23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \ + 0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \ + 71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \ + 87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00 +led 0 auto on +led 0 start + +led 1 stop +led 1 prog \ + 02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \ + 12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \ + 23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \ + 0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \ + 71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \ + 87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00 +led 1 auto on +led 1 start + +led 2 stop +led 2 prog \ + 02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \ + 12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \ + 23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \ + 0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \ + 71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \ + 87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00 +led 2 auto on +led 2 start + +led 3 stop +led 3 prog \ + 02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \ + 12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \ + 23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \ + 0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \ + 71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \ + 87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00 +led 3 auto on +led 3 start diff --git a/device/dell/x86_64-dellemc_z9264f_c3538-r0/DellEMC-Z9264f-Q64/led_proc_init.soc b/device/dell/x86_64-dellemc_z9264f_c3538-r0/DellEMC-Z9264f-Q64/led_proc_init.soc new file mode 100644 index 0000000000..93806b33db --- /dev/null +++ b/device/dell/x86_64-dellemc_z9264f_c3538-r0/DellEMC-Z9264f-Q64/led_proc_init.soc @@ -0,0 +1,115 @@ +# LED microprocessor initialization for DellEMC-Z9264f + +m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=32 REMAP_PORT_2=33 REMAP_PORT_1=34 REMAP_PORT_0=35 +m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=36 REMAP_PORT_6=37 REMAP_PORT_5=38 REMAP_PORT_4=39 +m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=4 REMAP_PORT_10=5 REMAP_PORT_9=6 REMAP_PORT_8=7 +m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=0 REMAP_PORT_14=1 REMAP_PORT_13=2 REMAP_PORT_12=3 +m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=56 REMAP_PORT_18=57 REMAP_PORT_17=58 REMAP_PORT_16=59 +m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=60 REMAP_PORT_22=61 REMAP_PORT_21=62 REMAP_PORT_20=63 +m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=28 REMAP_PORT_26=29 REMAP_PORT_25=30 REMAP_PORT_24=31 +m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=24 REMAP_PORT_30=25 REMAP_PORT_29=26 REMAP_PORT_28=27 +m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=48 REMAP_PORT_34=49 REMAP_PORT_33=50 REMAP_PORT_32=51 +m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=52 REMAP_PORT_38=53 REMAP_PORT_37=54 REMAP_PORT_36=55 +m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=20 REMAP_PORT_42=21 REMAP_PORT_41=22 REMAP_PORT_40=23 +m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=16 REMAP_PORT_46=17 REMAP_PORT_45=18 REMAP_PORT_44=19 +m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=40 REMAP_PORT_50=41 REMAP_PORT_49=42 REMAP_PORT_48=43 +m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=44 REMAP_PORT_54=45 REMAP_PORT_53=46 REMAP_PORT_52=47 +m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=12 REMAP_PORT_58=13 REMAP_PORT_57=14 REMAP_PORT_56=15 +m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=8 REMAP_PORT_62=9 REMAP_PORT_61=10 REMAP_PORT_60=11 +m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=0 REMAP_PORT_2=1 REMAP_PORT_1=2 REMAP_PORT_0=3 +m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=4 REMAP_PORT_6=5 REMAP_PORT_5=6 REMAP_PORT_4=7 +m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=38 REMAP_PORT_8=39 REMAP_PORT_11=36 REMAP_PORT_10=37 +m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=32 REMAP_PORT_14=33 REMAP_PORT_13=34 REMAP_PORT_12=35 +m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=8 REMAP_PORT_18=9 REMAP_PORT_17=10 REMAP_PORT_16=11 +m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=12 REMAP_PORT_22=13 REMAP_PORT_21=14 REMAP_PORT_20=15 +m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=44 REMAP_PORT_26=45 REMAP_PORT_25=46 REMAP_PORT_24=47 +m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=40 REMAP_PORT_30=41 REMAP_PORT_29=42 REMAP_PORT_28=43 +m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 REMAP_PORT_34=17 REMAP_PORT_33=18 REMAP_PORT_32=19 +m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 REMAP_PORT_38=21 REMAP_PORT_37=22 REMAP_PORT_36=23 +m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=52 REMAP_PORT_42=53 REMAP_PORT_41=54 REMAP_PORT_40=55 +m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=48 REMAP_PORT_46=49 REMAP_PORT_45=50 REMAP_PORT_44=51 +m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=24 REMAP_PORT_50=25 REMAP_PORT_49=26 REMAP_PORT_48=27 +m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=28 REMAP_PORT_54=29 REMAP_PORT_53=30 REMAP_PORT_52=31 +m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=60 REMAP_PORT_58=61 REMAP_PORT_57=62 REMAP_PORT_56=63 +m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=56 REMAP_PORT_62=57 REMAP_PORT_61=58 REMAP_PORT_60=59 +m CMIC_LEDUP2_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=60 REMAP_PORT_2=61 REMAP_PORT_1=62 REMAP_PORT_0=63 +m CMIC_LEDUP2_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=56 REMAP_PORT_6=57 REMAP_PORT_5=58 REMAP_PORT_4=59 +m CMIC_LEDUP2_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=24 REMAP_PORT_10=25 REMAP_PORT_9=26 REMAP_PORT_8=27 +m CMIC_LEDUP2_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=28 REMAP_PORT_14=29 REMAP_PORT_13=30 REMAP_PORT_12=31 +m CMIC_LEDUP2_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=52 REMAP_PORT_18=53 REMAP_PORT_17=54 REMAP_PORT_16=55 +m CMIC_LEDUP2_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=48 REMAP_PORT_22=49 REMAP_PORT_21=50 REMAP_PORT_20=51 +m CMIC_LEDUP2_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=16 REMAP_PORT_26=17 REMAP_PORT_25=18 REMAP_PORT_24=19 +m CMIC_LEDUP2_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=20 REMAP_PORT_30=21 REMAP_PORT_29=22 REMAP_PORT_28=23 +m CMIC_LEDUP2_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=44 REMAP_PORT_34=45 REMAP_PORT_33=46 REMAP_PORT_32=47 +m CMIC_LEDUP2_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=40 REMAP_PORT_38=41 REMAP_PORT_37=42 REMAP_PORT_36=43 +m CMIC_LEDUP2_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=8 REMAP_PORT_42=9 REMAP_PORT_41=10 REMAP_PORT_40=11 +m CMIC_LEDUP2_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=12 REMAP_PORT_46=13 REMAP_PORT_45=14 REMAP_PORT_44=15 +m CMIC_LEDUP2_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=36 REMAP_PORT_50=37 REMAP_PORT_49=38 REMAP_PORT_48=39 +m CMIC_LEDUP2_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=32 REMAP_PORT_54=33 REMAP_PORT_53=34 REMAP_PORT_52=35 +m CMIC_LEDUP2_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=0 REMAP_PORT_58=1 REMAP_PORT_57=2 REMAP_PORT_56=3 +m CMIC_LEDUP2_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=4 REMAP_PORT_62=5 REMAP_PORT_61=6 REMAP_PORT_60=7 +m CMIC_LEDUP3_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=28 REMAP_PORT_2=29 REMAP_PORT_1=30 REMAP_PORT_0=31 +m CMIC_LEDUP3_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=24 REMAP_PORT_6=25 REMAP_PORT_5=26 REMAP_PORT_4=27 +m CMIC_LEDUP3_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 REMAP_PORT_10=57 REMAP_PORT_9=58 REMAP_PORT_8=59 +m CMIC_LEDUP3_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 REMAP_PORT_14=61 REMAP_PORT_13=62 REMAP_PORT_12=63 +m CMIC_LEDUP3_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=4 REMAP_PORT_18=5 REMAP_PORT_17=6 REMAP_PORT_16=7 +m CMIC_LEDUP3_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=0 REMAP_PORT_22=1 REMAP_PORT_21=2 REMAP_PORT_20=3 +m CMIC_LEDUP3_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=32 REMAP_PORT_26=33 REMAP_PORT_25=34 REMAP_PORT_24=35 +m CMIC_LEDUP3_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=36 REMAP_PORT_30=37 REMAP_PORT_29=38 REMAP_PORT_28=39 +m CMIC_LEDUP3_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=12 REMAP_PORT_34=13 REMAP_PORT_33=14 REMAP_PORT_32=15 +m CMIC_LEDUP3_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=8 REMAP_PORT_38=9 REMAP_PORT_37=10 REMAP_PORT_36=11 +m CMIC_LEDUP3_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=40 REMAP_PORT_42=41 REMAP_PORT_41=42 REMAP_PORT_40=43 +m CMIC_LEDUP3_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=44 REMAP_PORT_46=45 REMAP_PORT_45=46 REMAP_PORT_44=47 +m CMIC_LEDUP3_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=20 REMAP_PORT_50=21 REMAP_PORT_49=22 REMAP_PORT_48=23 +m CMIC_LEDUP3_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=16 REMAP_PORT_54=17 REMAP_PORT_53=18 REMAP_PORT_52=19 +m CMIC_LEDUP3_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=48 REMAP_PORT_58=49 REMAP_PORT_57=50 REMAP_PORT_56=51 +m CMIC_LEDUP3_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=52 REMAP_PORT_62=53 REMAP_PORT_61=54 REMAP_PORT_60=55 +m CMIC_LEDUP4_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=1 REMAP_PORT_1=0 + +led 0 stop +led 0 prog \ + 02 00 28 60 FE 67 1B 06 FE 80 D2 40 74 02 86 FD \ + 3A 80 28 32 08 97 71 5A 77 4C 57 28 32 08 97 75 \ + 4C 28 32 00 32 01 B7 97 75 3C 16 FD DA 0A 74 36 \ + 12 00 61 FD CA 05 CA 05 74 3C 77 4C 12 96 F8 15 \ + 1A 00 75 53 77 5A 57 28 32 07 97 57 32 0E 87 32 \ + 0E 87 57 32 0E 87 32 0F 87 57 32 0F 87 32 0E 87 \ + 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 0 auto on +led 0 start + +led 1 stop +led 1 prog \ + 02 00 28 60 FE 67 1B 06 FE 80 D2 40 74 02 86 FD \ + 3A 80 28 32 08 97 71 5A 77 4C 57 28 32 08 97 75 \ + 4C 28 32 00 32 01 B7 97 75 3C 16 FD DA 0A 74 36 \ + 12 00 61 FD CA 05 CA 05 74 3C 77 4C 12 96 F8 15 \ + 1A 00 75 53 77 5A 57 28 32 07 97 57 32 0E 87 32 \ + 0E 87 57 32 0E 87 32 0F 87 57 32 0F 87 32 0E 87 \ + 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 1 auto on +led 1 start + +led 2 stop +led 2 prog \ + 02 00 28 60 FE 67 1B 06 FE 80 D2 40 74 02 86 FD \ + 3A 80 28 32 08 97 71 5A 77 4C 57 28 32 08 97 75 \ + 4C 28 32 00 32 01 B7 97 75 3C 16 FD DA 0A 74 36 \ + 12 00 61 FD CA 05 CA 05 74 3C 77 4C 12 96 F8 15 \ + 1A 00 75 53 77 5A 57 28 32 07 97 57 32 0E 87 32 \ + 0E 87 57 32 0E 87 32 0F 87 57 32 0F 87 32 0E 87 \ + 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 2 auto on +led 2 start + +led 3 stop +led 3 prog \ + 02 00 28 60 FE 67 1B 06 FE 80 D2 40 74 02 86 FD \ + 3A 80 28 32 08 97 71 5A 77 4C 57 28 32 08 97 75 \ + 4C 28 32 00 32 01 B7 97 75 3C 16 FD DA 0A 74 36 \ + 12 00 61 FD CA 05 CA 05 74 3C 77 4C 12 96 F8 15 \ + 1A 00 75 53 77 5A 57 28 32 07 97 57 32 0E 87 32 \ + 0E 87 57 32 0E 87 32 0F 87 57 32 0F 87 32 0E 87 \ + 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +led 3 auto on +led 3 start diff --git a/device/dell/x86_64-dellemc_z9264f_c3538-r0/media_settings.json b/device/dell/x86_64-dellemc_z9264f_c3538-r0/media_settings.json new file mode 100644 index 0000000000..40f71d43e0 --- /dev/null +++ b/device/dell/x86_64-dellemc_z9264f_c3538-r0/media_settings.json @@ -0,0 +1,6276 @@ +{ + "PORT_MEDIA_SETTINGS": { + "1": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x14460a", + "lane2": "0x15450a", + "lane3": "0x16440a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3402", + "lane1": "0xa3401", + "lane2": "0xc3602", + "lane3": "0xa3602" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "2": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x15450a", + "lane2": "0x15450a", + "lane3": "0x15440b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3402", + "lane1": "0x93201", + "lane2": "0x83002", + "lane3": "0x93201" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "3": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x15450a", + "lane2": "0x15450a", + "lane3": "0x13470a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3202", + "lane1": "0xb3401", + "lane2": "0xa3202", + "lane3": "0x82d00" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "4": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x16440a", + "lane2": "0x15450a", + "lane3": "0x14460a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93202", + "lane1": "0x93202", + "lane2": "0x83002", + "lane3": "0x93202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "5": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x14460a", + "lane2": "0x14460a", + "lane3": "0x14460a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83001", + "lane1": "0xb3401", + "lane2": "0xb3502", + "lane3": "0x83000" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "6": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x14460a", + "lane2": "0x14460a", + "lane3": "0x14460a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83001", + "lane1": "0x83002", + "lane2": "0x83002", + "lane3": "0x83001" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "7": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x13470a", + "lane2": "0x13470a", + "lane3": "0x12480a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83001", + "lane1": "0x83001", + "lane2": "0x83001", + "lane3": "0x83000" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "8": { + "Default": { + "preemphasis": { + "lane0": "0x11490a", + "lane1": "0x12480a", + "lane2": "0x12480a", + "lane3": "0x12480a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72f01", + "lane1": "0x72f00", + "lane2": "0x83001", + "lane3": "0x93601" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "9": { + "Default": { + "preemphasis": { + "lane0": "0x14430d", + "lane1": "0x13440d", + "lane2": "0x14430d", + "lane3": "0x12450d" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3302", + "lane1": "0xa3000", + "lane2": "0xb3203", + "lane3": "0xb3701" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "10": { + "Default": { + "preemphasis": { + "lane0": "0x14440c", + "lane1": "0x13450c", + "lane2": "0x13470a", + "lane3": "0x12460c" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83102", + "lane1": "0x82e00", + "lane2": "0x83102", + "lane3": "0x93200" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "11": { + "Default": { + "preemphasis": { + "lane0": "0x13440d", + "lane1": "0x13460b", + "lane2": "0x16470a", + "lane3": "0x12480a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0x104311", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xE4610", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xA480F", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xA480F", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93202", + "lane1": "0xa3202", + "lane2": "0xa3202", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x53E02", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x54102", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x54302", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x54602", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44804", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "12": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x12470b", + "lane2": "0x13470a", + "lane3": "0x12480a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83102", + "lane1": "0xa3202", + "lane2": "0xa3202", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "13": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x13460b", + "lane2": "0x13470a", + "lane3": "0x11490a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93202", + "lane1": "0x93202", + "lane2": "0xa3202", + "lane3": "0xa3401" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "14": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x12470b", + "lane2": "0x13470a", + "lane3": "0x11490a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72e02", + "lane1": "0x73100", + "lane2": "0x73000", + "lane3": "0x73100" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "15": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x10490b", + "lane2": "0x104a0a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x72d01", + "lane2": "0x73000", + "lane3": "0x83000" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "16": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x10490b", + "lane2": "0x104a0a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x62a01", + "lane1": "0x62d01", + "lane2": "0x52a01", + "lane3": "0x52a01" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "17": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0xf4a0b", + "lane2": "0x104a0a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x72d01", + "lane2": "0x83200", + "lane3": "0x72d01" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "18": { + "Default": { + "preemphasis": { + "lane0": "0x104a0a", + "lane1": "0xf4a0b", + "lane2": "0x104a0a", + "lane3": "0xf4a0b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x52800", + "lane2": "0x52800", + "lane3": "0x62b01" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "19": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x11480b", + "lane2": "0x13460b", + "lane3": "0x13450c" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d02", + "lane1": "0x72d02", + "lane2": "0x72f01", + "lane3": "0x93802" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "20": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x11480b", + "lane2": "0x10490b", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x72d01", + "lane2": "0x72a02", + "lane3": "0x92f02" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "21": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x12460c", + "lane2": "0x13460b", + "lane3": "0x16430b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x93001", + "lane2": "0x82e01", + "lane3": "0x93102" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "22": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x10480c", + "lane2": "0x12470b", + "lane3": "0x13460b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93201", + "lane1": "0x72d01", + "lane2": "0x73201", + "lane3": "0x72d01" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "23": { + "Default": { + "preemphasis": { + "lane0": "0x15440b", + "lane1": "0x15440b", + "lane2": "0x13460b", + "lane3": "0x18400c" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3201", + "lane1": "0xa3201", + "lane2": "0xa3202", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "24": { + "Default": { + "preemphasis": { + "lane0": "0x13490a", + "lane1": "0x13460b", + "lane2": "0x13460b", + "lane3": "0x14450b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xC4612", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3201", + "lane1": "0xa3202", + "lane2": "0x83000", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x54802", + "lane1": "0x54802", + "lane2": "0x54802", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "25": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x11480b", + "lane2": "0x10490b", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x82d01", + "lane1": "0x82d02", + "lane2": "0x93202", + "lane3": "0x82d02" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "26": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x11480b", + "lane2": "0x11480b", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x93101", + "lane2": "0x72a00", + "lane3": "0x93402" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "27": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x14450b", + "lane2": "0x13460b", + "lane3": "0x15440b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3201", + "lane1": "0xa3202", + "lane2": "0x83000", + "lane3": "0x93602" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "28": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x14450b", + "lane2": "0x13460b", + "lane3": "0x13460b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93202", + "lane1": "0x83001", + "lane2": "0x93202", + "lane3": "0x83001" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "29": { + "Default": { + "preemphasis": { + "lane0": "0x14450b", + "lane1": "0x14440c", + "lane2": "0x13460b", + "lane3": "0x14440c" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3202", + "lane1": "0xa3202", + "lane2": "0xa3202", + "lane3": "0xa3602" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x44602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x55005" + } + } + }, + "30": { + "Default": { + "preemphasis": { + "lane0": "0x14450b", + "lane1": "0x13460b", + "lane2": "0x12470b", + "lane3": "0x14450b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0x104311", + "lane2": "0xF460F", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xE4610", + "lane2": "0xD480F", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4511", + "lane2": "0xA480F", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4511", + "lane2": "0xA480F", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x82d02", + "lane1": "0x83001", + "lane2": "0x83001", + "lane3": "0x83001" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x53E02", + "lane2": "0x43704", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x54102", + "lane2": "0x43A04", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x54302", + "lane2": "0x43c04", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x44602", + "lane2": "0x43f04", + "lane3": "0x44602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44802", + "lane2": "0x44404", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x55005", + "lane2": "0x54605", + "lane3": "0x55005" + } + } + }, + "31": { + "Default": { + "preemphasis": { + "lane0": "0x15440b", + "lane1": "0x15440b", + "lane2": "0x13460b", + "lane3": "0x14430d" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xb3502", + "lane1": "0xb3501", + "lane2": "0xb3502", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "32": { + "Default": { + "preemphasis": { + "lane0": "0x14450b", + "lane1": "0x14450b", + "lane2": "0x13460b", + "lane3": "0x15440b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3402", + "lane1": "0x83000", + "lane2": "0x83000", + "lane3": "0x83202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "33": { + "Default": { + "preemphasis": { + "lane0": "0x17430a", + "lane1": "0x16440a", + "lane2": "0x15450a", + "lane3": "0x17430a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83202", + "lane1": "0x83202", + "lane2": "0x83202", + "lane3": "0x83000" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "34": { + "Default": { + "preemphasis": { + "lane0": "0x17430a", + "lane1": "0x16440a", + "lane2": "0x15450a", + "lane3": "0x17430a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0x145000" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0x145000" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xd3701", + "lane1": "0xb3501", + "lane2": "0xa3402", + "lane3": "0x92402" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "35": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x14460a", + "lane2": "0x14460a", + "lane3": "0x14460a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83000", + "lane1": "0x73201", + "lane2": "0x83202", + "lane3": "0xa3703" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "36": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x15450a", + "lane2": "0x14460a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0x104311", + "lane2": "0xF460F", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xE4610", + "lane2": "0xD480F", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4511", + "lane2": "0xA480F", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4511", + "lane2": "0xA480F", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93901", + "lane1": "0xa3200", + "lane2": "0x83202", + "lane3": "0x82d02" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x53E02", + "lane2": "0x43704", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x54102", + "lane2": "0x43A04", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x54302", + "lane2": "0x43c04", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x54602", + "lane2": "0x43f04", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44802", + "lane2": "0x44404", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x55005", + "lane2": "0x54605", + "lane3": "0x55005" + } + } + }, + "37": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x15450a", + "lane2": "0x14460a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83200", + "lane1": "0x83200", + "lane2": "0x83200", + "lane3": "0x83200" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "38": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x15450a", + "lane2": "0x15450a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83000", + "lane1": "0xa3202", + "lane2": "0xa3202", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "39": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x15450a", + "lane2": "0x15450a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72d01", + "lane1": "0x62b01", + "lane2": "0x62b01", + "lane3": "0x82d02" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "40": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x15450a", + "lane2": "0x15450a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3401", + "lane1": "0x83000", + "lane2": "0xa3301", + "lane3": "0xa3201" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "41": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x15450a", + "lane2": "0x16440a", + "lane3": "0x18420a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xc3c00", + "lane1": "0xa3202", + "lane2": "0x93101", + "lane3": "0x72d01" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54802" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "42": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x18420a", + "lane2": "0x16440a", + "lane3": "0x18420a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3401", + "lane1": "0xa3000", + "lane2": "0xa3301", + "lane3": "0xa3201" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "43": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x15450a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3200", + "lane1": "0x72d01", + "lane2": "0x83000", + "lane3": "0x82d03" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "44": { + "Default": { + "preemphasis": { + "lane0": "0x14460a", + "lane1": "0x15450a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xd3c00", + "lane1": "0xa3202", + "lane2": "0xa3202", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "45": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x12480a", + "lane2": "0x13470a", + "lane3": "0x13470a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x62b01", + "lane1": "0x62b01", + "lane2": "0x62b01", + "lane3": "0x62901" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "46": { + "Default": { + "preemphasis": { + "lane0": "0xd4d0a", + "lane1": "0x12480a", + "lane2": "0x12480a", + "lane3": "0x13470a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xb3500", + "lane1": "0x82e00", + "lane2": "0x144b05", + "lane3": "0x82d03" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "47": { + "Default": { + "preemphasis": { + "lane0": "0xf4b0a", + "lane1": "0xf4b0a", + "lane2": "0x104a0a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x72b02", + "lane1": "0x72b02", + "lane2": "0x52b00", + "lane3": "0x52d02" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "48": { + "Default": { + "preemphasis": { + "lane0": "0xf4b0a", + "lane1": "0xf4b0a", + "lane2": "0x11490a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x52a01", + "lane1": "0x62a00", + "lane2": "0x62d00", + "lane3": "0x83202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "49": { + "Default": { + "preemphasis": { + "lane0": "0xf4b0a", + "lane1": "0xf4b0a", + "lane2": "0xf4b0a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3700", + "lane1": "0x62802", + "lane2": "0x62a00", + "lane3": "0x62a00" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "50": { + "Default": { + "preemphasis": { + "lane0": "0xf4b0a", + "lane1": "0xf4b0a", + "lane2": "0x13470a", + "lane3": "0xf4b0a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x62a00", + "lane1": "0x62a00", + "lane2": "0x62a00", + "lane3": "0x82b00" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "51": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x15450a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83000", + "lane1": "0x83201", + "lane2": "0x83201", + "lane3": "0x83000" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "52": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x16440a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83202", + "lane1": "0x83000", + "lane2": "0x83301", + "lane3": "0x83301" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "53": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x16440a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93401", + "lane1": "0x83201", + "lane2": "0x83301", + "lane3": "0xa3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "54": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x16440a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xA480F", + "lane2": "0xA480F", + "lane3": "0xA480F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3201", + "lane1": "0xa3201", + "lane2": "0xa3201", + "lane3": "0xa3401" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "55": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x16440a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3401", + "lane1": "0x83000", + "lane2": "0xa3201", + "lane3": "0xc3402" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "56": { + "Default": { + "preemphasis": { + "lane0": "0x15450a", + "lane1": "0x16440a", + "lane2": "0x13470a", + "lane3": "0x15450a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4511", + "lane1": "0xE4511", + "lane2": "0xE4511", + "lane3": "0xE4511" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3401", + "lane1": "0xb3502", + "lane2": "0xa3201", + "lane3": "0xb3502" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "57": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x13470a", + "lane2": "0x124909", + "lane3": "0x12480a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xC490F" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xA480F", + "lane1": "0xE4610", + "lane2": "0xA480F", + "lane3": "0xC490F" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x83000", + "lane1": "0x73000", + "lane2": "0x73000", + "lane3": "0x73000" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "58": { + "Default": { + "preemphasis": { + "lane0": "0x13470a", + "lane1": "0x12480a", + "lane2": "0x124909", + "lane3": "0x12480a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93101", + "lane1": "0x82e01", + "lane2": "0xa3201", + "lane3": "0xa2f00" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "59": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x12480a", + "lane2": "0x114a09", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93101", + "lane1": "0x83000", + "lane2": "0x83000", + "lane3": "0x93101" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "60": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x104a0a", + "lane2": "0x114a09", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0xF460F", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xD480F", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3501", + "lane1": "0xa3501", + "lane2": "0x83000", + "lane3": "0xa3702" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x43704", + "lane2": "0x43704", + "lane3": "0x43704" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x43A04", + "lane2": "0x43A04", + "lane3": "0x43A04" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x43c04", + "lane2": "0x43c04", + "lane3": "0x43c04" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x43f04", + "lane2": "0x43f04", + "lane3": "0x43f04" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44404", + "lane2": "0x44404", + "lane3": "0x44404" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x54605", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "61": { + "Default": { + "preemphasis": { + "lane0": "0x12480a", + "lane1": "0x12480a", + "lane2": "0x114a09", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4511", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x93201", + "lane1": "0x83000", + "lane2": "0x83000", + "lane3": "0xa3702" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "62": { + "Default": { + "preemphasis": { + "lane0": "0x154609", + "lane1": "0x144709", + "lane2": "0x114a09", + "lane3": "0x11480b" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0xF460F", + "lane1": "0x104311", + "lane2": "0xF460F", + "lane3": "0xF460F" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xD480F", + "lane1": "0xE4610", + "lane2": "0xD480F", + "lane3": "0xD480F" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xa3501", + "lane1": "0xa3501", + "lane2": "0xb3501", + "lane3": "0xa3500" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x43704", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x43A04", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x43c04", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x43f04", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44404", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x54605", + "lane1": "0x55005", + "lane2": "0x54605", + "lane3": "0x54605" + } + } + }, + "63": { + "Default": { + "preemphasis": { + "lane0": "0x164608", + "lane1": "0x144709", + "lane2": "0x144709", + "lane3": "0x14460a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0x82e00", + "lane1": "0x72d00", + "lane2": "0xa3001", + "lane3": "0xa3001" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + }, + "64": { + "Default": { + "preemphasis": { + "lane0": "0x194209", + "lane1": "0x14460a", + "lane2": "0x14460a", + "lane3": "0x16440a" + } + }, + "QSFP28-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x104311", + "lane1": "0x104311", + "lane2": "0x104311", + "lane3": "0x104311" + } + }, + "QSFP28-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP28-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0xE4610", + "lane1": "0xE4610", + "lane2": "0xE4610", + "lane3": "0xE4610" + } + }, + "QSFP+-40GBASE-SR4": { + "preemphasis": { + "lane0": "0xd3203", + "lane1": "0xa3301", + "lane2": "0xa3201", + "lane3": "0xc3202" + } + }, + "AMPHENOL-616750000": { + "preemphasis": { + "lane0": "0x53E02", + "lane1": "0x53E02", + "lane2": "0x53E02", + "lane3": "0x53E02" + } + }, + "QSFP+-40GBASE-CR4-1M": { + "preemphasis": { + "lane0": "0x54102", + "lane1": "0x54102", + "lane2": "0x54102", + "lane3": "0x54102" + } + }, + "QSFP+-40GBASE-CR4-2M": { + "preemphasis": { + "lane0": "0x54302", + "lane1": "0x54302", + "lane2": "0x54302", + "lane3": "0x54302" + } + }, + "QSFP+-40GBASE-CR4-3M": { + "preemphasis": { + "lane0": "0x54602", + "lane1": "0x54602", + "lane2": "0x54602", + "lane3": "0x54602" + } + }, + "QSFP+-40GBASE-CR4-5M": { + "preemphasis": { + "lane0": "0x44802", + "lane1": "0x44802", + "lane2": "0x44802", + "lane3": "0x44802" + } + }, + "QSFP+-40GBASE-CR4-7M": { + "preemphasis": { + "lane0": "0x55005", + "lane1": "0x55005", + "lane2": "0x55005", + "lane3": "0x55005" + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py index 2a69cb63a7..83d0b4707d 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py @@ -6,7 +6,7 @@ try: import time import subprocess - from sonic_sfp.sfputilbase import SfpUtilBase + from sonic_sfp.sfputilbase import * except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -20,6 +20,10 @@ SFP_STATUS_INSERTED = '1' GET_HWSKU_CMD = "sonic-cfggen -d -v DEVICE_METADATA.localhost.hwsku" +# Ethernet <=> sfp +SFP_PORT_NAME_OFFSET = 1 +SFP_PORT_NAME_CONVENTION = "sfp{}" + # magic code defnition for port number, qsfp port position of each hwsku # port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET) hwsku_dict = {'ACS-MSN2700': 0, "LS-SN2700":0, 'ACS-MSN2740': 0, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2010': 3, 'ACS-MSN3700': 0, 'ACS-MSN3700C': 0, 'Mellanox-SN2700': 0, 'Mellanox-SN2700-D48C8': 0} @@ -33,15 +37,12 @@ class SfpUtil(SfpUtilBase): PORTS_IN_BLOCK = 0 EEPROM_OFFSET = 0 - _port_to_eeprom_mapping = {} - db_sel = None db_sel_timeout = None db_sel_object = None db_sel_tbl = None state_db = None sfpd_status_tbl = None - qsfp_sysfs_path = "/var/run/hw-management/qsfp/" @property def port_start(self): @@ -57,7 +58,8 @@ class SfpUtil(SfpUtilBase): @property def port_to_eeprom_mapping(self): - return self._port_to_eeprom_mapping + print "dependency on sysfs has been removed" + raise Exception() def get_port_position_tuple_by_sku_name(self): p = subprocess.Popen(GET_HWSKU_CMD, shell=True, stdout=subprocess.PIPE) @@ -73,29 +75,31 @@ class SfpUtil(SfpUtilBase): self.PORTS_IN_BLOCK = port_position_tuple[3] self.EEPROM_OFFSET = port_position_tuple[4] - for x in range(0, self.port_end + 1): - self._port_to_eeprom_mapping[x] = self.qsfp_sysfs_path + "qsfp{}".format(x + self.EEPROM_OFFSET) - SfpUtilBase.__init__(self) def get_presence(self, port_num): + presence = False + # Check for invalid port_num if port_num < self.port_start or port_num > self.port_end: - return False + return presence + port_num += SFP_PORT_NAME_OFFSET + sfpname = SFP_PORT_NAME_CONVENTION.format(port_num) + + ethtool_cmd = "ethtool -m {} 2>/dev/null".format(sfpname) try: - reg_file = open(self.qsfp_sysfs_path + "qsfp{}_status".format(port_num + 1)) - except IOError as e: - print "Error: unable to open file: %s" % str(e) - return False + proc = subprocess.Popen(ethtool_cmd, stdout=subprocess.PIPE, shell=True, stderr=subprocess.STDOUT) + stdout = proc.communicate()[0] + proc.wait() + result = stdout.rstrip('\n') + if result != '': + presence = True - content = reg_file.readline().rstrip() + except OSError, e: + return presence - # content is a string with the qsfp status - if content == SFP_STATUS_INSERTED: - return True - - return False + return presence def get_low_power_mode(self, port_num): # Check for invalid port_num @@ -191,3 +195,354 @@ class SfpUtil(SfpUtilBase): return status, phy_port_dict + def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes): + print("_read_eeprom_specific_bytes should not be called since the sysfs it dependents on will no longer exist.") + print("_read_eeprom_specific_bytes_via_ethtool should be called instead") + raise Exception() + + # Read out any bytes from any offset + def _read_eeprom_specific_bytes_via_ethtool(self, port_num, offset, num_bytes): + port_num += SFP_PORT_NAME_OFFSET + sfpname = SFP_PORT_NAME_CONVENTION.format(port_num) + + eeprom_raw = [] + ethtool_cmd = "ethtool -m {} hex on offset {} length {}".format(sfpname, offset, num_bytes) + try: + output = subprocess.check_output(ethtool_cmd, shell=True) + output_lines = output.splitlines() + first_line_raw = output_lines[0] + if "Offset" in first_line_raw: + for line in output_lines[2:]: + line_split = line.split() + eeprom_raw = eeprom_raw + line_split[1:] + except subprocess.CalledProcessError as e: + return None + + return eeprom_raw + + # Read eeprom + def _read_eeprom_devid(self, port_num, devid, offset, num_bytes = 512): + if port_num in self.osfp_ports: + pass + elif port_num in self.qsfp_ports: + pass + elif (self.DOM_EEPROM_ADDR == devid): + offset += 256 + + eeprom_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, offset, num_bytes) + + return eeprom_raw + + # Read out SFP type, vendor name, PN, REV, SN from eeprom. + def get_transceiver_info_dict(self, port_num): + transceiver_info_dict = {} + compliance_code_dict = {} + + # ToDo: OSFP tranceiver info parsing not fully supported. + # in inf8628.py lack of some memory map definition + # will be implemented when the inf8628 memory map ready + if port_num in self.osfp_ports: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP + + sfpi_obj = inf8628InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + sfp_type_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) + else: + return None + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_vendor_name_raw, 0) + else: + return None + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_vendor_pn_raw, 0) + else: + return None + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_HW_REV_OFFSET), vendor_rev_width) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_vendor_rev_raw, 0) + else: + return None + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_vendor_sn_raw, 0) + else: + return None + + transceiver_info_dict['type'] = sfp_type_data['data']['type']['value'] + transceiver_info_dict['manufacturename'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['modelname'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardwarerev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serialnum'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + # Below part is added to avoid fail the xcvrd, shall be implemented later + transceiver_info_dict['vendor_oui'] = 'N/A' + transceiver_info_dict['vendor_date'] = 'N/A' + transceiver_info_dict['Connector'] = 'N/A' + transceiver_info_dict['encoding'] = 'N/A' + transceiver_info_dict['ext_identifier'] = 'N/A' + transceiver_info_dict['ext_rateselect_compliance'] = 'N/A' + transceiver_info_dict['cable_type'] = 'N/A' + transceiver_info_dict['cable_length'] = 'N/A' + transceiver_info_dict['specification_compliance'] = 'N/A' + transceiver_info_dict['nominal_bit_rate'] = 'N/A' + + else: + if port_num in self.qsfp_ports: + offset = 128 + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + cable_length_width = XCVR_CABLE_LENGTH_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + sfp_type = 'QSFP' + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + else: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + cable_length_width = XCVR_CABLE_LENGTH_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + sfp_type = 'SFP' + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + sfp_interface_bulk_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_INTFACE_BULK_OFFSET), interface_info_bulk_width) + if sfp_interface_bulk_raw is not None: + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw, 0) + else: + return None + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_vendor_name_raw, 0) + else: + return None + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_vendor_pn_raw, 0) + else: + return None + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_HW_REV_OFFSET), vendor_rev_width) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_vendor_rev_raw, 0) + else: + return None + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_vendor_sn_raw, 0) + else: + return None + + sfp_vendor_oui_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_vendor_oui_raw, 0) + else: + return None + + sfp_vendor_date_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) + if sfp_vendor_date_raw is not None: + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_vendor_date_raw, 0) + else: + return None + + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['manufacturename'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['modelname'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardwarerev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serialnum'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['Connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + if sfp_type == 'QSFP': + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_dom_info_dict(self, port_num): + transceiver_dom_info_dict = {} + + # Below part is added to avoid failing xcvrd + # Currently, the way in which dom data is read has been changed from + # using sysfs to using ethtool. + # The ethtool returns None for ports without dom support, resulting in + # None being returned. However, this fails xcvrd to add the + # TRANSCEIVER_DOM_SENSOR table entry of associated port to CONFIG_DB + # and then causes SNMP fail. + # To address this issue a default dict is initialized with all data set to + # 'N/A' and is returned is the above case. + # BTW, in the original implementation which sysfs is used to read dom data, + # even though non-None data is returned for ports without dom support, + # it does not contain valid data. This can result in wrong data in + # TRANSCEIVER_DOM_SENSOR table. + transceiver_dom_info_dict['temperature'] = 'N/A' + transceiver_dom_info_dict['voltage'] = 'N/A' + transceiver_dom_info_dict['rx1power'] = 'N/A' + transceiver_dom_info_dict['rx2power'] = 'N/A' + transceiver_dom_info_dict['rx3power'] = 'N/A' + transceiver_dom_info_dict['rx4power'] = 'N/A' + transceiver_dom_info_dict['tx1bias'] = 'N/A' + transceiver_dom_info_dict['tx2bias'] = 'N/A' + transceiver_dom_info_dict['tx3bias'] = 'N/A' + transceiver_dom_info_dict['tx4bias'] = 'N/A' + transceiver_dom_info_dict['tx1power'] = 'N/A' + transceiver_dom_info_dict['tx2power'] = 'N/A' + transceiver_dom_info_dict['tx3power'] = 'N/A' + transceiver_dom_info_dict['tx4power'] = 'N/A' + + if port_num in self.osfp_ports: + pass + elif port_num in self.qsfp_ports: + offset = 0 + offset_xcvr = 128 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + return None + + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + else: + return transceiver_dom_info_dict + + dom_temperature_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + else: + return transceiver_dom_info_dict + + dom_voltage_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_VLOT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + else: + return transceiver_dom_info_dict + + qsfp_dom_rev_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + else: + return transceiver_dom_info_dict + + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + else: + return transceiver_dom_info_dict + else: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + else: + return transceiver_dom_info_dict + + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + + else: + offset = 256 + + eeprom_raw = ['0'] * 256 + eeprom_raw[92:92+16] = self._read_eeprom_specific_bytes_via_ethtool(port_num, 92, 16) + sfp_obj = sff8472InterfaceId() + calibration_type = sfp_obj._get_calibration_type(eeprom_raw) + + eeprom_domraw = self._read_eeprom_specific_bytes_via_ethtool(port_num, offset, 256) + if eeprom_domraw is None: + return transceiver_dom_info_dict + + sfpd_obj = sff8472Dom(None, calibration_type) + if sfpd_obj is None: + print "no sff8472Dom" + return None + + dom_temperature_raw = eeprom_domraw[SFP_TEMPE_OFFSET:SFP_TEMPE_OFFSET+SFP_TEMPE_WIDTH] + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + + dom_voltage_raw = eeprom_domraw[SFP_VLOT_OFFSET:SFP_VLOT_OFFSET+SFP_VOLT_WIDTH] + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + + dom_channel_monitor_raw = eeprom_domraw[SFP_CHANNL_MON_OFFSET:SFP_CHANNL_MON_OFFSET+SFP_CHANNL_MON_WIDTH] + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TXBias']['value'] + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TXPower']['value'] + + return transceiver_dom_info_dict diff --git a/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 b/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 index 747f65a3aa..bbc24ecc09 100644 --- a/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 +++ b/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 @@ -32,28 +32,33 @@ stderr_logfile=syslog {% if num_relays.count > 0 %} [group:isc-dhcp-relay] programs= -{%- set add_preceding_comma = { 'flag': False } -%} -{%- for vlan_name in VLAN -%} -{%- if VLAN[vlan_name]['dhcp_servers'] -%} -{%- if add_preceding_comma.flag %},{% endif -%} -{%- set _dummy = add_preceding_comma.update({'flag': True}) -%} +{%- set add_preceding_comma = { 'flag': False } %} +{% for vlan_name in VLAN %} +{% if VLAN[vlan_name]['dhcp_servers'] %} +{% if add_preceding_comma.flag %},{% endif %} +{% set _dummy = add_preceding_comma.update({'flag': True}) %} isc-dhcp-relay-{{ vlan_name }} {%- endif %} {% endfor %} {# Create a program entry for each DHCP relay agent instance #} -{% for vlan_name in VLAN -%} -{%- if VLAN[vlan_name]['dhcp_servers'] -%} +{% for vlan_name in VLAN %} +{% if VLAN[vlan_name]['dhcp_servers'] %} [program:isc-dhcp-relay-{{ vlan_name }}] -command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -i {{ vlan_name }} -{%- for (name, prefix) in INTERFACE -%} -{%- if prefix | ipv4 %} -i {{ name }}{% endif -%} -{%- endfor -%} -{%- for (name, prefix) in PORTCHANNEL_INTERFACE -%} -{%- if prefix | ipv4 %} -i {{ name }}{% endif -%} -{%- endfor -%} -{%- for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} {{ dhcp_server }}{% endfor %} +{# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id {{ vlan_name }} +{#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +{% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for (name, prefix) in INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} {{ dhcp_server }}{% endfor %} priority=3 autostart=false diff --git a/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 b/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 index 23133706cb..bf50abe4f0 100644 --- a/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 +++ b/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 @@ -29,12 +29,12 @@ function wait_until_iface_ready # Wait for all interfaces to be up and ready -{% for (name, prefix) in INTERFACE %} +{% for (name, prefix) in INTERFACE|pfx_filter %} wait_until_iface_ready ${PORT_TABLE_PREFIX} {{ name }} {% endfor %} -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }} {% endfor %} -{% for (name, prefix) in PORTCHANNEL_INTERFACE %} +{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} wait_until_iface_ready ${LAG_TABLE_PREFIX} {{ name }} {% endfor %} diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index 4879736437..b69f895ccb 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -29,13 +29,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} no bgp default ipv4-unicast bgp graceful-restart restart-time 240 bgp graceful-restart -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv4 and name == 'Loopback0' %} bgp router-id {{ prefix | ip }} {% endif %} {% endfor %} {# advertise loopback #} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv4 and name == 'Loopback0' %} network {{ prefix | ip }}/32 {% elif prefix | ipv6 and name == 'Loopback0' %} @@ -47,7 +47,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endblock bgp_init %} {% endif %} {% block vlan_advertisement %} -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} network {{ prefix }} {% elif prefix | ipv6 %} @@ -108,7 +108,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if bgp_peer['src_address'] is defined %} neighbor {{ bgp_peer['name'] }} update-source {{ bgp_peer['src_address'] | ip }} {% else %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if name == 'Loopback1' %} neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }} {% endif %} diff --git a/dockers/docker-fpm-frr/frr.conf.j2 b/dockers/docker-fpm-frr/frr.conf.j2 index d4fdec897d..7e3d0f458b 100644 --- a/dockers/docker-fpm-frr/frr.conf.j2 +++ b/dockers/docker-fpm-frr/frr.conf.j2 @@ -16,7 +16,7 @@ log facility local4 ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for (name, prefix) in INTERFACE %} +{% for (name, prefix) in INTERFACE|pfx_filter %} interface {{ name }} link-detect ! @@ -30,7 +30,7 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE %} +{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% endif %} @@ -41,7 +41,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} {% if LOOPBACK_INTERFACE %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if name == 'Loopback0' %} {% if prefix | ipv6 %} {% if lo_ipv6_addrs.append(prefix) %} @@ -87,13 +87,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} bgp graceful-restart {% endif %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv4 and name == 'Loopback0' %} bgp router-id {{ prefix | ip }} {% endif %} {% endfor %} {# advertise loopback #} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv4 and name == 'Loopback0' %} network {{ prefix | ip }}/32 {% elif prefix | ipv6 and name == 'Loopback0' %} @@ -105,7 +105,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endblock bgp_init %} {% endif %} {% block vlan_advertisement %} -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} network {{ prefix }} {% elif prefix | ipv6 %} @@ -173,7 +173,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} neighbor {{ bgp_peer['name'] }} passive neighbor {{ bgp_peer['name'] }} remote-as {{ deployment_id_asn_map[DEVICE_METADATA['localhost']['deployment_id']] }} neighbor {{ bgp_peer['name'] }} ebgp-multihop 255 -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if name == 'Loopback1' %} neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }} {% endif %} diff --git a/dockers/docker-fpm-frr/start.sh b/dockers/docker-fpm-frr/start.sh index 238d26783a..ea4963f630 100755 --- a/dockers/docker-fpm-frr/start.sh +++ b/dockers/docker-fpm-frr/start.sh @@ -8,9 +8,11 @@ if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then sonic-cfggen -d -y /etc/sonic/deployment_id_asn_map.yml -t /usr/share/sonic/templates/bgpd.conf.j2 > /etc/frr/bgpd.conf sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/frr/zebra.conf touch /etc/frr/vtysh.conf + rm -f /etc/frr/frr.conf elif [ "$CONFIG_TYPE" == "unified" ]; then sonic-cfggen -d -y /etc/sonic/deployment_id_asn_map.yml -t /usr/share/sonic/templates/frr.conf.j2 >/etc/frr/frr.conf echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf + rm -f /etc/frr/bgpd.conf /etc/frr/vtysh.conf fi sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate diff --git a/dockers/docker-fpm-frr/zebra.conf.j2 b/dockers/docker-fpm-frr/zebra.conf.j2 index 4acb474b0e..c0357eaed8 100644 --- a/dockers/docker-fpm-frr/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/zebra.conf.j2 @@ -14,7 +14,7 @@ enable password zebra ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for (name, prefix) in INTERFACE %} +{% for (name, prefix) in INTERFACE|pfx_filter %} interface {{ name }} link-detect ! @@ -28,7 +28,7 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE %} +{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% endif %} @@ -39,7 +39,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} {% if LOOPBACK_INTERFACE %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if name == 'Loopback0' %} {% if prefix | ipv6 %} {% if lo_ipv6_addrs.append(prefix) %} diff --git a/dockers/docker-fpm-gobgp/zebra.conf.j2 b/dockers/docker-fpm-gobgp/zebra.conf.j2 index 8b967f9867..2da0316ae5 100644 --- a/dockers/docker-fpm-gobgp/zebra.conf.j2 +++ b/dockers/docker-fpm-gobgp/zebra.conf.j2 @@ -14,7 +14,7 @@ enable password zebra ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for (name, prefix) in INTERFACE %} +{% for (name, prefix) in INTERFACE|pfx_filter %} interface {{ name }} link-detect ! @@ -28,7 +28,7 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE %} +{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% endif %} @@ -39,7 +39,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} {% if LOOPBACK_INTERFACE %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv6 %} {% if lo_ipv6_addrs.append(prefix) %} {% endif %} diff --git a/dockers/docker-fpm-quagga/bgpd.conf.j2 b/dockers/docker-fpm-quagga/bgpd.conf.j2 index 4879736437..b69f895ccb 100644 --- a/dockers/docker-fpm-quagga/bgpd.conf.j2 +++ b/dockers/docker-fpm-quagga/bgpd.conf.j2 @@ -29,13 +29,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} no bgp default ipv4-unicast bgp graceful-restart restart-time 240 bgp graceful-restart -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv4 and name == 'Loopback0' %} bgp router-id {{ prefix | ip }} {% endif %} {% endfor %} {# advertise loopback #} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if prefix | ipv4 and name == 'Loopback0' %} network {{ prefix | ip }}/32 {% elif prefix | ipv6 and name == 'Loopback0' %} @@ -47,7 +47,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% endblock bgp_init %} {% endif %} {% block vlan_advertisement %} -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} network {{ prefix }} {% elif prefix | ipv6 %} @@ -108,7 +108,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if bgp_peer['src_address'] is defined %} neighbor {{ bgp_peer['name'] }} update-source {{ bgp_peer['src_address'] | ip }} {% else %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if name == 'Loopback1' %} neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }} {% endif %} diff --git a/dockers/docker-fpm-quagga/zebra.conf.j2 b/dockers/docker-fpm-quagga/zebra.conf.j2 index 4acb474b0e..c0357eaed8 100644 --- a/dockers/docker-fpm-quagga/zebra.conf.j2 +++ b/dockers/docker-fpm-quagga/zebra.conf.j2 @@ -14,7 +14,7 @@ enable password zebra ! {% block interfaces %} ! Enable link-detect (default disabled) -{% for (name, prefix) in INTERFACE %} +{% for (name, prefix) in INTERFACE|pfx_filter %} interface {{ name }} link-detect ! @@ -28,7 +28,7 @@ link-detect ! {% block default_route %} ! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE %} +{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% endif %} @@ -39,7 +39,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 {% set lo_ipv4_addrs = [] %} {% set lo_ipv6_addrs = [] %} {% if LOOPBACK_INTERFACE %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {% if name == 'Loopback0' %} {% if prefix | ipv6 %} {% if lo_ipv6_addrs.append(prefix) %} diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index 7ce291dbdf..66bec75da7 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -2,7 +2,7 @@ {% set ipv6_addresses = [] %} {% set ipv4_loopback_addresses = [] %} {% set ipv6_loopback_addresses = [] %} -{% for (name, prefix) in LOOPBACK_INTERFACE %} +{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {%- if prefix | ipv4 and name == 'Loopback0' %} {%- set ipv4_addresses = ipv4_addresses.append(prefix) %} {%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %} @@ -12,7 +12,7 @@ {%- set ipv6_loopback_addresses = ipv6_loopback_addresses.append(prefix) %} {%- endif %} {% endfor %} -{% for (name, prefix) in INTERFACE %} +{% for (name, prefix) in INTERFACE|pfx_filter %} {%- if prefix | ipv4 %} {%- set ipv4_addresses = ipv4_addresses.append(prefix) %} {%- endif %} @@ -20,7 +20,7 @@ {%- set ipv6_addresses = ipv6_addresses.append(prefix) %} {%- endif %} {% endfor %} -{% for (name, prefix) in PORTCHANNEL_INTERFACE %} +{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} {%- if prefix | ipv4 %} {%- set ipv4_addresses = ipv4_addresses.append(prefix) %} {%- endif %} @@ -28,7 +28,7 @@ {%- set ipv6_addresses = ipv6_addresses.append(prefix) %} {%- endif %} {% endfor %} -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} {%- if prefix | ipv4 %} {%- set ipv4_addresses = ipv4_addresses.append(prefix) %} {%- endif %} diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index cfa7989674..4d5c2c8516 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM debian:jessie +FROM debian:stretch MAINTAINER Pavel Shirshov @@ -38,7 +38,7 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' / cmake \ libqt5core5a \ libqt5network5 \ - libboost-atomic1.55.0 \ + libboost-atomic1.62.0 \ less \ git \ iputils-ping \ diff --git a/dockers/docker-router-advertiser/radvd.conf.j2 b/dockers/docker-router-advertiser/radvd.conf.j2 index 940c26fd65..bc323977b1 100644 --- a/dockers/docker-router-advertiser/radvd.conf.j2 +++ b/dockers/docker-router-advertiser/radvd.conf.j2 @@ -10,7 +10,7 @@ {# If our configuration has VLAN interfaces... #} {% if VLAN_INTERFACE %} -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} {# If this VLAN has an IPv6 address... #} {% if prefix | ipv6 %} interface {{ name }} diff --git a/dockers/docker-router-advertiser/wait_for_intf.sh.j2 b/dockers/docker-router-advertiser/wait_for_intf.sh.j2 index 856c47678f..a044df0fc9 100644 --- a/dockers/docker-router-advertiser/wait_for_intf.sh.j2 +++ b/dockers/docker-router-advertiser/wait_for_intf.sh.j2 @@ -27,6 +27,6 @@ function wait_until_iface_ready # Wait for all interfaces to be up and ready -{% for (name, prefix) in VLAN_INTERFACE %} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }} {% endfor %} diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index a828dfb4c2..9b11ea5175 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -5,6 +5,32 @@ function getMountPoint() echo $1 | python -c "import sys, json, os; mnts = [x for x in json.load(sys.stdin)[0]['Mounts'] if x['Destination'] == '/usr/share/sonic/hwsku']; print '' if len(mnts) == 0 else os.path.basename(mnts[0]['Source'])" 2>/dev/null } +function updateHostName() +{ + HOSTS=/etc/hosts + HOSTS_TMP=/etc/hosts.tmp + + EXEC="docker exec -i {{docker_container_name}} bash -c" + + NEW_HOSTNAME="$1" + HOSTNAME=`$EXEC "hostname"` + if ! [[ $HOSTNAME =~ ^[a-zA-Z0-9.\-]*$ ]]; then + HOSTNAME=`hostname` + fi + + # copy HOSTS to HOSTS_TMP + $EXEC "cp $HOSTS $HOSTS_TMP" + # remove entry with hostname + $EXEC "sed -i \"/$HOSTNAME$/d\" $HOSTS_TMP" + # add entry with new hostname + $EXEC "echo -e \"127.0.0.1\t$NEW_HOSTNAME\" >> $HOSTS_TMP" + + echo "Set hostname in {{docker_container_name}} container" + $EXEC "hostname '$NEW_HOSTNAME'" + $EXEC "cat $HOSTS_TMP > $HOSTS" + $EXEC "rm -f $HOSTS_TMP" +} + function getBootType() { local BOOT_TYPE @@ -105,6 +131,10 @@ start() { # Obtain our HWSKU as we will mount directories with these names in each docker HWSKU=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'` {%- endif %} + HOSTNAME=`sonic-cfggen -m -v 'DEVICE_METADATA["localhost"]["hostname"]'` + if [ -z "$HOSTNAME" ] || ! [[ $HOSTNAME =~ ^[a-zA-Z0-9.\-]*$ ]]; then + HOSTNAME=`hostname` + fi DOCKERCHECK=`docker inspect --type container {{docker_container_name}} 2>/dev/null` if [ "$?" -eq "0" ]; then @@ -121,6 +151,7 @@ start() { {%- endif %} preStartAction docker start {{docker_container_name}} + updateHostName "$HOSTNAME" postStartAction exit $? fi @@ -134,6 +165,9 @@ start() { echo "Creating new {{docker_container_name}} container" {%- else %} echo "Creating new {{docker_container_name}} container with HWSKU $HWSKU" +{%- endif %} +{%- if sonic_asic_platform == "mellanox" %} + # TODO: Mellanox will remove the --tmpfs exception after SDK socket path changed in new SDK version {%- endif %} docker create {{docker_image_run_opt}} \ {%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} @@ -146,6 +180,10 @@ start() { -e PRM_SNIFFER \ -e PRM_SNIFFER_FILE_PATH \ -v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \ + -v mlnx_sdk_socket:/tmp \ + -v /dev/shm:/dev/shm:rw \ +{%- else %} + --tmpfs /tmp \ {%- endif %} {%- if docker_container_name == "pmon" %} -v /var/run/hw-management:/var/run/hw-management:rw \ @@ -156,8 +194,11 @@ start() { {%- if docker_container_name != "database" %} -v /usr/share/sonic/device/$PLATFORM/$HWSKU:/usr/share/sonic/hwsku:ro \ {%- endif %} +{%- if sonic_asic_platform != "mellanox" %} --tmpfs /tmp \ +{%- endif %} --tmpfs /var/tmp \ + --hostname "$HOSTNAME" \ --name={{docker_container_name}} {{docker_image_name}}:latest || { echo "Failed to docker run" >&1 exit 4 @@ -177,11 +218,13 @@ stop() { } case "$1" in - start|wait|stop) - $1 + start|wait|stop|updateHostName) + cmd=$1 + shift + $cmd $@ ;; *) - echo "Usage: $0 {start|wait|stop}" + echo "Usage: $0 {start|wait|stop|updateHostName new_hostname}" exit 1 ;; esac diff --git a/files/image_config/hostcfgd/hostcfgd b/files/image_config/hostcfgd/hostcfgd index ae51af5cc8..739c0baa4d 100755 --- a/files/image_config/hostcfgd/hostcfgd +++ b/files/image_config/hostcfgd/hostcfgd @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import os +import re import sys import subprocess import syslog @@ -22,6 +23,15 @@ TACPLUS_SERVER_TIMEOUT_DEFAULT = "5" TACPLUS_SERVER_AUTH_TYPE_DEFAULT = "pap" +def is_valid_hostname(name): + if hostname[-1] == ".": + hostname = hostname[:-1] # strip exactly one dot from the right, if present + if len(hostname) > 253: + return False + allowed = re.compile("(?!-)[A-Z\d-]{1,63}(? /tmp/intf_tmp.j2 + echo "{% for (name, prefix) in INTERFACE|pfx_filter %} {{name}} {% endfor %}" > /tmp/intf_tmp.j2 INTERFACE=`sonic-cfggen -d -t /tmp/intf_tmp.j2` - echo "{% for (name, prefix) in PORTCHANNEL_INTERFACE %} {{name}} {% endfor %}" > /tmp/pc_intf_tmp.j2 + echo "{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} {{name}} {% endfor %}" > /tmp/pc_intf_tmp.j2 PC_INTERFACE=`sonic-cfggen -d -t /tmp/pc_intf_tmp.j2` ALL_INTERFACE="$INTERFACE $PC_INTERFACE" diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index 0ed1df5a7d..7b7c79ee46 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 0ed1df5a7d6c88319ce41b10ce604c2727afab69 +Subproject commit 7b7c79ee463b43e570c48915215cdbf6ec250225 diff --git a/platform/broadcom/docker-saiserver-brcm.mk b/platform/broadcom/docker-saiserver-brcm.mk index f0aead6b3d..b754ab6798 100644 --- a/platform/broadcom/docker-saiserver-brcm.mk +++ b/platform/broadcom/docker-saiserver-brcm.mk @@ -4,7 +4,7 @@ DOCKER_SAISERVER_BRCM = docker-saiserver-brcm.gz $(DOCKER_SAISERVER_BRCM)_PATH = $(PLATFORM_PATH)/docker-saiserver-brcm $(DOCKER_SAISERVER_BRCM)_DEPENDS += $(SAISERVER) $(DOCKER_SAISERVER_BRCM)_FILES += $(DSSERVE) $(BCMCMD) -$(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) +$(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_BRCM) $(DOCKER_SAISERVER_BRCM)_CONTAINER_NAME = saiserver diff --git a/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 b/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 index 7961aa98fb..79dccf8f37 100644 --- a/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 +++ b/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine +FROM docker-config-engine-stretch ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk index 24cdd64c57..f8983eb7bc 100755 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -25,6 +25,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(ACCTON_AS4630_54PE_PLATFORM_MODULE) \ $(ACCTON_MINIPACK_PLATFORM_MODULE) \ $(ACCTON_AS5812_54X_PLATFORM_MODULE) \ + $(ACCTON_AS5835_54X_PLATFORM_MODULE) \ $(INVENTEC_D7032Q28B_PLATFORM_MODULE) \ $(INVENTEC_D7054Q28B_PLATFORM_MODULE) \ $(INVENTEC_D7264Q28B_PLATFORM_MODULE) \ @@ -37,6 +38,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(QUANTA_IX1B_32X_PLATFORM_MODULE) \ $(MITAC_LY1200_32X_PLATFORM_MODULE) \ $(ALPHANETWORKS_SNH60A0_320FV2_PLATFORM_MODULE) \ - $(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE) + $(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE) \ + $(BRCM_XLR_GTS_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/broadcom/platform-modules-accton.mk b/platform/broadcom/platform-modules-accton.mk index 397b38cb0c..49be5781c8 100755 --- a/platform/broadcom/platform-modules-accton.mk +++ b/platform/broadcom/platform-modules-accton.mk @@ -12,6 +12,7 @@ ACCTON_AS7726_32X_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS4630_54PE_PLATFORM_MODULE_VERSION = 1.1 ACCTON_MINIPACK_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS5812_54X_PLATFORM_MODULE_VERSION = 1.1 +ACCTON_AS5835_54X_PLATFORM_MODULE_VERSION = 1.1 export ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION export ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION @@ -25,6 +26,7 @@ export ACCTON_AS7726_32X_PLATFORM_MODULE_VERSION export ACCTON_AS4630_54PE_PLATFORM_MODULE_VERSION export ACCTON_MINIPACK_PLATFORM_MODULE_VERSION export ACCTON_AS5812_54X_PLATFORM_MODULE_VERSION +export ACCTON_AS5835_54X_PLATFORM_MODULE_VERSION ACCTON_AS7712_32X_PLATFORM_MODULE = sonic-platform-accton-as7712-32x_$(ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION)_amd64.deb $(ACCTON_AS7712_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton @@ -77,4 +79,8 @@ ACCTON_AS5812_54X_PLATFORM_MODULE = sonic-platform-accton-as5812-54x_$(ACCTON_AS $(ACCTON_AS5812_54X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as5812_54x-r0 $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS5812_54X_PLATFORM_MODULE))) +ACCTON_AS5835_54X_PLATFORM_MODULE = sonic-platform-accton-as5835-54x_$(ACCTON_AS5835_54X_PLATFORM_MODULE_VERSION)_amd64.deb +$(ACCTON_AS5835_54X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as5835_54x-r0 +$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS5835_54X_PLATFORM_MODULE))) + SONIC_STRETCH_DEBS += $(ACCTON_AS7712_32X_PLATFORM_MODULE) diff --git a/platform/broadcom/platform-modules-brcm-xlr-gts.mk b/platform/broadcom/platform-modules-brcm-xlr-gts.mk new file mode 100644 index 0000000000..c35609c394 --- /dev/null +++ b/platform/broadcom/platform-modules-brcm-xlr-gts.mk @@ -0,0 +1,15 @@ +# Broadcom XLR/GTS Platform modules + +BRCM_XLR_GTS_PLATFORM_MODULE_VERSION = 1.0 + +export BRCM_XLR_GTS_PLATFORM_MODULE_VERSION + +BRCM_XLR_GTS_PLATFORM_MODULE = sonic-platform-brcm-xlr-gts_$(BRCM_XLR_GTS_PLATFORM_MODULE_VERSION)_amd64.deb +$(BRCM_XLR_GTS_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-brcm-xlr-gts +$(BRCM_XLR_GTS_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(BRCM_XLR_GTS_PLATFORM_MODULE)_PLATFORM = x86_64-bcm_xlr-r0 +SONIC_MAKE_DEBS += $(BRCM_XLR_GTS_PLATFORM_MODULE) + +export BRCM_XLR_GTS_PLATFORM_MODULE + +SONIC_STRETCH_DEBS += $(BRCM_XLR_GTS_PLATFORM_MODULE) diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index a4f1d454ff..abedbbe1d6 100644 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -11,6 +11,7 @@ include $(PLATFORM_PATH)/platform-modules-cel.mk include $(PLATFORM_PATH)/platform-modules-delta.mk include $(PLATFORM_PATH)/platform-modules-quanta.mk #include $(PLATFORM_PATH)/platform-modules-mitac.mk +include $(PLATFORM_PATH)/platform-modules-brcm-xlr-gts.mk include $(PLATFORM_PATH)/docker-syncd-brcm.mk include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-brcm.mk diff --git a/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py b/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py index 7914099134..100af5bac8 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py @@ -252,7 +252,7 @@ def driver_inserted(): kos = [ 'depmod -ae', 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe optoe', 'modprobe i2c-mux-accton_as5712_54x_cpld', 'modprobe cpr_4011_4mxx', @@ -273,7 +273,15 @@ def driver_install(): def driver_uninstall(): global FORCE for i in range(0,len(kos)): - rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + #remove parameter if any + rm = kos[-(i+1)] + lst = rm.split(" ") + if len(lst) > 2: + del(lst[2:]) + rm = " ".join(lst) + + #Change to removing commands + rm = rm.replace("modprobe", "modprobe -rq") rm = rm.replace("insmod", "rmmod") status, output = log_os_system(rm, 1) if status: diff --git a/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py b/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py index 37ca9f2875..eb1b22f3ef 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py @@ -252,7 +252,7 @@ def driver_inserted(): kos = [ 'depmod -ae', 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe optoe', 'modprobe i2c-mux-accton_as5812_54x_cpld', 'modprobe cpr_4011_4mxx', @@ -273,7 +273,15 @@ def driver_install(): def driver_uninstall(): global FORCE for i in range(0,len(kos)): - rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + #remove parameter if any + rm = kos[-(i+1)] + lst = rm.split(" ") + if len(lst) > 2: + del(lst[2:]) + rm = " ".join(lst) + + #Change to removing commands + rm = rm.replace("modprobe", "modprobe -rq") rm = rm.replace("insmod", "rmmod") status, output = log_os_system(rm, 1) if status: diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/__init__.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py new file mode 100644 index 0000000000..c741ebfd72 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/fanutil.py @@ -0,0 +1,237 @@ +#!/usr/bin/env python +# +# Copyright (C) 2017 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 5/27/2019: Brandon_Chuang create +# ------------------------------------------------------------------ + +try: + import time + import logging + from collections import namedtuple +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + + +class FanUtil(object): + """Platform-specific FanUtil class""" + + FAN_NUM_ON_MAIN_BROAD = 5 + FAN_NUM_1_IDX = 1 + FAN_NUM_2_IDX = 2 + FAN_NUM_3_IDX = 3 + FAN_NUM_4_IDX = 4 + FAN_NUM_5_IDX = 5 + + FAN_NODE_NUM_OF_MAP = 2 + FAN_NODE_FAULT_IDX_OF_MAP = 1 + FAN_NODE_DIR_IDX_OF_MAP = 2 + + BASE_VAL_PATH = '/sys/bus/i2c/devices/3-0063/{0}' + FAN_DUTY_PATH = '/sys/bus/i2c/devices/3-0063/fan_duty_cycle_percentage' + + #logfile = '' + #loglevel = logging.INFO + + """ Dictionary where + key1 = fan id index (integer) starting from 1 + key2 = fan node index (interger) starting from 1 + value = path to fan device file (string) """ + _fan_to_device_path_mapping = {} + +#fan1_direction +#fan1_fault +#fan1_present + + #(FAN_NUM_2_IDX, FAN_NODE_DUTY_IDX_OF_MAP): 'fan2_duty_cycle_percentage', + _fan_to_device_node_mapping = { + (FAN_NUM_1_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan1_fault', + (FAN_NUM_1_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan1_direction', + + (FAN_NUM_2_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan2_fault', + (FAN_NUM_2_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan2_direction', + + (FAN_NUM_3_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan3_fault', + (FAN_NUM_3_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan3_direction', + + (FAN_NUM_4_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan4_fault', + (FAN_NUM_4_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan4_direction', + + (FAN_NUM_5_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan5_fault', + (FAN_NUM_5_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan5_direction', + } + + def _get_fan_to_device_node(self, fan_num, node_num): + return self._fan_to_device_node_mapping[(fan_num, node_num)] + + def _get_fan_node_val(self, fan_num, node_num): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num:%d', fan_num) + return None + + if node_num < self.FAN_NODE_FAULT_IDX_OF_MAP or node_num > self.FAN_NODE_NUM_OF_MAP: + logging.debug('GET. Parameter error. node_num:%d', node_num) + return None + + device_path = self.get_fan_to_device_path(fan_num, node_num) + + try: + val_file = open(device_path, 'r') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + + content = val_file.readline().rstrip() + + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + + try: + val_file.close() + except: + logging.debug('GET. unable to close file. device_path:%s', device_path) + return None + + return int(content) + + def _set_fan_node_val(self, fan_num, node_num, val): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num:%d', fan_num) + return None + + if node_num < self.FAN_NODE_FAULT_IDX_OF_MAP or node_num > self.FAN_NODE_NUM_OF_MAP: + logging.debug('GET. Parameter error. node_num:%d', node_num) + return None + + content = str(val) + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + + device_path = self.get_fan_to_device_path(fan_num, node_num) + try: + val_file = open(device_path, 'w') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + + val_file.write(content) + + try: + val_file.close() + except: + logging.debug('GET. unable to close file. device_path:%s', device_path) + return None + + return True + + def __init__(self): + fan_path = self.BASE_VAL_PATH + + for fan_num in range(self.FAN_NUM_1_IDX, self.FAN_NUM_ON_MAIN_BROAD+1): + for node_num in range(self.FAN_NODE_FAULT_IDX_OF_MAP, self.FAN_NODE_NUM_OF_MAP+1): + self._fan_to_device_path_mapping[(fan_num, node_num)] = fan_path.format( + self._fan_to_device_node_mapping[(fan_num, node_num)]) + + def get_num_fans(self): + return self.FAN_NUM_ON_MAIN_BROAD + + def get_idx_fan_start(self): + return self.FAN_NUM_1_IDX + + def get_num_nodes(self): + return self.FAN_NODE_NUM_OF_MAP + + def get_idx_node_start(self): + return self.FAN_NODE_FAULT_IDX_OF_MAP + + def get_size_node_map(self): + return len(self._fan_to_device_node_mapping) + + def get_size_path_map(self): + return len(self._fan_to_device_path_mapping) + + def get_fan_to_device_path(self, fan_num, node_num): + return self._fan_to_device_path_mapping[(fan_num, node_num)] + + def get_fan_fault(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_FAULT_IDX_OF_MAP) + + #def get_fan_speed(self, fan_num): + # return self._get_fan_node_val(fan_num, self.FAN_NODE_SPEED_IDX_OF_MAP) + + def get_fan_dir(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_DIR_IDX_OF_MAP) + + def get_fan_duty_cycle(self): + #duty_path = self.FAN_DUTY_PATH + try: + val_file = open(self.FAN_DUTY_PATH) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + return int(content) + + def set_fan_duty_cycle(self, val): + try: + fan_file = open(self.FAN_DUTY_PATH, 'r+') + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + fan_file.write(str(val)) + fan_file.close() + return True + + #def get_fanr_fault(self, fan_num): + # return self._get_fan_node_val(fan_num, self.FANR_NODE_FAULT_IDX_OF_MAP) + + def get_fanr_speed(self, fan_num): + return self._get_fan_node_val(fan_num, self.FANR_NODE_SPEED_IDX_OF_MAP) + + def get_fan_status(self, fan_num): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num, %d', fan_num) + return None + + if self.get_fan_fault(fan_num) is not None and self.get_fan_fault(fan_num) > 0: + logging.debug('GET. FAN fault. fan_num, %d', fan_num) + return False + + #if self.get_fanr_fault(fan_num) is not None and self.get_fanr_fault(fan_num) > 0: + # logging.debug('GET. FANR fault. fan_num, %d', fan_num) + # return False + + return True + +#def main(): +# fan = FanUtil() +# +# print 'get_size_node_map : %d' % fan.get_size_node_map() +# print 'get_size_path_map : %d' % fan.get_size_path_map() +# for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1): +# for y in range(fan.get_idx_node_start(), fan.get_num_nodes()+1): +# print fan.get_fan_to_device_path(x, y) +# +#if __name__ == '__main__': +# main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py new file mode 100644 index 0000000000..ce903db354 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/classes/thermalutil.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python +# +# Copyright (C) 2017 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 5/27/2019: Brandon_Chuang create +# ------------------------------------------------------------------ + +try: + import os + import time + import logging + import glob + import commands + from collections import namedtuple +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +class ThermalUtil(object): + """Platform-specific ThermalUtil class""" + THERMAL_NUM_MAX = 4 + THERMAL_NUM_1_IDX = 1 # 1_ON_CPU_BROAD. LM75 + THERMAL_NUM_2_IDX = 2 # 2_ON_MAIN_BROAD. LM75 + THERMAL_NUM_3_IDX = 3 # 3_ON_MAIN_BROAD. LM75 + THERMAL_NUM_4_IDX = 4 # 4_ON_MAIN_BROAD. LM75 + + """ Dictionary where + key1 = thermal id index (integer) starting from 1 + value = path to fan device file (string) """ + #_thermal_to_device_path_mapping = {} + + _thermal_to_device_node_mapping = { + THERMAL_NUM_1_IDX: ['18', '4b'], + THERMAL_NUM_2_IDX: ['19', '4c'], + THERMAL_NUM_3_IDX: ['20', '49'], + THERMAL_NUM_4_IDX: ['21', '4a'], + } + thermal_sysfspath ={ + THERMAL_NUM_1_IDX: ["/sys/bus/i2c/devices/18-004b/hwmon/hwmon3/temp1_input"], + THERMAL_NUM_2_IDX: ["/sys/bus/i2c/devices/19-004c/hwmon/hwmon4/temp1_input"], + THERMAL_NUM_3_IDX: ["/sys/bus/i2c/devices/20-0049/hwmon/hwmon5/temp1_input"], + THERMAL_NUM_4_IDX: ["/sys/bus/i2c/devices/21-004a/hwmon/hwmon6/temp1_input"], + } + + #def __init__(self): + def _get_thermal_val(self, thermal_num): + if thermal_num < self.THERMAL_NUM_1_IDX or thermal_num > self.THERMAL_NUM_MAX: + logging.debug('GET. Parameter error. thermal_num, %d', thermal_num) + return None + + device_path = self.get_thermal_to_device_path(thermal_num) + if(os.path.isfile(device_path)): + for filename in glob.glob(device_path): + try: + val_file = open(filename, 'r') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + content = val_file.readline().rstrip() + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + try: + val_file.close() + except: + logging.debug('GET. unable to close file. device_path:%s', device_path) + return None + return int(content) + + else: + print "No such device_path=%s"%device_path + return 0 + + def get_num_thermals(self): + return self.THERMAL_NUM_MAX + + def get_idx_thermal_start(self): + return self.THERMAL_NUM_1_IDX + + def get_size_node_map(self): + return len(self._thermal_to_device_node_mapping) + + def get_size_path_map(self): + return len(self.thermal_sysfspath) + + def get_thermal_to_device_path(self, thermal_num): + return self.thermal_sysfspath[thermal_num][0] + + def get_thermal_1_val(self): + return self._get_thermal_val(self.THERMAL_NUM_1_IDX) + + def get_thermal_2_val(self): + return self._get_thermal_val(self.THERMAL_NUM_2_IDX) + + def get_thermal_3_val(self): + return self._get_thermal_val(self.THERMAL_NUM_3_IDX) + + def get_thermal_temp(self): + return (self._get_thermal_val(self.THERMAL_NUM_1_IDX) + self._get_thermal_val(self.THERMAL_NUM_2_IDX) +self._get_thermal_val(self.THERMAL_NUM_3_IDX)) + +def main(): + thermal = ThermalUtil() + print "termal1=%d" %thermal._get_thermal_val(1) + print "termal2=%d" %thermal._get_thermal_val(2) + print "termal3=%d" %thermal._get_thermal_val(3) + print "termal4=%d" %thermal._get_thermal_val(4) +# +# print 'get_size_node_map : %d' % thermal.get_size_node_map() +# print 'get_size_path_map : %d' % thermal.get_size_path_map() +# for x in range(thermal.get_idx_thermal_start(), thermal.get_num_thermals()+1): +# print thermal.get_thermal_to_device_path(x) +# +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile new file mode 100644 index 0000000000..ec29de5fe7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/Makefile @@ -0,0 +1,17 @@ +ifneq ($(KERNELRELEASE),) +obj-m:= accton_as5835_54x_cpld.o accton_as5835_54x_psu.o \ + accton_as5835_54x_fan.o accton_as5835_54x_leds.o \ + ym2651y.o + +else +ifeq (,$(KERNEL_SRC)) +$(error KERNEL_SRC is not defined) +else +KERNELDIR:=$(KERNEL_SRC) +endif +PWD:=$(shell pwd) +default: + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules +clean: + rm -rf *.o *.mod.o *.mod.o *.ko .*cmd .tmp_versions Module.markers Module.symvers modules.order +endif diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c new file mode 100644 index 0000000000..c9d4f1c31e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c @@ -0,0 +1,1196 @@ +/* + * Copyright (C) Brandon Chuang + * + * This module supports the accton cpld that hold the channel select + * mechanism for other i2c slave devices, such as SFP. + * This includes the: + * Accton as5835_54x CPLD1/CPLD2/CPLD3 + * + * Based on: + * pca954x.c from Kumar Gala + * Copyright (C) 2006 + * + * Based on: + * pca954x.c from Ken Harrenstien + * Copyright (C) 2004 Google, Inc. (Ken Harrenstien) + * + * Based on: + * i2c-virtual_cb.c from Brian Kuschak + * and + * pca9540.c from Jean Delvare . + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define I2C_RW_RETRY_COUNT 10 +#define I2C_RW_RETRY_INTERVAL 60 /* ms */ + +static LIST_HEAD(cpld_client_list); +static struct mutex list_lock; + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +enum cpld_type { + as5835_54x_cpld1, + as5835_54x_cpld2, + as5835_54x_cpld3 +}; + +struct as5835_54x_cpld_data { + enum cpld_type type; + struct device *hwmon_dev; + struct mutex update_lock; +}; + +static const struct i2c_device_id as5835_54x_cpld_id[] = { + { "as5835_54x_cpld1", as5835_54x_cpld1 }, + { "as5835_54x_cpld2", as5835_54x_cpld2 }, + { "as5835_54x_cpld3", as5835_54x_cpld3 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, as5835_54x_cpld_id); + +#define TRANSCEIVER_PRESENT_ATTR_ID(index) MODULE_PRESENT_##index +#define TRANSCEIVER_TXDISABLE_ATTR_ID(index) MODULE_TXDISABLE_##index +#define TRANSCEIVER_RXLOS_ATTR_ID(index) MODULE_RXLOS_##index +#define TRANSCEIVER_TXFAULT_ATTR_ID(index) MODULE_TXFAULT_##index +#define TRANSCEIVER_LPMODE_ATTR_ID(index) MODULE_LPMODE_##index +#define TRANSCEIVER_RESET_ATTR_ID(index) MODULE_RESET_##index + +enum as5835_54x_cpld1_sysfs_attributes { + CPLD_VERSION, + ACCESS, + MODULE_PRESENT_ALL, + MODULE_RXLOS_ALL, + /* transceiver attributes */ + TRANSCEIVER_PRESENT_ATTR_ID(1), + TRANSCEIVER_PRESENT_ATTR_ID(2), + TRANSCEIVER_PRESENT_ATTR_ID(3), + TRANSCEIVER_PRESENT_ATTR_ID(4), + TRANSCEIVER_PRESENT_ATTR_ID(5), + TRANSCEIVER_PRESENT_ATTR_ID(6), + TRANSCEIVER_PRESENT_ATTR_ID(7), + TRANSCEIVER_PRESENT_ATTR_ID(8), + TRANSCEIVER_PRESENT_ATTR_ID(9), + TRANSCEIVER_PRESENT_ATTR_ID(10), + TRANSCEIVER_PRESENT_ATTR_ID(11), + TRANSCEIVER_PRESENT_ATTR_ID(12), + TRANSCEIVER_PRESENT_ATTR_ID(13), + TRANSCEIVER_PRESENT_ATTR_ID(14), + TRANSCEIVER_PRESENT_ATTR_ID(15), + TRANSCEIVER_PRESENT_ATTR_ID(16), + TRANSCEIVER_PRESENT_ATTR_ID(17), + TRANSCEIVER_PRESENT_ATTR_ID(18), + TRANSCEIVER_PRESENT_ATTR_ID(19), + TRANSCEIVER_PRESENT_ATTR_ID(20), + TRANSCEIVER_PRESENT_ATTR_ID(21), + TRANSCEIVER_PRESENT_ATTR_ID(22), + TRANSCEIVER_PRESENT_ATTR_ID(23), + TRANSCEIVER_PRESENT_ATTR_ID(24), + TRANSCEIVER_PRESENT_ATTR_ID(25), + TRANSCEIVER_PRESENT_ATTR_ID(26), + TRANSCEIVER_PRESENT_ATTR_ID(27), + TRANSCEIVER_PRESENT_ATTR_ID(28), + TRANSCEIVER_PRESENT_ATTR_ID(29), + TRANSCEIVER_PRESENT_ATTR_ID(30), + TRANSCEIVER_PRESENT_ATTR_ID(31), + TRANSCEIVER_PRESENT_ATTR_ID(32), + TRANSCEIVER_PRESENT_ATTR_ID(33), + TRANSCEIVER_PRESENT_ATTR_ID(34), + TRANSCEIVER_PRESENT_ATTR_ID(35), + TRANSCEIVER_PRESENT_ATTR_ID(36), + TRANSCEIVER_PRESENT_ATTR_ID(37), + TRANSCEIVER_PRESENT_ATTR_ID(38), + TRANSCEIVER_PRESENT_ATTR_ID(39), + TRANSCEIVER_PRESENT_ATTR_ID(40), + TRANSCEIVER_PRESENT_ATTR_ID(41), + TRANSCEIVER_PRESENT_ATTR_ID(42), + TRANSCEIVER_PRESENT_ATTR_ID(43), + TRANSCEIVER_PRESENT_ATTR_ID(44), + TRANSCEIVER_PRESENT_ATTR_ID(45), + TRANSCEIVER_PRESENT_ATTR_ID(46), + TRANSCEIVER_PRESENT_ATTR_ID(47), + TRANSCEIVER_PRESENT_ATTR_ID(48), + TRANSCEIVER_PRESENT_ATTR_ID(49), + TRANSCEIVER_PRESENT_ATTR_ID(50), + TRANSCEIVER_PRESENT_ATTR_ID(51), + TRANSCEIVER_PRESENT_ATTR_ID(52), + TRANSCEIVER_PRESENT_ATTR_ID(53), + TRANSCEIVER_PRESENT_ATTR_ID(54), + TRANSCEIVER_TXDISABLE_ATTR_ID(1), + TRANSCEIVER_TXDISABLE_ATTR_ID(2), + TRANSCEIVER_TXDISABLE_ATTR_ID(3), + TRANSCEIVER_TXDISABLE_ATTR_ID(4), + TRANSCEIVER_TXDISABLE_ATTR_ID(5), + TRANSCEIVER_TXDISABLE_ATTR_ID(6), + TRANSCEIVER_TXDISABLE_ATTR_ID(7), + TRANSCEIVER_TXDISABLE_ATTR_ID(8), + TRANSCEIVER_TXDISABLE_ATTR_ID(9), + TRANSCEIVER_TXDISABLE_ATTR_ID(10), + TRANSCEIVER_TXDISABLE_ATTR_ID(11), + TRANSCEIVER_TXDISABLE_ATTR_ID(12), + TRANSCEIVER_TXDISABLE_ATTR_ID(13), + TRANSCEIVER_TXDISABLE_ATTR_ID(14), + TRANSCEIVER_TXDISABLE_ATTR_ID(15), + TRANSCEIVER_TXDISABLE_ATTR_ID(16), + TRANSCEIVER_TXDISABLE_ATTR_ID(17), + TRANSCEIVER_TXDISABLE_ATTR_ID(18), + TRANSCEIVER_TXDISABLE_ATTR_ID(19), + TRANSCEIVER_TXDISABLE_ATTR_ID(20), + TRANSCEIVER_TXDISABLE_ATTR_ID(21), + TRANSCEIVER_TXDISABLE_ATTR_ID(22), + TRANSCEIVER_TXDISABLE_ATTR_ID(23), + TRANSCEIVER_TXDISABLE_ATTR_ID(24), + TRANSCEIVER_TXDISABLE_ATTR_ID(25), + TRANSCEIVER_TXDISABLE_ATTR_ID(26), + TRANSCEIVER_TXDISABLE_ATTR_ID(27), + TRANSCEIVER_TXDISABLE_ATTR_ID(28), + TRANSCEIVER_TXDISABLE_ATTR_ID(29), + TRANSCEIVER_TXDISABLE_ATTR_ID(30), + TRANSCEIVER_TXDISABLE_ATTR_ID(31), + TRANSCEIVER_TXDISABLE_ATTR_ID(32), + TRANSCEIVER_TXDISABLE_ATTR_ID(33), + TRANSCEIVER_TXDISABLE_ATTR_ID(34), + TRANSCEIVER_TXDISABLE_ATTR_ID(35), + TRANSCEIVER_TXDISABLE_ATTR_ID(36), + TRANSCEIVER_TXDISABLE_ATTR_ID(37), + TRANSCEIVER_TXDISABLE_ATTR_ID(38), + TRANSCEIVER_TXDISABLE_ATTR_ID(39), + TRANSCEIVER_TXDISABLE_ATTR_ID(40), + TRANSCEIVER_TXDISABLE_ATTR_ID(41), + TRANSCEIVER_TXDISABLE_ATTR_ID(42), + TRANSCEIVER_TXDISABLE_ATTR_ID(43), + TRANSCEIVER_TXDISABLE_ATTR_ID(44), + TRANSCEIVER_TXDISABLE_ATTR_ID(45), + TRANSCEIVER_TXDISABLE_ATTR_ID(46), + TRANSCEIVER_TXDISABLE_ATTR_ID(47), + TRANSCEIVER_TXDISABLE_ATTR_ID(48), + TRANSCEIVER_RXLOS_ATTR_ID(1), + TRANSCEIVER_RXLOS_ATTR_ID(2), + TRANSCEIVER_RXLOS_ATTR_ID(3), + TRANSCEIVER_RXLOS_ATTR_ID(4), + TRANSCEIVER_RXLOS_ATTR_ID(5), + TRANSCEIVER_RXLOS_ATTR_ID(6), + TRANSCEIVER_RXLOS_ATTR_ID(7), + TRANSCEIVER_RXLOS_ATTR_ID(8), + TRANSCEIVER_RXLOS_ATTR_ID(9), + TRANSCEIVER_RXLOS_ATTR_ID(10), + TRANSCEIVER_RXLOS_ATTR_ID(11), + TRANSCEIVER_RXLOS_ATTR_ID(12), + TRANSCEIVER_RXLOS_ATTR_ID(13), + TRANSCEIVER_RXLOS_ATTR_ID(14), + TRANSCEIVER_RXLOS_ATTR_ID(15), + TRANSCEIVER_RXLOS_ATTR_ID(16), + TRANSCEIVER_RXLOS_ATTR_ID(17), + TRANSCEIVER_RXLOS_ATTR_ID(18), + TRANSCEIVER_RXLOS_ATTR_ID(19), + TRANSCEIVER_RXLOS_ATTR_ID(20), + TRANSCEIVER_RXLOS_ATTR_ID(21), + TRANSCEIVER_RXLOS_ATTR_ID(22), + TRANSCEIVER_RXLOS_ATTR_ID(23), + TRANSCEIVER_RXLOS_ATTR_ID(24), + TRANSCEIVER_RXLOS_ATTR_ID(25), + TRANSCEIVER_RXLOS_ATTR_ID(26), + TRANSCEIVER_RXLOS_ATTR_ID(27), + TRANSCEIVER_RXLOS_ATTR_ID(28), + TRANSCEIVER_RXLOS_ATTR_ID(29), + TRANSCEIVER_RXLOS_ATTR_ID(30), + TRANSCEIVER_RXLOS_ATTR_ID(31), + TRANSCEIVER_RXLOS_ATTR_ID(32), + TRANSCEIVER_RXLOS_ATTR_ID(33), + TRANSCEIVER_RXLOS_ATTR_ID(34), + TRANSCEIVER_RXLOS_ATTR_ID(35), + TRANSCEIVER_RXLOS_ATTR_ID(36), + TRANSCEIVER_RXLOS_ATTR_ID(37), + TRANSCEIVER_RXLOS_ATTR_ID(38), + TRANSCEIVER_RXLOS_ATTR_ID(39), + TRANSCEIVER_RXLOS_ATTR_ID(40), + TRANSCEIVER_RXLOS_ATTR_ID(41), + TRANSCEIVER_RXLOS_ATTR_ID(42), + TRANSCEIVER_RXLOS_ATTR_ID(43), + TRANSCEIVER_RXLOS_ATTR_ID(44), + TRANSCEIVER_RXLOS_ATTR_ID(45), + TRANSCEIVER_RXLOS_ATTR_ID(46), + TRANSCEIVER_RXLOS_ATTR_ID(47), + TRANSCEIVER_RXLOS_ATTR_ID(48), + TRANSCEIVER_TXFAULT_ATTR_ID(1), + TRANSCEIVER_TXFAULT_ATTR_ID(2), + TRANSCEIVER_TXFAULT_ATTR_ID(3), + TRANSCEIVER_TXFAULT_ATTR_ID(4), + TRANSCEIVER_TXFAULT_ATTR_ID(5), + TRANSCEIVER_TXFAULT_ATTR_ID(6), + TRANSCEIVER_TXFAULT_ATTR_ID(7), + TRANSCEIVER_TXFAULT_ATTR_ID(8), + TRANSCEIVER_TXFAULT_ATTR_ID(9), + TRANSCEIVER_TXFAULT_ATTR_ID(10), + TRANSCEIVER_TXFAULT_ATTR_ID(11), + TRANSCEIVER_TXFAULT_ATTR_ID(12), + TRANSCEIVER_TXFAULT_ATTR_ID(13), + TRANSCEIVER_TXFAULT_ATTR_ID(14), + TRANSCEIVER_TXFAULT_ATTR_ID(15), + TRANSCEIVER_TXFAULT_ATTR_ID(16), + TRANSCEIVER_TXFAULT_ATTR_ID(17), + TRANSCEIVER_TXFAULT_ATTR_ID(18), + TRANSCEIVER_TXFAULT_ATTR_ID(19), + TRANSCEIVER_TXFAULT_ATTR_ID(20), + TRANSCEIVER_TXFAULT_ATTR_ID(21), + TRANSCEIVER_TXFAULT_ATTR_ID(22), + TRANSCEIVER_TXFAULT_ATTR_ID(23), + TRANSCEIVER_TXFAULT_ATTR_ID(24), + TRANSCEIVER_TXFAULT_ATTR_ID(25), + TRANSCEIVER_TXFAULT_ATTR_ID(26), + TRANSCEIVER_TXFAULT_ATTR_ID(27), + TRANSCEIVER_TXFAULT_ATTR_ID(28), + TRANSCEIVER_TXFAULT_ATTR_ID(29), + TRANSCEIVER_TXFAULT_ATTR_ID(30), + TRANSCEIVER_TXFAULT_ATTR_ID(31), + TRANSCEIVER_TXFAULT_ATTR_ID(32), + TRANSCEIVER_TXFAULT_ATTR_ID(33), + TRANSCEIVER_TXFAULT_ATTR_ID(34), + TRANSCEIVER_TXFAULT_ATTR_ID(35), + TRANSCEIVER_TXFAULT_ATTR_ID(36), + TRANSCEIVER_TXFAULT_ATTR_ID(37), + TRANSCEIVER_TXFAULT_ATTR_ID(38), + TRANSCEIVER_TXFAULT_ATTR_ID(39), + TRANSCEIVER_TXFAULT_ATTR_ID(40), + TRANSCEIVER_TXFAULT_ATTR_ID(41), + TRANSCEIVER_TXFAULT_ATTR_ID(42), + TRANSCEIVER_TXFAULT_ATTR_ID(43), + TRANSCEIVER_TXFAULT_ATTR_ID(44), + TRANSCEIVER_TXFAULT_ATTR_ID(45), + TRANSCEIVER_TXFAULT_ATTR_ID(46), + TRANSCEIVER_TXFAULT_ATTR_ID(47), + TRANSCEIVER_TXFAULT_ATTR_ID(48), + TRANSCEIVER_LPMODE_ATTR_ID(49), + TRANSCEIVER_LPMODE_ATTR_ID(50), + TRANSCEIVER_LPMODE_ATTR_ID(51), + TRANSCEIVER_LPMODE_ATTR_ID(52), + TRANSCEIVER_LPMODE_ATTR_ID(53), + TRANSCEIVER_LPMODE_ATTR_ID(54), + TRANSCEIVER_RESET_ATTR_ID(49), + TRANSCEIVER_RESET_ATTR_ID(50), + TRANSCEIVER_RESET_ATTR_ID(51), + TRANSCEIVER_RESET_ATTR_ID(52), + TRANSCEIVER_RESET_ATTR_ID(53), + TRANSCEIVER_RESET_ATTR_ID(54), +}; + +/* sysfs attributes for hwmon + */ +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_present_all(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_rxlos_all(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t set_control(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t access(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t show_version(struct device *dev, struct device_attribute *da, + char *buf); +static int as5835_54x_cpld_read_internal(struct i2c_client *client, u8 reg); +static int as5835_54x_cpld_write_internal(struct i2c_client *client, u8 reg, u8 value); + +/* transceiver attributes */ +#define DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_present_##index, S_IRUGO, show_status, NULL, MODULE_PRESENT_##index) +#define DECLARE_TRANSCEIVER_PRESENT_ATTR(index) &sensor_dev_attr_module_present_##index.dev_attr.attr + +#define DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_tx_disable_##index, S_IRUGO | S_IWUSR, show_status, set_control, MODULE_TXDISABLE_##index); \ + static SENSOR_DEVICE_ATTR(module_rx_los_##index, S_IRUGO, show_status, NULL, MODULE_RXLOS_##index); \ + static SENSOR_DEVICE_ATTR(module_tx_fault_##index, S_IRUGO, show_status, NULL, MODULE_TXFAULT_##index) +#define DECLARE_SFP_TRANSCEIVER_ATTR(index) \ + &sensor_dev_attr_module_tx_disable_##index.dev_attr.attr, \ + &sensor_dev_attr_module_rx_los_##index.dev_attr.attr, \ + &sensor_dev_attr_module_tx_fault_##index.dev_attr.attr + +#define DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_lpmode_##index, S_IRUGO | S_IWUSR, show_status, set_control, MODULE_LPMODE_##index); \ + static SENSOR_DEVICE_ATTR(module_reset_##index, S_IRUGO | S_IWUSR, show_status, set_control, MODULE_RESET_##index) +#define DECLARE_QSFP_TRANSCEIVER_ATTR(index) \ + &sensor_dev_attr_module_lpmode_##index.dev_attr.attr, \ + &sensor_dev_attr_module_reset_##index.dev_attr.attr + +static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, CPLD_VERSION); +static SENSOR_DEVICE_ATTR(access, S_IWUSR, NULL, access, ACCESS); +/* transceiver attributes */ +static SENSOR_DEVICE_ATTR(module_present_all, S_IRUGO, show_present_all, NULL, MODULE_PRESENT_ALL); +static SENSOR_DEVICE_ATTR(module_rx_los_all, S_IRUGO, show_rxlos_all, NULL, MODULE_RXLOS_ALL); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(1); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(2); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(3); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(4); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(5); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(6); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(7); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(8); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(9); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(10); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(11); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(12); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(13); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(14); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(15); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(16); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(17); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(18); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(19); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(20); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(21); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(22); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(23); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(24); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(25); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(26); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(27); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(28); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(29); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(30); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(31); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(32); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(33); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(34); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(35); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(36); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(37); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(38); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(39); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(40); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(41); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(42); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(43); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(44); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(45); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(46); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(47); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(48); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(49); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(50); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(51); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(52); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(53); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(54); + +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(1); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(2); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(3); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(4); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(5); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(6); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(7); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(8); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(9); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(10); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(11); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(12); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(13); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(14); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(15); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(16); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(17); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(18); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(19); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(20); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(21); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(22); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(23); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(24); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(25); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(26); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(27); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(28); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(29); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(30); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(31); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(32); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(33); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(34); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(35); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(36); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(37); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(38); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(39); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(40); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(41); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(42); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(43); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(44); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(45); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(46); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(47); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(48); + +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(49); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(50); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(51); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(52); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(53); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(54); + +static struct attribute *as5835_54x_cpld1_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + NULL +}; + +static const struct attribute_group as5835_54x_cpld1_group = { + .attrs = as5835_54x_cpld1_attributes, +}; + +static struct attribute *as5835_54x_cpld2_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + /* transceiver attributes */ + &sensor_dev_attr_module_present_all.dev_attr.attr, + &sensor_dev_attr_module_rx_los_all.dev_attr.attr, + DECLARE_TRANSCEIVER_PRESENT_ATTR(1), + DECLARE_TRANSCEIVER_PRESENT_ATTR(2), + DECLARE_TRANSCEIVER_PRESENT_ATTR(3), + DECLARE_TRANSCEIVER_PRESENT_ATTR(4), + DECLARE_TRANSCEIVER_PRESENT_ATTR(5), + DECLARE_TRANSCEIVER_PRESENT_ATTR(6), + DECLARE_TRANSCEIVER_PRESENT_ATTR(7), + DECLARE_TRANSCEIVER_PRESENT_ATTR(8), + DECLARE_TRANSCEIVER_PRESENT_ATTR(9), + DECLARE_TRANSCEIVER_PRESENT_ATTR(10), + DECLARE_TRANSCEIVER_PRESENT_ATTR(11), + DECLARE_TRANSCEIVER_PRESENT_ATTR(12), + DECLARE_TRANSCEIVER_PRESENT_ATTR(13), + DECLARE_TRANSCEIVER_PRESENT_ATTR(14), + DECLARE_TRANSCEIVER_PRESENT_ATTR(15), + DECLARE_TRANSCEIVER_PRESENT_ATTR(16), + DECLARE_TRANSCEIVER_PRESENT_ATTR(17), + DECLARE_TRANSCEIVER_PRESENT_ATTR(18), + DECLARE_TRANSCEIVER_PRESENT_ATTR(19), + DECLARE_TRANSCEIVER_PRESENT_ATTR(20), + DECLARE_TRANSCEIVER_PRESENT_ATTR(21), + DECLARE_TRANSCEIVER_PRESENT_ATTR(22), + DECLARE_TRANSCEIVER_PRESENT_ATTR(23), + DECLARE_TRANSCEIVER_PRESENT_ATTR(24), + DECLARE_TRANSCEIVER_PRESENT_ATTR(25), + DECLARE_TRANSCEIVER_PRESENT_ATTR(26), + DECLARE_TRANSCEIVER_PRESENT_ATTR(27), + DECLARE_TRANSCEIVER_PRESENT_ATTR(28), + DECLARE_TRANSCEIVER_PRESENT_ATTR(29), + DECLARE_TRANSCEIVER_PRESENT_ATTR(30), + DECLARE_TRANSCEIVER_PRESENT_ATTR(31), + DECLARE_TRANSCEIVER_PRESENT_ATTR(32), + DECLARE_TRANSCEIVER_PRESENT_ATTR(33), + DECLARE_TRANSCEIVER_PRESENT_ATTR(34), + DECLARE_TRANSCEIVER_PRESENT_ATTR(35), + DECLARE_TRANSCEIVER_PRESENT_ATTR(36), + DECLARE_TRANSCEIVER_PRESENT_ATTR(37), + DECLARE_TRANSCEIVER_PRESENT_ATTR(38), + DECLARE_SFP_TRANSCEIVER_ATTR(1), + DECLARE_SFP_TRANSCEIVER_ATTR(2), + DECLARE_SFP_TRANSCEIVER_ATTR(3), + DECLARE_SFP_TRANSCEIVER_ATTR(4), + DECLARE_SFP_TRANSCEIVER_ATTR(5), + DECLARE_SFP_TRANSCEIVER_ATTR(6), + DECLARE_SFP_TRANSCEIVER_ATTR(7), + DECLARE_SFP_TRANSCEIVER_ATTR(8), + DECLARE_SFP_TRANSCEIVER_ATTR(9), + DECLARE_SFP_TRANSCEIVER_ATTR(10), + DECLARE_SFP_TRANSCEIVER_ATTR(11), + DECLARE_SFP_TRANSCEIVER_ATTR(12), + DECLARE_SFP_TRANSCEIVER_ATTR(13), + DECLARE_SFP_TRANSCEIVER_ATTR(14), + DECLARE_SFP_TRANSCEIVER_ATTR(15), + DECLARE_SFP_TRANSCEIVER_ATTR(16), + DECLARE_SFP_TRANSCEIVER_ATTR(17), + DECLARE_SFP_TRANSCEIVER_ATTR(18), + DECLARE_SFP_TRANSCEIVER_ATTR(19), + DECLARE_SFP_TRANSCEIVER_ATTR(20), + DECLARE_SFP_TRANSCEIVER_ATTR(21), + DECLARE_SFP_TRANSCEIVER_ATTR(22), + DECLARE_SFP_TRANSCEIVER_ATTR(23), + DECLARE_SFP_TRANSCEIVER_ATTR(24), + DECLARE_SFP_TRANSCEIVER_ATTR(25), + DECLARE_SFP_TRANSCEIVER_ATTR(26), + DECLARE_SFP_TRANSCEIVER_ATTR(27), + DECLARE_SFP_TRANSCEIVER_ATTR(28), + DECLARE_SFP_TRANSCEIVER_ATTR(29), + DECLARE_SFP_TRANSCEIVER_ATTR(30), + DECLARE_SFP_TRANSCEIVER_ATTR(31), + DECLARE_SFP_TRANSCEIVER_ATTR(32), + DECLARE_SFP_TRANSCEIVER_ATTR(33), + DECLARE_SFP_TRANSCEIVER_ATTR(34), + DECLARE_SFP_TRANSCEIVER_ATTR(35), + DECLARE_SFP_TRANSCEIVER_ATTR(36), + DECLARE_SFP_TRANSCEIVER_ATTR(37), + DECLARE_SFP_TRANSCEIVER_ATTR(38), + NULL +}; + +static const struct attribute_group as5835_54x_cpld2_group = { + .attrs = as5835_54x_cpld2_attributes, +}; + +static struct attribute *as5835_54x_cpld3_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + /* transceiver attributes */ + &sensor_dev_attr_module_present_all.dev_attr.attr, + &sensor_dev_attr_module_rx_los_all.dev_attr.attr, + DECLARE_TRANSCEIVER_PRESENT_ATTR(39), + DECLARE_TRANSCEIVER_PRESENT_ATTR(40), + DECLARE_TRANSCEIVER_PRESENT_ATTR(41), + DECLARE_TRANSCEIVER_PRESENT_ATTR(42), + DECLARE_TRANSCEIVER_PRESENT_ATTR(43), + DECLARE_TRANSCEIVER_PRESENT_ATTR(44), + DECLARE_TRANSCEIVER_PRESENT_ATTR(45), + DECLARE_TRANSCEIVER_PRESENT_ATTR(46), + DECLARE_TRANSCEIVER_PRESENT_ATTR(47), + DECLARE_TRANSCEIVER_PRESENT_ATTR(48), + DECLARE_TRANSCEIVER_PRESENT_ATTR(49), + DECLARE_TRANSCEIVER_PRESENT_ATTR(50), + DECLARE_TRANSCEIVER_PRESENT_ATTR(51), + DECLARE_TRANSCEIVER_PRESENT_ATTR(52), + DECLARE_TRANSCEIVER_PRESENT_ATTR(53), + DECLARE_TRANSCEIVER_PRESENT_ATTR(54), + DECLARE_SFP_TRANSCEIVER_ATTR(39), + DECLARE_SFP_TRANSCEIVER_ATTR(40), + DECLARE_SFP_TRANSCEIVER_ATTR(41), + DECLARE_SFP_TRANSCEIVER_ATTR(42), + DECLARE_SFP_TRANSCEIVER_ATTR(43), + DECLARE_SFP_TRANSCEIVER_ATTR(44), + DECLARE_SFP_TRANSCEIVER_ATTR(45), + DECLARE_SFP_TRANSCEIVER_ATTR(46), + DECLARE_SFP_TRANSCEIVER_ATTR(47), + DECLARE_SFP_TRANSCEIVER_ATTR(48), + DECLARE_QSFP_TRANSCEIVER_ATTR(49), + DECLARE_QSFP_TRANSCEIVER_ATTR(50), + DECLARE_QSFP_TRANSCEIVER_ATTR(51), + DECLARE_QSFP_TRANSCEIVER_ATTR(52), + DECLARE_QSFP_TRANSCEIVER_ATTR(53), + DECLARE_QSFP_TRANSCEIVER_ATTR(54), + NULL +}; + +static const struct attribute_group as5835_54x_cpld3_group = { + .attrs = as5835_54x_cpld3_attributes, +}; + +static ssize_t show_present_all(struct device *dev, struct device_attribute *da, + char *buf) +{ + int i, status; + u8 values[5] = {0}; + u8 regs_cpld2[] = {0x8, 0x9, 0xA, 0xB, 0xC}; + u8 regs_cpld3[] = {0x6, 0x7, 0x14}; + u8 *regs[] = {NULL, regs_cpld2, regs_cpld3}; + u8 size[] = {0, ARRAY_SIZE(regs_cpld2), ARRAY_SIZE(regs_cpld3)}; + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + for (i = 0; i < size[data->type]; i++) { + status = as5835_54x_cpld_read_internal(client, regs[data->type][i]); + if (status < 0) { + goto exit; + } + + values[i] = ~(u8)status; + } + + mutex_unlock(&data->update_lock); + + /* Return values in order */ + if (data->type == as5835_54x_cpld2) { + values[4] &= 0x3F; + return sprintf(buf, "%.2x %.2x %.2x %.2x %.2x\n", + values[0], values[1], values[2], values[3], values[4]); + } + else { /* as5835_54x_cpld3 */ + values[1] &= 0x3; + values[1] |= (values[2] & 0x3F) << 2; /* Shift port49-54 to bit2-7 */ + return sprintf(buf, "%.2x %.2x\n", values[0], values[1]); + } + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t show_rxlos_all(struct device *dev, struct device_attribute *da, + char *buf) +{ + int i, status; + u8 values[5] = {0}; + u8 regs_cpld2[] = {0x17, 0x18, 0x19, 0x1A, 0x1B}; + u8 regs_cpld3[] = {0xF, 0x10}; + u8 *regs[] = {NULL, regs_cpld2, regs_cpld3}; + u8 size[] = {0, ARRAY_SIZE(regs_cpld2), ARRAY_SIZE(regs_cpld3)}; + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + for (i = 0; i < size[data->type]; i++) { + status = as5835_54x_cpld_read_internal(client, regs[data->type][i]); + if (status < 0) { + goto exit; + } + + values[i] = (u8)status; + } + + mutex_unlock(&data->update_lock); + + /* Return values in order */ + if (data->type == as5835_54x_cpld2) { + values[4] &= 0x3F; + return sprintf(buf, "%.2x %.2x %.2x %.2x %.2x\n", + values[0], values[1], values[2], values[3], values[4]); + } + else { /* as5835_54x_cpld3 */ + values[1] &= 0x3; + return sprintf(buf, "%.2x %.2x\n", values[0], values[1]); + } + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); + int status = 0; + u8 reg = 0, mask = 0, revert = 0; + + switch (attr->index) { + case MODULE_PRESENT_1 ... MODULE_PRESENT_8: + reg = 0x8; + mask = 0x1 << (attr->index - MODULE_PRESENT_1); + break; + case MODULE_PRESENT_9 ... MODULE_PRESENT_16: + reg = 0x9; + mask = 0x1 << (attr->index - MODULE_PRESENT_9); + break; + case MODULE_PRESENT_17 ... MODULE_PRESENT_24: + reg = 0xA; + mask = 0x1 << (attr->index - MODULE_PRESENT_17); + break; + case MODULE_PRESENT_25 ... MODULE_PRESENT_32: + reg = 0xB; + mask = 0x1 << (attr->index - MODULE_PRESENT_25); + break; + case MODULE_PRESENT_33 ... MODULE_PRESENT_38: + reg = 0xC; + mask = 0x1 << (attr->index - MODULE_PRESENT_33); + break; + case MODULE_PRESENT_39 ... MODULE_PRESENT_46: + reg = 0x6; + mask = 0x1 << (attr->index - MODULE_PRESENT_39); + break; + case MODULE_PRESENT_47 ... MODULE_PRESENT_48: + reg = 0x7; + mask = 0x1 << (attr->index - MODULE_PRESENT_47); + break; + case MODULE_PRESENT_49 ... MODULE_PRESENT_54: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_PRESENT_49); + break; + case MODULE_TXFAULT_1 ... MODULE_TXFAULT_8: + reg = 0xD; + mask = 0x1 << (attr->index - MODULE_TXFAULT_1); + break; + case MODULE_TXFAULT_9 ... MODULE_TXFAULT_16: + reg = 0xE; + mask = 0x1 << (attr->index - MODULE_TXFAULT_9); + break; + case MODULE_TXFAULT_17 ... MODULE_TXFAULT_24: + reg = 0xF; + mask = 0x1 << (attr->index - MODULE_TXFAULT_17); + break; + case MODULE_TXFAULT_25 ... MODULE_TXFAULT_32: + reg = 0x10; + mask = 0x1 << (attr->index - MODULE_TXFAULT_25); + break; + case MODULE_TXFAULT_33 ... MODULE_TXFAULT_38: + reg = 0x11; + mask = 0x1 << (attr->index - MODULE_TXFAULT_33); + break; + case MODULE_TXFAULT_39 ... MODULE_TXFAULT_46: + reg = 0x9; + mask = 0x1 << (attr->index - MODULE_TXFAULT_39); + break; + case MODULE_TXFAULT_47 ... MODULE_TXFAULT_48: + reg = 0xA; + mask = 0x1 << (attr->index - MODULE_TXFAULT_47); + break; + case MODULE_TXDISABLE_1 ... MODULE_TXDISABLE_8: + reg = 0x12; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_1); + break; + case MODULE_TXDISABLE_9 ... MODULE_TXDISABLE_16: + reg = 0x13; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_9); + break; + case MODULE_TXDISABLE_17 ... MODULE_TXDISABLE_24: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_17); + break; + case MODULE_TXDISABLE_25 ... MODULE_TXDISABLE_32: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_25); + break; + case MODULE_TXDISABLE_33 ... MODULE_TXDISABLE_38: + reg = 0x16; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_33); + break; + case MODULE_TXDISABLE_39 ... MODULE_TXDISABLE_46: + reg = 0xC; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_39); + break; + case MODULE_TXDISABLE_47 ... MODULE_TXDISABLE_48: + reg = 0xD; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_47); + break; + case MODULE_RXLOS_1 ... MODULE_RXLOS_8: + reg = 0x17; + mask = 0x1 << (attr->index - MODULE_RXLOS_1); + break; + case MODULE_RXLOS_9 ... MODULE_RXLOS_16: + reg = 0x18; + mask = 0x1 << (attr->index - MODULE_RXLOS_9); + break; + case MODULE_RXLOS_17 ... MODULE_RXLOS_24: + reg = 0x19; + mask = 0x1 << (attr->index - MODULE_RXLOS_17); + break; + case MODULE_RXLOS_25 ... MODULE_RXLOS_32: + reg = 0x1A; + mask = 0x1 << (attr->index - MODULE_RXLOS_25); + break; + case MODULE_RXLOS_33 ... MODULE_RXLOS_38: + reg = 0x1B; + mask = 0x1 << (attr->index - MODULE_RXLOS_33); + break; + case MODULE_RXLOS_39 ... MODULE_RXLOS_46: + reg = 0xF; + mask = 0x1 << (attr->index - MODULE_RXLOS_39); + break; + case MODULE_RXLOS_47 ... MODULE_RXLOS_48: + reg = 0x10; + mask = 0x1 << (attr->index - MODULE_RXLOS_47); + break; + case MODULE_LPMODE_49 ... MODULE_LPMODE_54: + reg = 0x16; + mask = 0x1 << (attr->index - MODULE_LPMODE_49); + break; + case MODULE_RESET_49 ... MODULE_RESET_54: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_RESET_49); + break; + default: + return 0; + } + + if (attr->index >= MODULE_PRESENT_1 && attr->index <= MODULE_PRESENT_54) { + revert = 1; + } + + mutex_lock(&data->update_lock); + status = as5835_54x_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\n", revert ? !(status & mask) : !!(status & mask)); + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t set_control(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); + long value; + int status; + u8 reg = 0, mask = 0; + + status = kstrtol(buf, 10, &value); + if (status) { + return status; + } + + switch (attr->index) { + case MODULE_TXDISABLE_1 ... MODULE_TXDISABLE_8: + reg = 0x12; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_1); + break; + case MODULE_TXDISABLE_9 ... MODULE_TXDISABLE_16: + reg = 0x13; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_9); + break; + case MODULE_TXDISABLE_17 ... MODULE_TXDISABLE_24: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_17); + break; + case MODULE_TXDISABLE_25 ... MODULE_TXDISABLE_32: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_25); + break; + case MODULE_TXDISABLE_33 ... MODULE_TXDISABLE_38: + reg = 0x16; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_33); + break; + case MODULE_TXDISABLE_39 ... MODULE_TXDISABLE_46: + reg = 0xC; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_39); + break; + case MODULE_TXDISABLE_47 ... MODULE_TXDISABLE_48: + reg = 0xD; + mask = 0x1 << (attr->index - MODULE_TXDISABLE_47); + break; + case MODULE_LPMODE_49 ... MODULE_LPMODE_54: + reg = 0x16; + mask = 0x1 << (attr->index - MODULE_LPMODE_49); + break; + case MODULE_RESET_49 ... MODULE_RESET_54: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_RESET_49); + break; + default: + return 0; + } + + /* Read current status */ + mutex_lock(&data->update_lock); + status = as5835_54x_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + + /* Update tx_disable/lpmode/reset status */ + if (value) { + status |= mask; + } + else { + status &= ~mask; + } + + status = as5835_54x_cpld_write_internal(client, reg, status); + if (unlikely(status < 0)) { + goto exit; + } + + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t access(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int status; + u32 addr, val; + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); + + if (sscanf(buf, "0x%x 0x%x", &addr, &val) != 2) { + return -EINVAL; + } + + if (addr > 0xFF || val > 0xFF) { + return -EINVAL; + } + + mutex_lock(&data->update_lock); + status = as5835_54x_cpld_write_internal(client, addr, val); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static void as5835_54x_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + + if (!node) { + dev_dbg(&client->dev, "Can't allocate cpld_client_node (0x%x)\n", client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +static void as5835_54x_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client == client) { + found = 1; + break; + } + } + + if (found) { + list_del(list_node); + kfree(cpld_node); + } + + mutex_unlock(&list_lock); +} + +static ssize_t show_version(struct device *dev, struct device_attribute *attr, char *buf) +{ + int val = 0; + struct i2c_client *client = to_i2c_client(dev); + + val = i2c_smbus_read_byte_data(client, 0x1); + + if (val < 0) { + dev_dbg(&client->dev, "cpld(0x%x) reg(0x1) err %d\n", client->addr, val); + } + + return sprintf(buf, "%d\n", val); +} + +/* + * I2C init/probing/exit functions + */ +static int as5835_54x_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); + struct as5835_54x_cpld_data *data; + int ret = -ENODEV; + const struct attribute_group *group = NULL; + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) + goto exit; + + data = kzalloc(sizeof(struct as5835_54x_cpld_data), GFP_KERNEL); + if (!data) { + ret = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + data->type = id->driver_data; + + /* Register sysfs hooks */ + switch (data->type) { + case as5835_54x_cpld1: + group = &as5835_54x_cpld1_group; + break; + case as5835_54x_cpld2: + group = &as5835_54x_cpld2_group; + break; + case as5835_54x_cpld3: + group = &as5835_54x_cpld3_group; + break; + default: + break; + } + + if (group) { + ret = sysfs_create_group(&client->dev.kobj, group); + if (ret) { + goto exit_free; + } + } + + as5835_54x_cpld_add_client(client); + return 0; + +exit_free: + kfree(data); +exit: + return ret; +} + +static int as5835_54x_cpld_remove(struct i2c_client *client) +{ + struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); + const struct attribute_group *group = NULL; + + as5835_54x_cpld_remove_client(client); + + /* Remove sysfs hooks */ + switch (data->type) { + case as5835_54x_cpld1: + group = &as5835_54x_cpld1_group; + break; + case as5835_54x_cpld2: + group = &as5835_54x_cpld2_group; + break; + case as5835_54x_cpld3: + group = &as5835_54x_cpld3_group; + break; + default: + break; + } + + if (group) { + sysfs_remove_group(&client->dev.kobj, group); + } + + kfree(data); + + return 0; +} + +static int as5835_54x_cpld_read_internal(struct i2c_client *client, u8 reg) +{ + int status = 0, retry = I2C_RW_RETRY_COUNT; + + while (retry) { + status = i2c_smbus_read_byte_data(client, reg); + if (unlikely(status < 0)) { + msleep(I2C_RW_RETRY_INTERVAL); + retry--; + continue; + } + + break; + } + + return status; +} + +static int as5835_54x_cpld_write_internal(struct i2c_client *client, u8 reg, u8 value) +{ + int status = 0, retry = I2C_RW_RETRY_COUNT; + + while (retry) { + status = i2c_smbus_write_byte_data(client, reg, value); + if (unlikely(status < 0)) { + msleep(I2C_RW_RETRY_INTERVAL); + retry--; + continue; + } + + break; + } + + return status; +} + +int as5835_54x_cpld_read(unsigned short cpld_addr, u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client->addr == cpld_addr) { + ret = as5835_54x_cpld_read_internal(cpld_node->client, reg); + break; + } + } + + mutex_unlock(&list_lock); + + return ret; +} +EXPORT_SYMBOL(as5835_54x_cpld_read); + +int as5835_54x_cpld_write(unsigned short cpld_addr, u8 reg, u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client->addr == cpld_addr) { + ret = as5835_54x_cpld_write_internal(cpld_node->client, reg, value); + break; + } + } + + mutex_unlock(&list_lock); + + return ret; +} +EXPORT_SYMBOL(as5835_54x_cpld_write); + +static struct i2c_driver as5835_54x_cpld_driver = { + .driver = { + .name = "as5835_54x_cpld", + .owner = THIS_MODULE, + }, + .probe = as5835_54x_cpld_probe, + .remove = as5835_54x_cpld_remove, + .id_table = as5835_54x_cpld_id, +}; + +static int __init as5835_54x_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&as5835_54x_cpld_driver); +} + +static void __exit as5835_54x_cpld_exit(void) +{ + i2c_del_driver(&as5835_54x_cpld_driver); +} + +MODULE_AUTHOR("Brandon Chuang "); +MODULE_DESCRIPTION("Accton I2C CPLD driver"); +MODULE_LICENSE("GPL"); + +module_init(as5835_54x_cpld_init); +module_exit(as5835_54x_cpld_exit); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_fan.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_fan.c new file mode 100644 index 0000000000..45b8d0d984 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_fan.c @@ -0,0 +1,484 @@ +/* + * A hwmon driver for the Accton as5835 54x fan + * + * Copyright (C) 2016 Accton Technology Corporation. + * Brandon Chuang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "as5835_54x_fan" +#define MAX_FAN_SPEED_RPM 21500 + +static struct as5835_54x_fan_data *as5835_54x_fan_update_device(struct device *dev); +static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, char *buf); +static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t show_version(struct device *dev, struct device_attribute *da, + char *buf); +extern int as5835_54x_cpld_read(unsigned short cpld_addr, u8 reg); +extern int as5835_54x_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); + +/* fan related data, the index should match sysfs_fan_attributes + */ +static const u8 fan_reg[] = { + 0x02, /* fan 1-5 present status */ + 0x03, /* fan 1-5 direction(0:F2B 1:B2F) */ + 0x04, /* front fan 1-5 fault status */ + 0x05, /* rear fan 1-5 fault status */ + 0x06, /* fan PWM(for all fan) */ + 0x07, /* front fan 1 speed(rpm) */ + 0x08, /* front fan 2 speed(rpm) */ + 0x09, /* front fan 3 speed(rpm) */ + 0x0A, /* front fan 4 speed(rpm) */ + 0x0B, /* front fan 5 speed(rpm) */ + 0x0C, /* rear fan 1 speed(rpm) */ + 0x0D, /* rear fan 2 speed(rpm) */ + 0x0E, /* rear fan 3 speed(rpm) */ + 0x0F, /* rear fan 4 speed(rpm) */ + 0x10, /* rear fan 5 speed(rpm) */ +}; + +/* fan data */ +struct as5835_54x_fan_data { + struct platform_device *pdev; + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* != 0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 reg_val[ARRAY_SIZE(fan_reg)]; /* Register value */ +}; + +enum fan_id { + FAN1_ID, + FAN2_ID, + FAN3_ID, + FAN4_ID, + FAN5_ID +}; + +enum sysfs_fan_attributes { + FAN_PRESENT_REG, + FAN_DIRECTION_REG, + FAN_FRONT_FAULT_REG, + FAN_REAR_FAULT_REG, + FAN_DUTY_CYCLE_PERCENTAGE, /* Only one CPLD register to control duty cycle for all fans */ + FAN1_FRONT_SPEED_RPM, + FAN2_FRONT_SPEED_RPM, + FAN3_FRONT_SPEED_RPM, + FAN4_FRONT_SPEED_RPM, + FAN5_FRONT_SPEED_RPM, + FAN1_REAR_SPEED_RPM, + FAN2_REAR_SPEED_RPM, + FAN3_REAR_SPEED_RPM, + FAN4_REAR_SPEED_RPM, + FAN5_REAR_SPEED_RPM, + FAN1_DIRECTION, + FAN2_DIRECTION, + FAN3_DIRECTION, + FAN4_DIRECTION, + FAN5_DIRECTION, + FAN1_PRESENT, + FAN2_PRESENT, + FAN3_PRESENT, + FAN4_PRESENT, + FAN5_PRESENT, + FAN1_FAULT, + FAN2_FAULT, + FAN3_FAULT, + FAN4_FAULT, + FAN5_FAULT, + FAN_MAX_RPM, + CPLD_VERSION +}; + +/* Define attributes + */ +#define DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(index, index2) \ + static SENSOR_DEVICE_ATTR(fan##index##_fault, S_IRUGO, fan_show_value, NULL, FAN##index##_FAULT);\ + static SENSOR_DEVICE_ATTR(fan##index2##_fault, S_IRUGO, fan_show_value, NULL, FAN##index##_FAULT) +#define DECLARE_FAN_FAULT_ATTR(index, index2) &sensor_dev_attr_fan##index##_fault.dev_attr.attr, \ + &sensor_dev_attr_fan##index2##_fault.dev_attr.attr +#define DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_direction, S_IRUGO, fan_show_value, NULL, FAN##index##_DIRECTION) +#define DECLARE_FAN_DIRECTION_ATTR(index) &sensor_dev_attr_fan##index##_direction.dev_attr.attr + +#define DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_duty_cycle_percentage, S_IWUSR | S_IRUGO, fan_show_value, set_duty_cycle, FAN##index##_DUTY_CYCLE_PERCENTAGE) +#define DECLARE_FAN_DUTY_CYCLE_ATTR(index) &sensor_dev_attr_fan##index##_duty_cycle_percentage.dev_attr.attr + +#define DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_present, S_IRUGO, fan_show_value, NULL, FAN##index##_PRESENT) +#define DECLARE_FAN_PRESENT_ATTR(index) &sensor_dev_attr_fan##index##_present.dev_attr.attr + +#define DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(index, index2) \ + static SENSOR_DEVICE_ATTR(fan##index##_front_speed_rpm, S_IRUGO, fan_show_value, NULL, FAN##index##_FRONT_SPEED_RPM);\ + static SENSOR_DEVICE_ATTR(fan##index##_rear_speed_rpm, S_IRUGO, fan_show_value, NULL, FAN##index##_REAR_SPEED_RPM);\ + static SENSOR_DEVICE_ATTR(fan##index##_input, S_IRUGO, fan_show_value, NULL, FAN##index##_FRONT_SPEED_RPM);\ + static SENSOR_DEVICE_ATTR(fan##index2##_input, S_IRUGO, fan_show_value, NULL, FAN##index##_REAR_SPEED_RPM) +#define DECLARE_FAN_SPEED_RPM_ATTR(index, index2) &sensor_dev_attr_fan##index##_front_speed_rpm.dev_attr.attr, \ + &sensor_dev_attr_fan##index##_rear_speed_rpm.dev_attr.attr, \ + &sensor_dev_attr_fan##index##_input.dev_attr.attr, \ + &sensor_dev_attr_fan##index2##_input.dev_attr.attr + +static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, CPLD_VERSION); +static SENSOR_DEVICE_ATTR(fan_max_speed_rpm, S_IRUGO, fan_show_value, NULL, FAN_MAX_RPM); +#define DECLARE_FAN_MAX_RPM_ATTR(index) &sensor_dev_attr_fan_max_speed_rpm.dev_attr.attr + + +/* 5 fan fault attributes in this platform */ +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(1, 11); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(2, 12); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(3, 13); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(4, 14); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(5, 15); +/* 5 fan speed(rpm) attributes in this platform */ +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(1, 11); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(2, 12); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(3, 13); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(4, 14); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(5, 15); +/* 5 fan present attributes in this platform */ +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(1); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(2); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(3); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(4); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(5); +/* 5 fan direction attribute in this platform */ +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(1); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(2); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(3); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(4); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(5); +/* 1 fan duty cycle attribute in this platform */ +DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR(); + +static struct attribute *as5835_54x_fan_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + /* fan related attributes */ + DECLARE_FAN_FAULT_ATTR(1, 11), + DECLARE_FAN_FAULT_ATTR(2, 12), + DECLARE_FAN_FAULT_ATTR(3, 13), + DECLARE_FAN_FAULT_ATTR(4, 14), + DECLARE_FAN_FAULT_ATTR(5, 15), + DECLARE_FAN_SPEED_RPM_ATTR(1, 11), + DECLARE_FAN_SPEED_RPM_ATTR(2, 12), + DECLARE_FAN_SPEED_RPM_ATTR(3, 13), + DECLARE_FAN_SPEED_RPM_ATTR(4, 14), + DECLARE_FAN_SPEED_RPM_ATTR(5, 15), + DECLARE_FAN_PRESENT_ATTR(1), + DECLARE_FAN_PRESENT_ATTR(2), + DECLARE_FAN_PRESENT_ATTR(3), + DECLARE_FAN_PRESENT_ATTR(4), + DECLARE_FAN_PRESENT_ATTR(5), + DECLARE_FAN_DIRECTION_ATTR(1), + DECLARE_FAN_DIRECTION_ATTR(2), + DECLARE_FAN_DIRECTION_ATTR(3), + DECLARE_FAN_DIRECTION_ATTR(4), + DECLARE_FAN_DIRECTION_ATTR(5), + DECLARE_FAN_DUTY_CYCLE_ATTR(), + DECLARE_FAN_MAX_RPM_ATTR(), + NULL +}; + +#define FAN_DUTY_CYCLE_REG_MASK 0x1F +#define FAN_MAX_DUTY_CYCLE 100 +#define FAN_REG_VAL_TO_SPEED_RPM_STEP 150 + +static int as5835_54x_fan_read_value(struct i2c_client *client, u8 reg) +{ + return i2c_smbus_read_byte_data(client, reg); +} + +static int as5835_54x_fan_write_value(struct i2c_client *client, u8 reg, u8 value) +{ + return i2c_smbus_write_byte_data(client, reg, value); +} + +/* fan utility functions + */ +static u32 reg_val_to_duty_cycle(u8 reg_val) +{ + return (reg_val & FAN_DUTY_CYCLE_REG_MASK) * 5; +} + +static u8 duty_cycle_to_reg_val(u8 duty_cycle) +{ + if (duty_cycle > FAN_MAX_DUTY_CYCLE) { + duty_cycle = FAN_MAX_DUTY_CYCLE; + } + + return (duty_cycle / 5); +} + +static u32 reg_val_to_speed_rpm(u8 reg_val) +{ + return (u32)reg_val * FAN_REG_VAL_TO_SPEED_RPM_STEP; +} + +static u8 reg_val_to_direction(u8 reg_val, enum fan_id id) +{ + return !!(reg_val & BIT(id)); /* 0: Front to Back, 1: Back to Front*/ +} + +static u8 reg_val_to_is_present(u8 reg_val, enum fan_id id) +{ + return !(reg_val & BIT(id)); +} + +static u8 is_fan_fault(struct as5835_54x_fan_data *data, enum fan_id id) +{ + if ((data->reg_val[FAN_FRONT_FAULT_REG] & BIT(id)) || + (data->reg_val[FAN_REAR_FAULT_REG] & BIT(id))) { + return 1; + } + + return 0; +} + +static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int error, value; + struct i2c_client *client = to_i2c_client(dev); + + error = kstrtoint(buf, 10, &value); + if (error) { + return error; + } + + if (value < 0 || value > FAN_MAX_DUTY_CYCLE) { + return -EINVAL; + } + + as5835_54x_fan_write_value(client, fan_reg[FAN_DUTY_CYCLE_PERCENTAGE], duty_cycle_to_reg_val(value)); + return count; +} + +static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as5835_54x_fan_data *data = as5835_54x_fan_update_device(dev); + ssize_t ret = 0; + + if (data->valid) { + switch (attr->index) { + case FAN_DUTY_CYCLE_PERCENTAGE: + { + u32 duty_cycle = reg_val_to_duty_cycle(data->reg_val[FAN_DUTY_CYCLE_PERCENTAGE]); + ret = sprintf(buf, "%u\n", duty_cycle); + break; + } + case FAN1_FRONT_SPEED_RPM: + case FAN2_FRONT_SPEED_RPM: + case FAN3_FRONT_SPEED_RPM: + case FAN4_FRONT_SPEED_RPM: + case FAN5_FRONT_SPEED_RPM: + case FAN1_REAR_SPEED_RPM: + case FAN2_REAR_SPEED_RPM: + case FAN3_REAR_SPEED_RPM: + case FAN4_REAR_SPEED_RPM: + case FAN5_REAR_SPEED_RPM: + ret = sprintf(buf, "%u\n", reg_val_to_speed_rpm(data->reg_val[attr->index])); + break; + case FAN1_PRESENT: + case FAN2_PRESENT: + case FAN3_PRESENT: + case FAN4_PRESENT: + case FAN5_PRESENT: + ret = sprintf(buf, "%d\n", + reg_val_to_is_present(data->reg_val[FAN_PRESENT_REG], + attr->index - FAN1_PRESENT)); + break; + case FAN1_FAULT: + case FAN2_FAULT: + case FAN3_FAULT: + case FAN4_FAULT: + case FAN5_FAULT: + ret = sprintf(buf, "%d\n", is_fan_fault(data, attr->index - FAN1_FAULT)); + break; + case FAN1_DIRECTION: + case FAN2_DIRECTION: + case FAN3_DIRECTION: + case FAN4_DIRECTION: + case FAN5_DIRECTION: + ret = sprintf(buf, "%d\n", + reg_val_to_direction(data->reg_val[FAN_DIRECTION_REG], + attr->index - FAN1_DIRECTION)); + break; + case FAN_MAX_RPM: + ret = sprintf(buf, "%d\n", MAX_FAN_SPEED_RPM); + default: + break; + } + } + + return ret; +} + +static const struct attribute_group as5835_54x_fan_group = { + .attrs = as5835_54x_fan_attributes, +}; + +static struct as5835_54x_fan_data *as5835_54x_fan_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_fan_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) || + !data->valid) { + int i; + + dev_dbg(&client->dev, "Starting as5835_54x_fan update\n"); + data->valid = 0; + + /* Update fan data + */ + for (i = 0; i < ARRAY_SIZE(data->reg_val); i++) { + int status = as5835_54x_fan_read_value(client, fan_reg[i]); + + if (status < 0) { + data->valid = 0; + mutex_unlock(&data->update_lock); + dev_dbg(&client->dev, "reg %d, err %d\n", fan_reg[i], status); + return data; + } + else { + data->reg_val[i] = status; + } + } + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +static ssize_t show_version(struct device *dev, struct device_attribute *attr, char *buf) +{ + int val = 0; + struct i2c_client *client = to_i2c_client(dev); + + val = i2c_smbus_read_byte_data(client, 0x1); + + if (val < 0) { + dev_dbg(&client->dev, "cpld(0x%x) reg(0x1) err %d\n", client->addr, val); + } + + return sprintf(buf, "%d\n", val); +} + +static int as5835_54x_fan_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + struct as5835_54x_fan_data *data; + int status; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { + status = -EIO; + goto exit; + } + + data = kzalloc(sizeof(struct as5835_54x_fan_data), GFP_KERNEL); + if (!data) { + status = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + data->valid = 0; + mutex_init(&data->update_lock); + + dev_info(&client->dev, "chip found\n"); + + /* Register sysfs hooks */ + status = sysfs_create_group(&client->dev.kobj, &as5835_54x_fan_group); + if (status) { + goto exit_free; + } + + data->hwmon_dev = hwmon_device_register_with_info(&client->dev, "as5835_54x_fan", + NULL, NULL, NULL); + if (IS_ERR(data->hwmon_dev)) { + status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + + dev_info(&client->dev, "%s: fan '%s'\n", + dev_name(data->hwmon_dev), client->name); + return 0; + +exit_remove: + sysfs_remove_group(&client->dev.kobj, &as5835_54x_fan_group); +exit_free: + kfree(data); +exit: + + return status; +} + +static int as5835_54x_fan_remove(struct i2c_client *client) +{ + struct as5835_54x_fan_data *data = i2c_get_clientdata(client); + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &as5835_54x_fan_group); + + return 0; +} + +/* Addresses to scan */ +static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; + +static const struct i2c_device_id as5835_54x_fan_id[] = { + { "as5835_54x_fan", 0 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, as5835_54x_fan_id); + +static struct i2c_driver as5835_54x_fan_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = DRVNAME, + }, + .probe = as5835_54x_fan_probe, + .remove = as5835_54x_fan_remove, + .id_table = as5835_54x_fan_id, + .address_list = normal_i2c, +}; + +module_i2c_driver(as5835_54x_fan_driver); + +MODULE_AUTHOR("Brandon Chuang "); +MODULE_DESCRIPTION("as5835_54x_fan driver"); +MODULE_LICENSE("GPL"); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_leds.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_leds.c new file mode 100644 index 0000000000..3b9dce6a4c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_leds.c @@ -0,0 +1,380 @@ +/* + * A LED driver for the accton_as5822_54x_led + * + * Copyright (C) 2016 Accton Technology Corporation. + * Brandon Chuang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "as5835_54x_led" + +#define DEBUG_MODE 0 + +#if (DEBUG_MODE == 1) + #define DEBUG_PRINT(fmt, args...) \ + printk (KERN_INFO "%s:%s[%d]: " fmt "\r\n", __FILE__, __FUNCTION__, __LINE__, ##args) +#else + #define DEBUG_PRINT(fmt, args...) +#endif + +extern int as5835_54x_cpld_read(unsigned short cpld_addr, u8 reg); +extern int as5835_54x_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); + +struct accton_as5835_54x_led_data { + struct platform_device *pdev; + struct mutex update_lock; + char valid; /* != 0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 reg_val[2]; /* Register value, 0 = RELEASE/DIAG LED, + 1 = FAN/PSU LED, + 2 ~ 4 = SYSTEM LED */ +}; + +static struct accton_as5835_54x_led_data *ledctl = NULL; + +#define LED_CNTRLER_I2C_ADDRESS (0x60) + +#define LED_TYPE_DIAG_REG_MASK (0x0C) +#define LED_MODE_DIAG_GREEN_VALUE (0x08) +#define LED_MODE_DIAG_AMBER_VALUE (0x04) +#define LED_MODE_DIAG_OFF_VALUE (0x0C) +#define LED_MODE_DIAG_AMBER_VALUE1 (0x00) + +#define LED_TYPE_LOC_REG_MASK (0x30) +#define LED_MODE_LOC_AMBER_BLINK_VALUE (0x20) +#define LED_MODE_LOC_OFF_VALUE (0x10) +#define LED_MODE_LOC_AMBER_VALUE (0x00) + +static const u8 led_reg[] = { + 0xA, /* LOC/DIAG/FAN LED */ + 0xB, /* PSU LED */ +}; + +enum led_type { + LED_TYPE_DIAG, + LED_TYPE_LOC, + LED_TYPE_FAN, + LED_TYPE_PSU1, + LED_TYPE_PSU2 +}; + +/* FAN/PSU/DIAG/RELEASE led mode */ +enum led_light_mode { + LED_MODE_OFF = 0, + LED_MODE_GREEN, + LED_MODE_GREEN_BLINK, + LED_MODE_AMBER, + LED_MODE_AMBER_BLINK, + LED_MODE_RED, + LED_MODE_RED_BLINK, + LED_MODE_BLUE, + LED_MODE_BLUE_BLINK, + LED_MODE_AUTO, + LED_MODE_UNKNOWN +}; + +struct led_type_mode { + enum led_type type; + enum led_light_mode mode; + int type_mask; + int mode_value; +}; + +static struct led_type_mode led_type_mode_data[] = { +{LED_TYPE_LOC, LED_MODE_OFF, LED_TYPE_LOC_REG_MASK, LED_MODE_LOC_OFF_VALUE}, +{LED_TYPE_LOC, LED_MODE_AMBER_BLINK, LED_TYPE_LOC_REG_MASK, LED_MODE_LOC_AMBER_BLINK_VALUE}, +{LED_TYPE_LOC, LED_MODE_AMBER, LED_TYPE_LOC_REG_MASK, LED_MODE_LOC_AMBER_VALUE}, +{LED_TYPE_DIAG, LED_MODE_OFF, LED_TYPE_DIAG_REG_MASK, LED_MODE_DIAG_OFF_VALUE}, +{LED_TYPE_DIAG, LED_MODE_GREEN, LED_TYPE_DIAG_REG_MASK, LED_MODE_DIAG_GREEN_VALUE}, +{LED_TYPE_DIAG, LED_MODE_AMBER, LED_TYPE_DIAG_REG_MASK, LED_MODE_DIAG_AMBER_VALUE}, +{LED_TYPE_DIAG, LED_MODE_AMBER, LED_TYPE_DIAG_REG_MASK, LED_MODE_DIAG_AMBER_VALUE1}, +}; + +static int led_reg_val_to_light_mode(enum led_type type, u8 reg_val) { + int i; + + for (i = 0; i < ARRAY_SIZE(led_type_mode_data); i++) { + if (type != led_type_mode_data[i].type) { + continue; + } + + if ((led_type_mode_data[i].type_mask & reg_val) == + led_type_mode_data[i].mode_value) { + return led_type_mode_data[i].mode; + } + } + + return LED_MODE_UNKNOWN; +} + +static u8 led_light_mode_to_reg_val(enum led_type type, + enum led_light_mode mode, u8 reg_val) { + int i; + + for (i = 0; i < ARRAY_SIZE(led_type_mode_data); i++) { + int type_mask, mode_value; + + if (type != led_type_mode_data[i].type) + continue; + + if (mode != led_type_mode_data[i].mode) + continue; + + type_mask = led_type_mode_data[i].type_mask; + mode_value = led_type_mode_data[i].mode_value; + reg_val = (reg_val & ~type_mask) | mode_value; + } + + return reg_val; +} + +static int accton_as5835_54x_led_read_value(u8 reg) +{ + return as5835_54x_cpld_read(LED_CNTRLER_I2C_ADDRESS, reg); +} + +static int accton_as5835_54x_led_write_value(u8 reg, u8 value) +{ + return as5835_54x_cpld_write(LED_CNTRLER_I2C_ADDRESS, reg, value); +} + +static void accton_as5835_54x_led_update(void) +{ + mutex_lock(&ledctl->update_lock); + + if (time_after(jiffies, ledctl->last_updated + HZ + HZ / 2) + || !ledctl->valid) { + int i; + + dev_dbg(&ledctl->pdev->dev, "Starting accton_as5835_54x_led update\n"); + ledctl->valid = 0; + + /* Update LED data + */ + for (i = 0; i < ARRAY_SIZE(ledctl->reg_val); i++) { + int status = accton_as5835_54x_led_read_value(led_reg[i]); + + if (status < 0) { + dev_dbg(&ledctl->pdev->dev, "reg %d, err %d\n", led_reg[i], status); + goto exit; + } + else + ledctl->reg_val[i] = status; + } + + ledctl->last_updated = jiffies; + ledctl->valid = 1; + } + +exit: + mutex_unlock(&ledctl->update_lock); +} + +static void accton_as5835_54x_led_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode, + u8 reg, enum led_type type) +{ + int reg_val; + + mutex_lock(&ledctl->update_lock); + reg_val = accton_as5835_54x_led_read_value(reg); + + if (reg_val < 0) { + dev_dbg(&ledctl->pdev->dev, "reg %d, err %d\n", reg, reg_val); + goto exit; + } + + reg_val = led_light_mode_to_reg_val(type, led_light_mode, reg_val); + accton_as5835_54x_led_write_value(reg, reg_val); + ledctl->valid = 0; + +exit: + mutex_unlock(&ledctl->update_lock); +} + +static void accton_as7312_54x_led_auto_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ +} + +static enum led_brightness accton_as7312_54x_led_auto_get(struct led_classdev *cdev) +{ + return LED_MODE_AUTO; +} + +static void accton_as5835_54x_led_diag_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as5835_54x_led_set(led_cdev, led_light_mode, led_reg[0], LED_TYPE_DIAG); +} + +static enum led_brightness accton_as5835_54x_led_diag_get(struct led_classdev *cdev) +{ + accton_as5835_54x_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_DIAG, ledctl->reg_val[0]); +} + +static enum led_brightness accton_as5835_54x_led_loc_get(struct led_classdev *cdev) +{ + accton_as5835_54x_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_LOC, ledctl->reg_val[0]); +} + +static void accton_as5835_54x_led_loc_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as5835_54x_led_set(led_cdev, led_light_mode, led_reg[0], LED_TYPE_LOC); +} + +static struct led_classdev accton_as5835_54x_leds[] = { + [LED_TYPE_LOC] = { + .name = "as5835_54x_led::loc", + .default_trigger = "unused", + .brightness_set = accton_as5835_54x_led_loc_set, + .brightness_get = accton_as5835_54x_led_loc_get, + .max_brightness = LED_MODE_AMBER_BLINK, + }, + [LED_TYPE_DIAG] = { + .name = "as5835_54x_led::diag", + .default_trigger = "unused", + .brightness_set = accton_as5835_54x_led_diag_set, + .brightness_get = accton_as5835_54x_led_diag_get, + .max_brightness = LED_MODE_AMBER, + }, + [LED_TYPE_PSU1] = { + .name = "as5835_54x_led::psu1", + .default_trigger = "unused", + .brightness_set = accton_as7312_54x_led_auto_set, + .brightness_get = accton_as7312_54x_led_auto_get, + .max_brightness = LED_MODE_AUTO, + }, + [LED_TYPE_PSU2] = { + .name = "as5835_54x_led::psu2", + .default_trigger = "unused", + .brightness_set = accton_as7312_54x_led_auto_set, + .brightness_get = accton_as7312_54x_led_auto_get, + .max_brightness = LED_MODE_AUTO, + }, + [LED_TYPE_FAN] = { + .name = "as5835_54x_led::fan", + .default_trigger = "unused", + .brightness_set = accton_as7312_54x_led_auto_set, + .brightness_get = accton_as7312_54x_led_auto_get, + .max_brightness = LED_MODE_AUTO, + }, +}; + +static int accton_as5835_54x_led_probe(struct platform_device *pdev) +{ + int ret, i; + + for (i = 0; i < ARRAY_SIZE(accton_as5835_54x_leds); i++) { + ret = led_classdev_register(&pdev->dev, &accton_as5835_54x_leds[i]); + + if (ret < 0) { + break; + } + } + + /* Check if all LEDs were successfully registered */ + if (i != ARRAY_SIZE(accton_as5835_54x_leds)){ + int j; + + /* only unregister the LEDs that were successfully registered */ + for (j = 0; j < i; j++) { + led_classdev_unregister(&accton_as5835_54x_leds[i]); + } + } + + return ret; +} + +static int accton_as5835_54x_led_remove(struct platform_device *pdev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(accton_as5835_54x_leds); i++) { + led_classdev_unregister(&accton_as5835_54x_leds[i]); + } + + return 0; +} + +static struct platform_driver accton_as5835_54x_led_driver = { + .probe = accton_as5835_54x_led_probe, + .remove = accton_as5835_54x_led_remove, + .driver = { + .name = DRVNAME, + .owner = THIS_MODULE, + }, +}; + +static int __init accton_as5835_54x_led_init(void) +{ + int ret; + + ret = platform_driver_register(&accton_as5835_54x_led_driver); + if (ret < 0) { + goto exit; + } + + ledctl = kzalloc(sizeof(struct accton_as5835_54x_led_data), GFP_KERNEL); + if (!ledctl) { + ret = -ENOMEM; + goto exit_driver; + } + + mutex_init(&ledctl->update_lock); + + ledctl->pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + if (IS_ERR(ledctl->pdev)) { + ret = PTR_ERR(ledctl->pdev); + goto exit_free; + } + + return 0; + +exit_free: + kfree(ledctl); +exit_driver: + platform_driver_unregister(&accton_as5835_54x_led_driver); +exit: + return ret; +} + +static void __exit accton_as5835_54x_led_exit(void) +{ + platform_device_unregister(ledctl->pdev); + platform_driver_unregister(&accton_as5835_54x_led_driver); + kfree(ledctl); +} + +late_initcall(accton_as5835_54x_led_init); +module_exit(accton_as5835_54x_led_exit); + +MODULE_AUTHOR("Brandon Chuang "); +MODULE_DESCRIPTION("accton_as5835_54x_led driver"); +MODULE_LICENSE("GPL"); + + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_psu.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_psu.c new file mode 100644 index 0000000000..00b43829e3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_psu.c @@ -0,0 +1,343 @@ +/* + * An hwmon driver for accton as5835_54x Power Module + * + * Copyright (C) 2014 Accton Technology Corporation. + * Brandon Chuang + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define PSU_STATUS_I2C_ADDR 0x60 +#define PSU_STATUS_I2C_REG_OFFSET 0x2 + +#define MODEL_NAME_LEN 8 +#define MODEL_NAME_REG_OFFSET 0x20 + +#define SERIAL_NUM_LEN 18 +#define SERIAL_NUM_REG_OFFSET 0x35 + +#define IS_POWER_GOOD(id, value) (!!(value & BIT(id*4 + 1))) +#define IS_PRESENT(id, value) (!(value & BIT(id*4))) + +static ssize_t show_status(struct device *dev, struct device_attribute *da, char *buf); +static ssize_t show_string(struct device *dev, struct device_attribute *da, char *buf); +extern int as5835_54x_cpld_read(unsigned short cpld_addr, u8 reg); + +/* Addresses scanned + */ +static const unsigned short normal_i2c[] = { I2C_CLIENT_END }; + +/* Each client has this additional data + */ +struct as5835_54x_psu_data { + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* !=0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 index; /* PSU index */ + u8 status; /* Status(present/power_good) register read from CPLD */ + char model_name[MODEL_NAME_LEN+1]; /* Model name, read from eeprom */ + char serial[SERIAL_NUM_LEN+1]; /* Serial number, read from eeprom*/ +}; + +static struct as5835_54x_psu_data *as5835_54x_psu_update_device(struct device *dev); + +enum as5835_54x_psu_sysfs_attributes { + PSU_PRESENT, + PSU_MODEL_NAME, + PSU_POWER_GOOD, + PSU_SERIAL_NUMBER +}; + +/* sysfs attributes for hwmon + */ +static SENSOR_DEVICE_ATTR(psu_present, S_IRUGO, show_status, NULL, PSU_PRESENT); +static SENSOR_DEVICE_ATTR(psu_model_name, S_IRUGO, show_string, NULL, PSU_MODEL_NAME); +static SENSOR_DEVICE_ATTR(psu_power_good, S_IRUGO, show_status, NULL, PSU_POWER_GOOD); +static SENSOR_DEVICE_ATTR(psu_serial_numer, S_IRUGO, show_string, NULL, PSU_SERIAL_NUMBER); + +static struct attribute *as5835_54x_psu_attributes[] = { + &sensor_dev_attr_psu_present.dev_attr.attr, + &sensor_dev_attr_psu_model_name.dev_attr.attr, + &sensor_dev_attr_psu_power_good.dev_attr.attr, + &sensor_dev_attr_psu_serial_numer.dev_attr.attr, + NULL +}; + +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as5835_54x_psu_data *data = as5835_54x_psu_update_device(dev); + u8 status = 0; + + if (!data->valid) { + return sprintf(buf, "0\n"); + } + + if (attr->index == PSU_PRESENT) { + status = IS_PRESENT(data->index, data->status); + } + else { /* PSU_POWER_GOOD */ + status = IS_POWER_GOOD(data->index, data->status); + } + + return sprintf(buf, "%d\n", status); +} + +static ssize_t show_string(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as5835_54x_psu_data *data = as5835_54x_psu_update_device(dev); + char *str = NULL; + + if (!data->valid) { + return 0; + } + + if (attr->index == PSU_MODEL_NAME) { + str = data->model_name; + } + else { /* PSU_SERIAL_NUBMER */ + str = data->serial; + } + + return sprintf(buf, "%s\n", str); +} + +static const struct attribute_group as5835_54x_psu_group = { + .attrs = as5835_54x_psu_attributes, +}; + +static int as5835_54x_psu_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + struct as5835_54x_psu_data *data; + int status; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) { + status = -EIO; + goto exit; + } + + data = kzalloc(sizeof(struct as5835_54x_psu_data), GFP_KERNEL); + if (!data) { + status = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + data->valid = 0; + data->index = dev_id->driver_data; + mutex_init(&data->update_lock); + + dev_info(&client->dev, "chip found\n"); + + /* Register sysfs hooks */ + status = sysfs_create_group(&client->dev.kobj, &as5835_54x_psu_group); + if (status) { + goto exit_free; + } + + data->hwmon_dev = hwmon_device_register_with_info(&client->dev, "as5835_54x_psu", + NULL, NULL, NULL); + if (IS_ERR(data->hwmon_dev)) { + status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + + dev_info(&client->dev, "%s: psu '%s'\n", + dev_name(data->hwmon_dev), client->name); + + return 0; + +exit_remove: + sysfs_remove_group(&client->dev.kobj, &as5835_54x_psu_group); +exit_free: + kfree(data); +exit: + + return status; +} + +static int as5835_54x_psu_remove(struct i2c_client *client) +{ + struct as5835_54x_psu_data *data = i2c_get_clientdata(client); + + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &as5835_54x_psu_group); + kfree(data); + + return 0; +} + +enum psu_index +{ + as5835_54x_psu1, + as5835_54x_psu2 +}; + +static const struct i2c_device_id as5835_54x_psu_id[] = { + { "as5835_54x_psu1", as5835_54x_psu1 }, + { "as5835_54x_psu2", as5835_54x_psu2 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, as5835_54x_psu_id); + +static struct i2c_driver as5835_54x_psu_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "as5835_54x_psu", + }, + .probe = as5835_54x_psu_probe, + .remove = as5835_54x_psu_remove, + .id_table = as5835_54x_psu_id, + .address_list = normal_i2c, +}; + +static int as5835_54x_psu_read_byte(struct i2c_client *client, u8 command, u8 *data) +{ + int status = 0; + int retry_count = 5; + + while (retry_count) { + status = i2c_smbus_read_byte_data(client, command); + if (unlikely(status < 0)) { + msleep(10); + retry_count--; + continue; + } + + break; + } + + if (unlikely(status < 0)) { + dev_dbg(&client->dev, "sfp read byte data failed, command(0x%2x), data(0x%2x)\r\n", command, status); + goto abort; + } + + *data = (u8)status; + +abort: + return status; +} + +static int as5835_54x_psu_read_bytes(struct i2c_client *client, u8 command, u8 *data, + int data_len) +{ + int ret = 0; + + while (data_len) { + ssize_t status; + + status = as5835_54x_psu_read_byte(client, command, data); + if (status <= 0) { + ret = status; + break; + } + + data += 1; + command += 1; + data_len -= 1; + } + + return ret; +} + +static struct as5835_54x_psu_data *as5835_54x_psu_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as5835_54x_psu_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) + || !data->valid) { + int status; + + dev_dbg(&client->dev, "Starting as5835_54x update\n"); + data->valid = 0; + + /* Read psu status */ + status = as5835_54x_cpld_read(PSU_STATUS_I2C_ADDR, PSU_STATUS_I2C_REG_OFFSET); + + if (status < 0) { + dev_dbg(&client->dev, "cpld reg (0x%x) err %d\n", PSU_STATUS_I2C_ADDR, status); + goto exit; + } + else { + data->status = status; + } + + + memset(data->model_name, 0, sizeof(data->model_name)); + memset(data->serial, 0, sizeof(data->serial)); + + if (IS_PRESENT(data->index, data->status)) { + /* Read model name */ + status = as5835_54x_psu_read_bytes(client, MODEL_NAME_REG_OFFSET, data->model_name, + ARRAY_SIZE(data->model_name)-1); + if (status < 0) { + data->model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x)\n", client->addr); + goto exit; + } + + /* Read serial number */ + status = as5835_54x_psu_read_bytes(client, SERIAL_NUM_REG_OFFSET, data->serial, + ARRAY_SIZE(data->serial)-1); + if (status < 0) { + data->serial[0] = '\0'; + dev_dbg(&client->dev, "unable to read serial number from (0x%x)\n", client->addr); + goto exit; + } + else { + data->serial[SERIAL_NUM_LEN] = '\0'; + } + } + + data->last_updated = jiffies; + data->valid = 1; + } + +exit: + mutex_unlock(&data->update_lock); + + return data; +} + +module_i2c_driver(as5835_54x_psu_driver); + +MODULE_AUTHOR("Brandon Chuang "); +MODULE_DESCRIPTION("as5835_54x_psu driver"); +MODULE_LICENSE("GPL"); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/ym2651y.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/ym2651y.c new file mode 120000 index 0000000000..f4d67640cc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/ym2651y.c @@ -0,0 +1 @@ +../../common/modules/ym2651y.c \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor-fan.service b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor-fan.service new file mode 100644 index 0000000000..3d7df4e48a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor-fan.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS5835-54X Platform Monitoring FAN service +Before=pmon.service +After=as5835-54x-platform-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as5835_54x_monitor_fan.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor-psu.service b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor-psu.service new file mode 100644 index 0000000000..2a9279cc4a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor-psu.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS5835-54X Platform Monitoring PSU service +Before=pmon.service +After=as5835-54x-platform-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as5835_54x_monitor_psu.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor.service new file mode 100644 index 0000000000..d522a0ca53 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/service/as5835-54x-platform-monitor.service @@ -0,0 +1,18 @@ +[Unit] +Description=Accton AS5835-54X Platform Monitoring service +Before=pmon.service +After=sysinit.target +DefaultDependencies=no + +[Service] +ExecStartPre=/usr/local/bin/accton_as5835_54x_util.py install +ExecStart=/usr/local/bin/accton_as5835_54x_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL +#StandardOutput=tty + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/setup.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/setup.py new file mode 100644 index 0000000000..af0320318e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/setup.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +import os +import sys +from setuptools import setup +os.listdir + +setup( + name='as5835_54x', + version='1.0', + description='Module to initialize Accton AS5835-54X platforms', + + packages=['as5835_54x'], + package_dir={'as5835_54x': 'as5835-54x/classes'}, +) + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/README b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/README new file mode 100644 index 0000000000..f75f8e008c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/README @@ -0,0 +1,74 @@ +Copyright (C) 2016 Accton Networks, Inc. + +This program is free software: you can redistribute it and/or modify +It under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Contents of this package: + module - Contains source code of as7326 kernel driver modules. + util - operational scripts. + +Sonic creates a docker container and run building process under it. +If user tries to built new drivers, please get into that docker and +dpkg-buildpackage for them. + +All Linux kernel code is licensed under the GPLv1. All other code is +licensed under the GPLv3. Please see the LICENSE file for copies of +both licenses. + +The code for integacting with Accton AS5835-54X has 2 parts, +kernel drivers and operational script. +The kernel drivers of peripherals are under module/ directory. +1. These drivers can be built to individual ko during dpkg-buildpackage. +2. A operational script, accton_as7326_util.py, for device initializatian. + Run "accton_as5835_54x_util.py install" to install drivers. + +To initialize the system, run "accton_as5835_54x_util.py install". +To clean up the drivers & devices, run "accton_as5835_54x_util.py clean". +To dump information of sensors, run "accton_as5835_54x_util.py show". +To dump SFP EEPROM, run "accton_as5835_54x_util.py sff". +To set fan speed, run "accton_as5835_54x_util.py set fan". +To enable/disable SFP emission, run "accton_as5835_54x_util.py set sfp". +To set system LEDs' color, run "accton_as5835_54x_util.py set led" +For more information, run "accton_as5835_54x_util.py --help". + +==================================================================== +Besides applying accton_as7326_util.py to access peripherals, you can +access peripherals by sysfs nodes directly after the installation is run. + +System LED: + There are 5 system LEDs at the lower-left corner of front panel. + They are loc, diag, fan, ps1, and ps2. + The sysfs interface color mappings are as follows: + Brightness: + 0 => off + 1 => green + 2 => green blinking + 3 => amber + 4 => amber blinking + But not all colors are available for each LED. + +Fan Control: + There are 10 fans inside 5 fan modules. + All fans share 1 duty setting, ranged from 0~100. + +Thermal sensers: + 4 temperature sensors are controlled by the lm75 kernel modules. + +PSUs: + There 2 power supplies slot at the left/right side of the back. + Once if a PSU is not plugged, the status of it is shown failed. + +There are 48 SFP+ and 6 QSFP modules are equipped. +Before operating on PSU and QSFP+, please make sure it is well plugged. +Otherwise, operation is going to fail. + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py new file mode 100755 index 0000000000..5789288546 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python +# +# Copyright (C) 2019 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 11/13/2017: Polly Hsu, Create +# 05/08/2019: Roy Lee, changed for as5812-54x. +# 05/29/2019: Brandon Chuang, changed for as5835-54x. +# ------------------------------------------------------------------ + +try: + import os + import sys, getopt + import subprocess + import click + import imp + import logging + import logging.config + import types + import time # this is only being used as part of the example + import traceback + import signal + from tabulate import tabulate + from as5835_54x.fanutil import FanUtil + from as5835_54x.thermalutil import ThermalUtil +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = 'accton_as5835_54x_monitor' +DUTY_MAX = 100 + +global log_file +global log_level + +# Make a class we can use to capture stdout and sterr in the log +class accton_as5835_54x_monitor(object): + # static temp var + _ori_temp = 0 + _new_perc = 0 + + def __init__(self, log_file, log_level): + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_fans(self): + FAN_LEV1_UP_TEMP = 57700 # temperature + FAN_LEV1_DOWN_TEMP = 0 # unused + FAN_LEV1_SPEED_PERC = DUTY_MAX # percentage*/ + + FAN_LEV2_UP_TEMP = 53000 + FAN_LEV2_DOWN_TEMP = 52700 + FAN_LEV2_SPEED_PERC = 80 + + FAN_LEV3_UP_TEMP = 49500 + FAN_LEV3_DOWN_TEMP = 47700 + FAN_LEV3_SPEED_PERC = 65 + + FAN_LEV4_UP_TEMP = 0 # unused + FAN_LEV4_DOWN_TEMP = 42700 + FAN_LEV4_SPEED_PERC = 40 + + + thermal = ThermalUtil() + fan = FanUtil() + + temp2 = thermal.get_thermal_2_val() + if temp2 is None: + return False + + temp3 = thermal.get_thermal_3_val() + if temp3 is None: + return False + + new_temp = (temp2 + temp3) / 2 + + for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1): + fan_stat = fan.get_fan_status(x) + if fan_stat is None: + return False + if fan_stat is False: + self._new_perc = FAN_LEV1_SPEED_PERC + logging.debug('INFO. SET new_perc to %d (FAN fault. fan_num:%d)', self._new_perc, x) + break + logging.debug('INFO. fan_stat is True (fan_num:%d)', x) + + if fan_stat is not None and fan_stat is not False: + diff = new_temp - self._ori_temp + if diff == 0: + logging.debug('INFO. RETURN. THERMAL temp not changed. %d / %d (new_temp / ori_temp)', new_temp, self._ori_temp) + return True + else: + if diff >= 0: + is_up = True + logging.debug('INFO. THERMAL temp UP %d / %d (new_temp / ori_temp)', new_temp, self._ori_temp) + else: + is_up = False + logging.debug('INFO. THERMAL temp DOWN %d / %d (new_temp / ori_temp)', new_temp, self._ori_temp) + + if is_up is True: + if new_temp >= FAN_LEV1_UP_TEMP: + self._new_perc = FAN_LEV1_SPEED_PERC + elif new_temp >= FAN_LEV2_UP_TEMP: + self._new_perc = FAN_LEV2_SPEED_PERC + elif new_temp >= FAN_LEV3_UP_TEMP: + self._new_perc = FAN_LEV3_SPEED_PERC + else: + self._new_perc = FAN_LEV4_SPEED_PERC + logging.debug('INFO. SET. FAN_SPEED as %d (new THERMAL temp:%d)', self._new_perc, new_temp) + else: + if new_temp <= FAN_LEV4_DOWN_TEMP: + self._new_perc = FAN_LEV4_SPEED_PERC + elif new_temp <= FAN_LEV3_DOWN_TEMP: + self._new_perc = FAN_LEV3_SPEED_PERC + elif new_temp <= FAN_LEV2_DOWN_TEMP: + self._new_perc = FAN_LEV2_SPEED_PERC + else: + self._new_perc = FAN_LEV1_SPEED_PERC + logging.debug('INFO. SET. FAN_SPEED as %d (new THERMAL temp:%d)', self._new_perc, new_temp) + + cur_perc = fan.get_fan_duty_cycle() + if cur_perc == self._new_perc: + logging.debug('INFO. RETURN. FAN speed not changed. %d / %d (new_perc / ori_perc)', self._new_perc, cur_perc) + return True + + set_stat = fan.set_fan_duty_cycle(self._new_perc) + if set_stat is True: + logging.debug('INFO: PASS. set_fan_duty_cycle (%d)', self._new_perc) + else: + logging.debug('INFO: FAIL. set_fan_duty_cycle (%d)', self._new_perc) + + logging.debug('INFO: GET. ori_perc is %d. ori_temp is %d', cur_perc, self._ori_temp) + self._ori_temp = new_temp + logging.debug('INFO: UPDATE. ori_perc to %d. ori_temp to %d', cur_perc, self._ori_temp) + + return True + +def handler(signum, frame): + fan = FanUtil() + logging.debug('INFO:Cause signal %d, set fan speed max.', signum) + fan.set_fan_duty_cycle(DUTY_MAX) + sys.exit(0) + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdl:',['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + + signal.signal(signal.SIGINT, handler) + signal.signal(signal.SIGTERM, handler) + monitor = accton_as5835_54x_monitor(log_file, log_level) + + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_fans() + time.sleep(10) + +if __name__ == '__main__': + main(sys.argv[1:]) \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor_fan.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor_fan.py new file mode 100755 index 0000000000..791c80a92b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor_fan.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 5/27/2019: Brandon_Chuang create +# ------------------------------------------------------------------ + +try: + import os + import sys, getopt + import subprocess + import click + import imp + import logging + import logging.config + import logging.handlers + import types + import time # this is only being used as part of the example + import traceback + from tabulate import tabulate + +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as5835_54x_monitor_fan' + +global log_file +global log_level + + +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + +fan_state=[2, 2, 2, 2, 2, 2] #init state=2, insert=1, remove=0 +fan_status_state=[2, 2, 2, 2, 2, 2] #init state=2, fault=1, normal=0 +# Make a class we can use to capture stdout and sterr in the log +class device_monitor(object): + + #/sys/bus/i2c/devices/3-0063 + #fan1_present, fan5_present + + def __init__(self, log_file, log_level): + + self.fan_num = 5 + self.fan_path = "/sys/bus/i2c/devices/3-0063/" + self.present = { + 0: "fan1_present", + 1: "fan2_present", + 2: "fan3_present", + 3: "fan4_present", + 4: "fan5_present", + } + + self.fault = { + 0: "fan1_fault", + 1: "fan2_fault", + 2: "fan3_fault", + 3: "fan4_fault", + 4: "fan5_fault", + } + + + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(logging.DEBUG) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address = '/dev/log') + #sys_handler.setLevel(logging.WARNING) + sys_handler.setLevel(logging.INFO) + logging.getLogger('').addHandler(sys_handler) + + + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_fan(self): + + FAN_STATE_REMOVE = 0 + FAN_STATE_INSERT = 1 + + FAN_STATUS_FAULT = 1 + FAN_STATUS_NORMAL = 0 + + global fan_state + global fan_status_state + + for idx in range (0, self.fan_num): + node = self.fan_path + self.present[idx] + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if fan_state[idx]!=1: + fan_state[idx]=FAN_STATE_INSERT + logging.info("FAN-%d present is detected", idx+1); + else: + if fan_state[idx]!=0: + fan_state[idx]=FAN_STATE_REMOVE + logging.warning("Alarm for FAN-%d absent is detected", idx+1) + + for idx in range (0, self.fan_num): + node = self.fan_path + self.fault[idx] + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if fan_status_state[idx]!=FAN_STATUS_FAULT: + if fan_state[idx] == FAN_STATE_INSERT: + logging.warning("Alarm for FAN-%d failed is detected", idx+1); + fan_status_state[idx]=FAN_STATUS_FAULT + else: + fan_status_state[idx]=FAN_STATUS_NORMAL + + return True + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdl:',['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + monitor = device_monitor(log_file, log_level) + while True: + monitor.manage_fan() + time.sleep(3) + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor_psu.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor_psu.py new file mode 100755 index 0000000000..d7bd1a1f25 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_monitor_psu.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 7/2/2018: Jostar create for as7326-56x +# ------------------------------------------------------------------ + +try: + import os + import sys, getopt + import subprocess + import click + import imp + import logging + import logging.config + import logging.handlers + import types + import time # this is only being used as part of the example + import traceback + from tabulate import tabulate +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as5835_54x_monitor_fan' + +global log_file +global log_level + + +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + +psu_state=[2, 2] +psu_power_status=[2, 2] +# Make a class we can use to capture stdout and sterr in the log +class device_monitor(object): + + def __init__(self, log_file, log_level): + + self.psu_num = 2 + self.psu_path = "/sys/bus/i2c/devices/" + self.presence = "/psu_present" + self.oper_status = "/psu_power_good" + self.mapping = { + 0: "11-0050", + 1: "12-0053", + } + + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + # set up logging to console + + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address = '/dev/log') + #sys_handler.setLevel(logging.WARNING) + sys_handler.setLevel(logging.INFO) + logging.getLogger('').addHandler(sys_handler) + + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_psu(self): + + PSU_STATE_REMOVE = 0 + PSU_STATE_INSERT = 1 + + PSU_STATUS_NO_POWER = 0 + PSU_STATUS_POWER_GOOD = 1 + + global psu_state + global psu_power_status + + for idx in range (0, self.psu_num): + node = self.psu_path + self.mapping[idx] + self.presence + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if psu_state[idx]!=PSU_STATE_INSERT: + psu_state[idx]=PSU_STATE_INSERT + logging.info("PSU-%d present is detected", idx+1); + #psu_power_status[idx]=PSU_STATUS_POWER_GOOD #when insert, assume power is good. If no_power, next code will find it. + else: + if psu_state[idx]!=PSU_STATE_REMOVE: + psu_state[idx]=PSU_STATE_REMOVE + logging.warning("Alarm for PSU-%d absent is detected", idx+1); + psu_power_status[idx]=PSU_STATUS_NO_POWER + + for idx in range (0, self.psu_num): + node = self.psu_path + self.mapping[idx] + self.oper_status + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + #logging.info("content=%s, psu_power_status[%d]=%d", content, idx, psu_power_status[idx]); + if content == "0": + if psu_power_status[idx]!=PSU_STATUS_NO_POWER: + if psu_state[idx]==PSU_STATE_INSERT: + logging.warning("Alarm for PSU-%d fault is detected", idx+1); + psu_power_status[idx]=PSU_STATUS_NO_POWER + else: + if psu_power_status[idx] !=PSU_STATUS_POWER_GOOD: + logging.info("PSU-%d power_good is detected", idx+1); + psu_power_status[idx]=PSU_STATUS_POWER_GOOD + + + return True + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdl:',['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + monitor = device_monitor(log_file, log_level) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_psu() + time.sleep(3) + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py new file mode 100755 index 0000000000..fbe3866ad5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py @@ -0,0 +1,592 @@ +#!/usr/bin/env python +# +# Copyright (C) 2019 Accton Networks, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +""" +Usage: %(scriptName)s [options] command object + +options: + -h | --help : this help message + -d | --debug : run with debug mode + -f | --force : ignore error during installation or clean +command: + install : install drivers and generate related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes + show : show all systen status + sff : dump SFP eeprom + set : change board setting with fan|led|sfp +""" + +import os +import commands +import sys, getopt +import logging +import re +import time +from collections import namedtuple + + + + +PROJECT_NAME = 'as5835_54x' +version = '0.1.0' +verbose = False +DEBUG = False +args = [] +ALL_DEVICE = {} +DEVICE_NO = {'led':5, 'fan':5,'thermal':4, 'psu':2, 'sfp':54} +FORCE = 0 +#logging.basicConfig(filename= PROJECT_NAME+'.log', filemode='w',level=logging.DEBUG) +#logging.basicConfig(level=logging.INFO) + + +if DEBUG == True: + print sys.argv[0] + print 'ARGV :', sys.argv[1:] + + +def main(): + global DEBUG + global args + global FORCE + + if len(sys.argv)<2: + show_help() + + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', + 'debug', + 'force', + ]) + if DEBUG == True: + print options + print args + print len(sys.argv) + + for opt, arg in options: + if opt in ('-h', '--help'): + show_help() + elif opt in ('-d', '--debug'): + DEBUG = True + logging.basicConfig(level=logging.INFO) + elif opt in ('-f', '--force'): + FORCE = 1 + else: + logging.info('no option') + for arg in args: + if arg == 'install': + do_install() + elif arg == 'clean': + do_uninstall() + elif arg == 'show': + device_traversal() + elif arg == 'sff': + if len(args)!=2: + show_eeprom_help() + elif int(args[1]) ==0 or int(args[1]) > DEVICE_NO['sfp']: + show_eeprom_help() + else: + show_eeprom(args[1]) + return + elif arg == 'set': + if len(args)<3: + show_set_help() + else: + set_device(args[1:]) + return + else: + show_help() + + + return 0 + +def show_help(): + print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} + sys.exit(0) + +def show_set_help(): + cmd = sys.argv[0].split("/")[-1]+ " " + args[0] + print cmd +" [led|sfp|fan]" + print " use \""+ cmd + " led 0-4 \" to set led color" + print " use \""+ cmd + " fan 0-100\" to set fan duty percetage" + print " use \""+ cmd + " sfp 1-54 {0|1}\" to set sfp# tx_disable" + sys.exit(0) + +def show_eeprom_help(): + cmd = sys.argv[0].split("/")[-1]+ " " + args[0] + print " use \""+ cmd + " 1-54 \" to dump sfp# eeprom" + sys.exit(0) + +def my_log(txt): + if DEBUG == True: + print "[Debug]"+txt + return + +def log_os_system(cmd, show): + logging.info('Run :'+cmd) + status, output = commands.getstatusoutput(cmd) + my_log (cmd +"with result:" + str(status)) + my_log (" output:"+output) + if status: + logging.info('Failed :'+cmd) + if show: + print('Failed :'+cmd) + return status, output + +def driver_check(): + ret, lsmod = log_os_system("lsmod| grep accton", 0) + logging.info('mods:'+lsmod) + if len(lsmod) ==0: + return False + return True + + + +kos = [ +'modprobe i2c_dev', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', +'modprobe accton_as5835_54x_cpld' , +'modprobe ym2651y' , +'modprobe accton_as5835_54x_fan' , +'modprobe optoe' , +'modprobe accton_as5835_54x_leds' , +'modprobe accton_as5835_54x_psu' ] + +def driver_install(): + global FORCE + status, output = log_os_system("depmod", 1) + for i in range(0,len(kos)): + status, output = log_os_system(kos[i], 1) + if status: + if FORCE == 0: + return status + return 0 + +def driver_uninstall(): + global FORCE + for i in range(0,len(kos)): + rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + rm = rm.replace("insmod", "rmmod") + lst = rm.split(" ") + if len(lst) > 3: + del(lst[3]) + rm = " ".join(lst) + status, output = log_os_system(rm, 1) + if status: + if FORCE == 0: + return status + return 0 + +led_prefix ='/sys/class/leds/accton_'+PROJECT_NAME+'_led::' +hwmon_types = {'led': ['diag','fan','loc','psu1','psu2']} +hwmon_nodes = {'led': ['brightness'] } +hwmon_prefix ={'led': led_prefix} + +i2c_prefix = '/sys/bus/i2c/devices/' +i2c_bus = {'fan': ['3-0063'] , + 'thermal': ['18-004b','19-004c', '20-0049', '21-004a'] , + 'psu': ['11-0050','12-0053'], + 'sfp': ['-0050']} +i2c_nodes = {'fan': ['present', 'front_speed_rpm', 'rear_speed_rpm'] , + 'thermal': ['hwmon/hwmon*/temp1_input'] , + 'psu': ['psu_present ', 'psu_power_good'] , + 'sfp': ['module_present_', 'module_tx_disable_']} + +sfp_map = [42,43,44,45,46,47,48,49,50,51, + 52,53,54,55,56,57,58,59,60,61, + 62,63,64,65,66,67,68,69,70,71, + 72,73,74,75,76,77,78,79,80,81, + 82,83,84,85,86,87,88,89,28,29, + 26,30,31,27] + +qsfp_start = 48 + +mknod =[ +'echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-1/new_device', +'echo pca9548 0x70 > /sys/bus/i2c/devices/i2c-2/new_device' , +'echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-2/new_device' , +'echo pca9548 0x72 > /sys/bus/i2c/devices/i2c-2/new_device' , +'echo pca9548 0x70 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-34/new_device', +'echo pca9548 0x72 > /sys/bus/i2c/devices/i2c-35/new_device', +'echo pca9548 0x73 > /sys/bus/i2c/devices/i2c-36/new_device', +'echo pca9548 0x74 > /sys/bus/i2c/devices/i2c-37/new_device', +'echo pca9548 0x75 > /sys/bus/i2c/devices/i2c-38/new_device', +'echo pca9548 0x76 > /sys/bus/i2c/devices/i2c-39/new_device', +'echo 24c02 0x57 > /sys/bus/i2c/devices/i2c-1/new_device', + +'echo as5835_54x_fan 0x63 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo lm75 0x4b > /sys/bus/i2c/devices/i2c-18/new_device', +'echo lm75 0x4c > /sys/bus/i2c/devices/i2c-19/new_device', +'echo lm75 0x49 > /sys/bus/i2c/devices/i2c-20/new_device', +'echo lm75 0x4a > /sys/bus/i2c/devices/i2c-21/new_device', +'echo as5835_54x_psu1 0x50 > /sys/bus/i2c/devices/i2c-11/new_device', +'echo ym2401 0x58 > /sys/bus/i2c/devices/i2c-11/new_device', +'echo as5835_54x_psu2 0x53 > /sys/bus/i2c/devices/i2c-12/new_device', +'echo ym2401 0x5b > /sys/bus/i2c/devices/i2c-12/new_device', +'echo as5835_54x_cpld1 0x60 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo as5835_54x_cpld2 0x61 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo as5835_54x_cpld3 0x62 > /sys/bus/i2c/devices/i2c-3/new_device'] + +mknod2 =[ +'echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-0/new_device', +'echo pca9548 0x70 > /sys/bus/i2c/devices/i2c-2/new_device' , +'echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-2/new_device' , +'echo pca9548 0x72 > /sys/bus/i2c/devices/i2c-2/new_device' , +'echo pca9548 0x70 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-34/new_device', +'echo pca9548 0x72 > /sys/bus/i2c/devices/i2c-35/new_device', +'echo pca9548 0x73 > /sys/bus/i2c/devices/i2c-36/new_device', +'echo pca9548 0x74 > /sys/bus/i2c/devices/i2c-37/new_device', +'echo pca9548 0x75 > /sys/bus/i2c/devices/i2c-38/new_device', +'echo pca9548 0x76 > /sys/bus/i2c/devices/i2c-39/new_device', +'echo 24c02 0x57 > /sys/bus/i2c/devices/i2c-0/new_device', + +'echo as5835_54x_fan 0x63 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo lm75 0x4b > /sys/bus/i2c/devices/i2c-18/new_device', +'echo lm75 0x4c > /sys/bus/i2c/devices/i2c-19/new_device', +'echo lm75 0x49 > /sys/bus/i2c/devices/i2c-20/new_device', +'echo lm75 0x4a > /sys/bus/i2c/devices/i2c-21/new_device', +'echo as5835_54x_psu1 0x50 > /sys/bus/i2c/devices/i2c-11/new_device', +'echo ym2401 0x58 > /sys/bus/i2c/devices/i2c-11/new_device', +'echo as5835_54x_psu2 0x53 > /sys/bus/i2c/devices/i2c-12/new_device', +'echo ym2401 0x5b > /sys/bus/i2c/devices/i2c-12/new_device', +'echo as5835_54x_cpld1 0x60 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo as5835_54x_cpld2 0x61 > /sys/bus/i2c/devices/i2c-3/new_device', +'echo as5835_54x_cpld3 0x62 > /sys/bus/i2c/devices/i2c-3/new_device'] + + +def i2c_order_check(): + # i2c bus 0 and 1 might be installed in different order. + # Here check if 0x77 is exist @ i2c-1 + tmp = "echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-1/new_device" + status, output = log_os_system(tmp, 0) + if not device_exist(): + order = 1 + else: + order = 0 + tmp = "echo 0x77 > /sys/bus/i2c/devices/i2c-1/delete_device" + status, output = log_os_system(tmp, 0) + return order + +def device_install(): + global FORCE + + order = i2c_order_check() + + # if 0x77 is not exist @i2c-1, use reversed bus order + if order: + for i in range(0,len(mknod2)): + #for pca954x need times to built new i2c buses + if mknod2[i].find('pca954') != -1: + time.sleep(1) + + status, output = log_os_system(mknod2[i], 1) + time.sleep(0.01) + if status: + print output + if FORCE == 0: + return status + else: + for i in range(0,len(mknod)): + #for pca954x need times to built new i2c buses + if mknod[i].find('pca954') != -1: + time.sleep(1) + + status, output = log_os_system(mknod[i], 1) + if status: + print output + if FORCE == 0: + return status + for i in range(0,len(sfp_map)): + if i < qsfp_start: + status, output =log_os_system("echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device", 1) + else: + status, output =log_os_system("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device", 1) + if status: + print output + if FORCE == 0: + return status + return + +def device_uninstall(): + global FORCE + + status, output =log_os_system("ls /sys/bus/i2c/devices/0-0077", 0) + if status==0: + I2C_ORDER=1 + else: + I2C_ORDER=0 + + for i in range(0,len(sfp_map)): + target = "/sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/delete_device" + status, output =log_os_system("echo 0x50 > "+ target, 1) + if status: + print output + if FORCE == 0: + return status + + if I2C_ORDER==0: + nodelist = mknod + else: + nodelist = mknod2 + + for i in range(len(nodelist)): + target = nodelist[-(i+1)] + temp = target.split() + del temp[1] + temp[-1] = temp[-1].replace('new_device', 'delete_device') + status, output = log_os_system(" ".join(temp), 1) + if status: + print output + if FORCE == 0: + return status + + return + +def system_ready(): + if driver_check() == False: + return False + if not device_exist(): + return False + return True + +def do_install(): + print "Checking system...." + if driver_check() == False: + print "No driver, installing...." + status = driver_install() + if status: + if FORCE == 0: + return status + else: + print PROJECT_NAME.upper()+" drivers detected...." + if not device_exist(): + print "No device, installing...." + status = device_install() + if status: + if FORCE == 0: + return status + else: + print PROJECT_NAME.upper()+" devices detected...." + return + +def do_uninstall(): + print "Checking system...." + if not device_exist(): + print PROJECT_NAME.upper() +" has no device installed...." + else: + print "Removing device...." + status = device_uninstall() + if status: + if FORCE == 0: + return status + + if driver_check()== False : + print PROJECT_NAME.upper() +" has no driver installed...." + else: + print "Removing installed driver...." + status = driver_uninstall() + if status: + if FORCE == 0: + return status + + return + +def devices_info(): + global DEVICE_NO + global ALL_DEVICE + global i2c_bus, hwmon_types + for key in DEVICE_NO: + ALL_DEVICE[key]= {} + for i in range(0,DEVICE_NO[key]): + ALL_DEVICE[key][key+str(i+1)] = [] + + for key in i2c_bus: + buses = i2c_bus[key] + nodes = i2c_nodes[key] + for i in range(0,len(buses)): + for j in range(0,len(nodes)): + if 'fan' == key: + for k in range(0,DEVICE_NO[key]): + node = key+str(k+1) + path = i2c_prefix+ buses[i]+"/fan"+str(k+1)+"_"+ nodes[j] + my_log(node+": "+ path) + ALL_DEVICE[key][node].append(path) + elif 'sfp' == key: + for k in range(0,DEVICE_NO[key]): + node = key+str(k+1) + path = i2c_prefix+ str(sfp_map[k])+ buses[i]+"/"+ nodes[j] + my_log(node+": "+ path) + ALL_DEVICE[key][node].append(path) + else: + node = key+str(i+1) + path = i2c_prefix+ buses[i]+"/"+ nodes[j] + my_log(node+": "+ path) + ALL_DEVICE[key][node].append(path) + + for key in hwmon_types: + itypes = hwmon_types[key] + nodes = hwmon_nodes[key] + for i in range(0,len(itypes)): + for j in range(0,len(nodes)): + node = key+"_"+itypes[i] + path = hwmon_prefix[key]+ itypes[i]+"/"+ nodes[j] + my_log(node+": "+ path) + ALL_DEVICE[key][ key+str(i+1)].append(path) + + #show dict all in the order + if DEBUG == True: + for i in sorted(ALL_DEVICE.keys()): + print(i+": ") + for j in sorted(ALL_DEVICE[i].keys()): + print(" "+j) + for k in (ALL_DEVICE[i][j]): + print(" "+" "+k) + return + +def show_eeprom(index): + if system_ready()==False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE)==0: + devices_info() + node = ALL_DEVICE['sfp'] ['sfp'+str(index)][0] + node = node.replace(node.split("/")[-1], 'sfp_eeprom') + # check if got hexdump command in current environment + ret, log = log_os_system("which hexdump", 0) + ret, log2 = log_os_system("which busybox hexdump", 0) + if len(log): + hex_cmd = 'hexdump' + elif len(log2): + hex_cmd = ' busybox hexdump' + else: + log = 'Failed : no hexdump cmd!!' + logging.info(log) + print log + return 1 + + print node + ":" + ret, log = log_os_system("cat "+node+"| "+hex_cmd+" -C", 1) + if ret==0: + print log + else: + print "**********device no found**********" + return + +def set_device(args): + global DEVICE_NO + global ALL_DEVICE + if system_ready()==False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE)==0: + devices_info() + + if args[0]=='led': + if int(args[1])>4: + show_set_help() + return + #print ALL_DEVICE['led'] + for i in range(0,len(ALL_DEVICE['led'])): + for k in (ALL_DEVICE['led']['led'+str(i+1)]): + ret, log = log_os_system("echo "+args[1]+" >"+k, 1) + if ret: + return ret + elif args[0]=='fan': + if int(args[1])>100: + show_set_help() + return + #print ALL_DEVICE['fan'] + #fan1~5 is all fine, all fan share same setting + node = ALL_DEVICE['fan'] ['fan1'][0] + node = node.replace(node.split("/")[-1], 'fan_duty_cycle_percentage') + ret, log = log_os_system("cat "+ node, 1) + if ret==0: + print ("Previous fan duty: " + log.strip() +"%") + ret, log = log_os_system("echo "+args[1]+" >"+node, 1) + if ret==0: + print ("Current fan duty: " + args[1] +"%") + return ret + elif args[0]=='sfp': + if int(args[1])> DEVICE_NO[args[0]] or int(args[1])==0: + show_set_help() + return + if len(args)<2: + show_set_help() + return + + if int(args[2])>1: + show_set_help() + return + + #print ALL_DEVICE[args[0]] + for i in range(0,len(ALL_DEVICE[args[0]])): + for j in ALL_DEVICE[args[0]][args[0]+str(args[1])]: + if j.find('tx_disable')!= -1: + ret, log = log_os_system("echo "+args[2]+" >"+ j, 1) + if ret: + return ret + + return + +#get digits inside a string. +#Ex: 31 for "sfp31" +def get_value(input): + digit = re.findall('\d+', input) + return int(digit[0]) + +def device_traversal(): + if system_ready()==False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE)==0: + devices_info() + for i in sorted(ALL_DEVICE.keys()): + print("============================================") + print(i.upper()+": ") + print("============================================") + + for j in sorted(ALL_DEVICE[i].keys(), key=get_value): + print " "+j+":", + for k in (ALL_DEVICE[i][j]): + ret, log = log_os_system("cat "+k, 0) + func = k.split("/")[-1].strip() + func = re.sub(j+'_','',func,1) + func = re.sub(i.lower()+'_','',func,1) + if ret==0: + print func+"="+log+" ", + else: + print func+"="+"X"+" ", + print + print("----------------------------------------------------------------") + + + print + return + +def device_exist(): + ret1, log = log_os_system("ls "+i2c_prefix+"*0077", 0) + ret2, log = log_os_system("ls "+i2c_prefix+"i2c-2", 0) + return not(ret1 or ret2) + +if __name__ == "__main__": + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py b/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py index a77841857e..48e957e312 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py @@ -260,7 +260,7 @@ def driver_inserted(): kos = [ 'depmod -ae', 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe optoe', 'modprobe accton_as6712_32x_cpld', 'modprobe cpr_4011_4mxx', @@ -281,7 +281,15 @@ def driver_install(): def driver_uninstall(): global FORCE for i in range(0,len(kos)): - rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + #remove parameter if any + rm = kos[-(i+1)] + lst = rm.split(" ") + if len(lst) > 2: + del(lst[2:]) + rm = " ".join(lst) + + #Change to removing commands + rm = rm.replace("modprobe", "modprobe -rq") rm = rm.replace("insmod", "rmmod") status, output = log_os_system(rm, 1) if status: diff --git a/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py b/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py index cd35b50d20..faf0dfc308 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py @@ -221,6 +221,29 @@ def show_set_help(): print " use \""+ cmd + " sfp 1-32 {0|1}\" to set sfp# tx_disable" sys.exit(0) +def diss_i2c_ir3507a(addr): + cmd = "i2cset -y 0 0x%x 0xE5 0x01" % addr + status, output = commands.getstatusoutput(cmd) + cmd = "i2cset -y 0 0x%x 0x12 0x02" % addr + status, output = commands.getstatusoutput(cmd) + return status + +def ir3507_check(): + cmd = "i2cdump -y 0 0x42 s 0x9a" + try: + status, output = commands.getstatusoutput(cmd) + lines = output.split('\n') + hn = re.findall(r'\w+', lines[-1]) + version = int(hn[1], 16) + if version == 0x24: #only for ir3507a + ret = diss_i2c_ir3507a(4) + else: + ret = 0 + except Exception as e: + print "Error on ir3507_check() e:" + str(e) + return -1 + return ret + def show_eeprom_help(): cmd = sys.argv[0].split("/")[-1]+ " " + args[0] print " use \""+ cmd + " 1-32 \" to dump sfp# eeprom" @@ -256,7 +279,7 @@ def driver_inserted(): kos = [ 'depmod -ae', 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe accton_i2c_cpld', 'modprobe cpr_4011_4mxx', 'modprobe ym2651y', @@ -277,7 +300,15 @@ def driver_install(): def driver_uninstall(): global FORCE for i in range(0,len(kos)): - rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + #remove parameter if any + rm = kos[-(i+1)] + lst = rm.split(" ") + if len(lst) > 2: + del(lst[2:]) + rm = " ".join(lst) + + #Change to removing commands + rm = rm.replace("modprobe", "modprobe -rq") rm = rm.replace("insmod", "rmmod") status, output = log_os_system(rm, 1) if status: @@ -378,6 +409,9 @@ def do_install(): return status else: print PROJECT_NAME.upper()+" drivers detected...." + + ir3507_check() + if not device_exist(): status = device_install() if status: diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py index 44c4486a2d..fe39ef6269 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py @@ -124,6 +124,29 @@ def show_set_help(): print " use \""+ cmd + " sfp 1-32 {0|1}\" to set sfp# tx_disable" sys.exit(0) +def diss_i2c_ir3507a(addr): + cmd = "i2cset -y 0 0x%x 0xE5 0x01" % addr + status, output = commands.getstatusoutput(cmd) + cmd = "i2cset -y 0 0x%x 0x12 0x02" % addr + status, output = commands.getstatusoutput(cmd) + return status + +def ir3507_check(): + cmd = "i2cdump -y 0 0x42 s 0x9a" + try: + status, output = commands.getstatusoutput(cmd) + lines = output.split('\n') + hn = re.findall(r'\w+', lines[-1]) + version = int(hn[1], 16) + if version == 0x24: #only for ir3507a + ret = diss_i2c_ir3507a(4) + else: + ret = 0 + except Exception as e: + print "Error on ir3507_check() e:" + str(e) + return -1 + return ret + def show_eeprom_help(): cmd = sys.argv[0].split("/")[-1]+ " " + args[0] print " use \""+ cmd + " 1-32 \" to dump sfp# eeprom" @@ -156,7 +179,7 @@ def driver_check(): kos = [ 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x', +'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe accton_i2c_cpld' , 'modprobe ym2651y' , 'modprobe x86-64-accton-as7816-64x-fan' , @@ -177,7 +200,15 @@ def driver_install(): def driver_uninstall(): global FORCE for i in range(0,len(kos)): - rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + #remove parameter if any + rm = kos[-(i+1)] + lst = rm.split(" ") + if len(lst) > 2: + del(lst[2:]) + rm = " ".join(lst) + + #Change to removing commands + rm = rm.replace("modprobe", "modprobe -rq") rm = rm.replace("insmod", "rmmod") status, output = log_os_system(rm, 1) if status: @@ -304,6 +335,9 @@ def do_install(): return status else: print PROJECT_NAME.upper()+" drivers detected...." + + ir3507_check() + if not device_exist(): print "No device, installing...." status = device_install() diff --git a/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c b/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c index dd4f6dd8c4..5e9d858fa6 100755 --- a/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c +++ b/platform/broadcom/sonic-platform-modules-accton/common/modules/ym2651y.c @@ -52,6 +52,7 @@ struct ym2651y_data { struct mutex update_lock; char valid; /* !=0 if registers are valid */ unsigned long last_updated; /* In jiffies */ + u8 chip; /* chip id */ u8 capability; /* Register value */ u16 status_word; /* Register value */ u8 fan_fault; /* Register value */ @@ -59,6 +60,7 @@ struct ym2651y_data { u16 v_out; /* Register value */ u16 i_out; /* Register value */ u16 p_out; /* Register value */ + u8 vout_mode; /* Register value */ u16 temp; /* Register value */ u16 fan_speed; /* Register value */ u16 fan_duty_cycle[2]; /* Register value */ @@ -77,6 +79,8 @@ struct ym2651y_data { u16 mfr_vout_max; /* Register value */ }; +static ssize_t show_vout(struct device *dev, struct device_attribute *da, + char *buf); static ssize_t show_byte(struct device *dev, struct device_attribute *da, char *buf); static ssize_t show_word(struct device *dev, struct device_attribute *da, @@ -129,7 +133,7 @@ static SENSOR_DEVICE_ATTR(psu_temp_fault, S_IRUGO, show_word, NULL, PSU_TE static SENSOR_DEVICE_ATTR(psu_power_good, S_IRUGO, show_word, NULL, PSU_POWER_GOOD); static SENSOR_DEVICE_ATTR(psu_fan1_fault, S_IRUGO, show_fan_fault, NULL, PSU_FAN1_FAULT); static SENSOR_DEVICE_ATTR(psu_over_temp, S_IRUGO, show_over_temp, NULL, PSU_OVER_TEMP); -static SENSOR_DEVICE_ATTR(psu_v_out, S_IRUGO, show_linear, NULL, PSU_V_OUT); +static SENSOR_DEVICE_ATTR(psu_v_out, S_IRUGO, show_vout, NULL, PSU_V_OUT); static SENSOR_DEVICE_ATTR(psu_i_out, S_IRUGO, show_linear, NULL, PSU_I_OUT); static SENSOR_DEVICE_ATTR(psu_p_out, S_IRUGO, show_linear, NULL, PSU_P_OUT); static SENSOR_DEVICE_ATTR(psu_temp1_input, S_IRUGO, show_linear, NULL, PSU_TEMP1_INPUT); @@ -150,7 +154,7 @@ static SENSOR_DEVICE_ATTR(psu_mfr_pin_max, S_IRUGO, show_linear, NULL, PSU_MFR static SENSOR_DEVICE_ATTR(psu_mfr_pout_max, S_IRUGO, show_linear, NULL, PSU_MFR_POUT_MAX); /*Duplicate nodes for lm-sensors.*/ -static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_linear, NULL, PSU_V_OUT); +static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_vout, NULL, PSU_V_OUT); static SENSOR_DEVICE_ATTR(curr2_input, S_IRUGO, show_linear, NULL, PSU_I_OUT); static SENSOR_DEVICE_ATTR(power2_input, S_IRUGO, show_linear, NULL, PSU_P_OUT_UV); static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_linear, NULL, PSU_TEMP1_INPUT); @@ -369,6 +373,51 @@ static ssize_t show_ascii(struct device *dev, struct device_attribute *da, return sprintf(buf, "%s\n", ptr); } +static ssize_t show_vout_by_mode(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + int exponent, mantissa; + int multiplier = 1000; + + if (!data->valid) { + return 0; + } + + exponent = two_complement_to_int(data->vout_mode, 5, 0x1f); + switch (attr->index) { + case PSU_MFR_VOUT_MIN: + mantissa = data->mfr_vout_min; + break; + case PSU_MFR_VOUT_MAX: + mantissa = data->mfr_vout_max; + break; + case PSU_V_OUT: + mantissa = data->v_out; + break; + default: + return 0; + } + + return (exponent > 0) ? sprintf(buf, "%d\n", (mantissa << exponent) * multiplier) : + sprintf(buf, "%d\n", (mantissa * multiplier) / (1 << -exponent)); +} + +static ssize_t show_vout(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct ym2651y_data *data = i2c_get_clientdata(client); + + if (data->chip == YM2401) { + return show_vout_by_mode(dev, da, buf); + } + else { + return show_linear(dev, da, buf); + } +} + static const struct attribute_group ym2651y_group = { .attrs = ym2651y_attributes, }; @@ -395,7 +444,7 @@ static int ym2651y_probe(struct i2c_client *client, i2c_set_clientdata(client, data); mutex_init(&data->update_lock); - + data->chip = dev_id->driver_data; dev_info(&client->dev, "chip found\n"); /* Register sysfs hooks */ @@ -511,6 +560,7 @@ static struct ym2651y_data *ym2651y_update_device(struct device *dev) u8 command; u8 fan_dir[5] = {0}; struct reg_data_byte regs_byte[] = { {0x19, &data->capability}, + {0x20, &data->vout_mode}, {0x7d, &data->over_temp}, {0x81, &data->fan_fault}, {0x98, &data->pmbus_revision} diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/control b/platform/broadcom/sonic-platform-modules-accton/debian/control index 8cc6b986c5..e6249a6a2c 100755 --- a/platform/broadcom/sonic-platform-modules-accton/debian/control +++ b/platform/broadcom/sonic-platform-modules-accton/debian/control @@ -52,3 +52,7 @@ Description: kernel modules for platform devices such as fan, led, sfp Package: sonic-platform-accton-as5812-54x Architecture: amd64 Description: kernel modules for platform devices such as fan, led, sfp + +Package: sonic-platform-accton-as5835-54x +Architecture: amd64 +Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/rules b/platform/broadcom/sonic-platform-modules-accton/debian/rules index 2cd3d6d7b6..5eecf73139 100755 --- a/platform/broadcom/sonic-platform-modules-accton/debian/rules +++ b/platform/broadcom/sonic-platform-modules-accton/debian/rules @@ -19,7 +19,7 @@ PACKAGE_PRE_NAME := sonic-platform-accton KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) -MODULE_DIRS:= as7712-32x as5712-54x as7816-64x as7716-32x as7716-32xb as7312-54x as7326-56x as6712-32x as7726-32x as4630-54pe minipack as5812-54x +MODULE_DIRS:= as7712-32x as5712-54x as7816-64x as7716-32x as7716-32xb as7312-54x as7326-56x as6712-32x as7726-32x as4630-54pe minipack as5812-54x as5835-54x MODULE_DIR := modules UTILS_DIR := utils SERVICE_DIR := service diff --git a/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py b/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py index 3d09fdfe0c..6f3485579c 100755 --- a/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py @@ -193,7 +193,6 @@ kos = [ 'depmod -ae', 'modprobe i2c_dev', 'modprobe i2c_mux_pca954x force_deselect_on_exit=1', -#'modprobe i2c_mux_pca954x', 'modprobe optoe', 'modprobe minipack_psensor'] @@ -207,7 +206,15 @@ def driver_install(): def driver_uninstall(): for i in range(0,len(kos)): - rm = kos[-(i+1)].replace("modprobe", "modprobe -rq") + #remove parameter if any + rm = kos[-(i+1)] + lst = rm.split(" ") + if len(lst) > 2: + del(lst[2:]) + rm = " ".join(lst) + + #Change to removing commands + rm = rm.replace("modprobe", "modprobe -rq") rm = rm.replace("insmod", "rmmod") status, output = log_os_system(rm, 1) if status: diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 0ed1df5a7d..7b7c79ee46 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 0ed1df5a7d6c88319ce41b10ce604c2727afab69 +Subproject commit 7b7c79ee463b43e570c48915215cdbf6ec250225 diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile new file mode 100644 index 0000000000..cd2a5a101a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile @@ -0,0 +1,14 @@ +SHELL = /bin/bash +.ONESHELL: +.SHELLFLAGS += -e + +MAIN_TARGET = $(BRCM_XLR_GTS_PLATFORM_MODULE) + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # Build the package + export PYBUILD_INSTALL_ARGS_python2=--install-scripts=/dev/null + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + + mv $(addprefix ../, $* $(EXTRA_TARGETS)) $(DEST)/ + +$(addprefix $(DEST)/, $(EXTRA_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/confs/sonic-platform-brcm-xlr-gts.service b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/confs/sonic-platform-brcm-xlr-gts.service new file mode 100644 index 0000000000..55ceca0e01 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/confs/sonic-platform-brcm-xlr-gts.service @@ -0,0 +1,11 @@ +[Unit] +Description=Broadcom XLR/GTS platform setup +Before=systemd-logind docker.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/brcm-xlr-gts-platform-setup + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/changelog b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/changelog new file mode 100755 index 0000000000..3168c7c4d6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/changelog @@ -0,0 +1,5 @@ +sonic-platform-brcm-xlr-gts (1.0) unstable; + + * Initial release + + -- Olivier Singla Thursday, 14 Feb 2019 11:11:11 -0800 diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/compat b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/compat new file mode 100755 index 0000000000..ec635144f6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/compat @@ -0,0 +1 @@ +9 diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/control b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/control new file mode 100755 index 0000000000..a046edb693 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/control @@ -0,0 +1,27 @@ +Source: sonic-platform-brcm-xlr-gts +Section: main +Priority: extra +Maintainer: Olivier Singla +Build-Depends: + dh-python, + debhelper (>= 9.0.0), + python-all, + python(>=2.7-3~), + python-setuptools, + python3(>=3.2), + python3-setuptools, + bzip2 +Standards-Version: 1.0.0 +X-Python-Version: >= 2.7 +X-Python3-Version: >= 3.2 +XS-Python-Version: >= 2.7 +XS-Python3-Version: >= 3.2 + +Package: sonic-platform-brcm-xlr-gts +Architecture: amd64 +Depends: + ${python:Depends}, + ${misc:Depends}, + python(>=2.7), + i2c-tools +Description: Miscellaneous XLR scripts and tools diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/copyright b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/copyright new file mode 100644 index 0000000000..ebdb940a0c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/copyright @@ -0,0 +1,1016 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + + + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/files b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/files new file mode 100644 index 0000000000..5e9df1525c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/files @@ -0,0 +1,2 @@ +sonic-platform-brcm-xlr-gts_1.0_amd64.buildinfo main extra +sonic-platform-brcm-xlr-gts_1.0_amd64.deb main extra diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/rules b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/rules new file mode 100755 index 0000000000..9c68010225 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/debian/rules @@ -0,0 +1,31 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/pkg-info.mk + +BIN_FILES := brcm-xlr-gts-platform-setup brcm-xlr-gts-create-eeprom-file.py +RULE_FILES := +SERVICE_FILES := sonic-platform-brcm-xlr-gts.service +USR_SBIN_FILES := brcm-xlr-gts-platform-setup brcm-xlr-gts-create-eeprom-file.py + +BASE_DIR := $(shell pwd) +MODULE_SRC := $(BASE_DIR)/src +TEST_DIR := $(BASE_DIR)/tests +BIN_SRC := $(addprefix $(BASE_DIR)/utils/,$(BIN_FILES)) +SERVICE_SRC := $(addprefix $(BASE_DIR)/confs/,$(SERVICE_FILES)) +USRLOCALSBIN_SRC := $(addprefix $(BASE_DIR)/utils/,$(USR_SBIN_FILES)) + +%: + dh $@ --with python2,python3,systemd --buildsystem=pybuild + +override_dh_auto_install: + dh_installdirs -p$(DEB_SOURCE) lib/systemd/system + cp $(SERVICE_SRC) debian/$(DEB_SOURCE)/lib/systemd/system + dh_installdirs -p$(DEB_SOURCE) usr/bin + cp $(BIN_SRC) debian/$(DEB_SOURCE)/usr/bin + dh_systemd_enable sonic-platform-brcm-xlr-gts.service + +override_dh_clean: + dh_clean + +print-%: + @echo $($*) diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/setup.py b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/setup.py new file mode 100755 index 0000000000..6ade72b816 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/setup.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +from setuptools import setup +import os + +setup( + name='platform-xlr-gts', + version='%s' % os.environ.get('BRCM_XLR_GTS_PLATFORM_MODULE_VERSION', '1.0'), + description='Module to initialize Broadcom XLR/GTS platforms', + packages=[], +) + diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/src/Makefile b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/src/Makefile new file mode 100644 index 0000000000..fc16fbbfdb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/src/Makefile @@ -0,0 +1,13 @@ +ccflags-y := -Werror + +#ifeq ($(ARISTA_SCD_DRIVER_CONFIG),m) +#obj-$(ARISTA_SCD_DRIVER_CONFIG) += scd.o +#else +#KBUILD_EXTRA_SYMBOLS += $(EXTRA_SYMBOLS) +#endif + +#obj-m += scd-hwmon.o +#obj-m += crow-fan-driver.o +#obj-m += raven-fan-driver.o +#obj-m += rook-led-driver.o +#obj-m += rook-fan-cpld.o diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/src/modules.order b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/src/modules.order new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/tests/all-platforms.sh b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/tests/all-platforms.sh new file mode 100755 index 0000000000..ce5c7b145c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/tests/all-platforms.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# +# This script provides a simple helper to test if the initscripts for all +# platforms work. +# It runs in simulation mode and don't actually initialize anything but still +# checks most of the codepaths +# + +echo "Nothing to do!" diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/utils/brcm-xlr-gts-create-eeprom-file.py b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/utils/brcm-xlr-gts-create-eeprom-file.py new file mode 100755 index 0000000000..71a99471a9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/utils/brcm-xlr-gts-create-eeprom-file.py @@ -0,0 +1,105 @@ +#!/usr/bin/python + +# Since the XLR/GTS cards do not have an EEPROM, we create a file which +# will be use like an EEPROM. + +import sys +import struct +from ctypes import * +import os + +TLV_CODE_PRODUCT_NAME = 0x21 +TLV_CODE_SERIAL_NUMBER = 0x23 +TLV_CODE_MAC_BASE = 0x24 +TLV_CODE_PLATFORM_NAME = 0x28 +TLV_CODE_ONIE_VERSION = 0x29 +TLV_CODE_MANUF_NAME = 0x2B +TLV_CODE_CRC_32 = 0xFE + +def getmac(interface): + try: + mac = open('/sys/class/net/'+interface+'/address').readline() + except: + mac = "00:00:00:00:00:00" + return mac[0:17] + +class TLVINFO_HEADER(Structure): + _fields_ = [("signature", c_char*8), + ("version", c_ubyte), + ("totallen", c_ushort)] + def dump(self): + return struct.pack('8s', self.signature) + \ + struct.pack('B', self.version) + \ + struct.pack('>H', self.totallen) + +class TLVINFO_DATA: + data = []; + def add_tlv_str(self, type, value): + self.data.append(struct.pack('B', type) + struct.pack('B', len(value)) + value.encode()) + def add_tlv_mac(self, type, value): + self.data.append(struct.pack('B', type) + struct.pack('B', len(value))) + for v in value: + self.data.append(struct.pack('B', int(v, 16))) + def dump(self): + r = ''; + for m in self.data: + r += bytes(m) + return r + struct.pack('B', TLV_CODE_CRC_32) + struct.pack('B', 4) + +def crc32(crc, p, len): + crc = 0xffffffff & ~crc + for i in range(len): + crc = crc ^ p[i] + for j in range(8): + crc = (crc >> 1) ^ (0xedb88320 & -(crc & 1)) + return 0xffffffff & ~crc + +def crc(header, data): + r = ''; + for m in header: + r += bytes(m) + for m in data: + r += bytes(m) + c = crc32(0, bytearray(r), len(r)) + s = struct.pack('>I', c) + return s + +def main(): + + tlvinfo_header = TLVINFO_HEADER('TlvInfo', 1, 0) + + tlvinfo_data = TLVINFO_DATA() + tlvinfo_data.add_tlv_str(TLV_CODE_SERIAL_NUMBER, 'S/N') + + onie_machine = os.popen("cat /host/machine.conf | grep 'onie_machine=' | sed 's/onie_machine=//'").read().strip() + if onie_machine == 'bcm_xlr': + tlvinfo_data.add_tlv_str(TLV_CODE_PRODUCT_NAME, 'BCM9COMX2XMC') + else: + tlvinfo_data.add_tlv_str(TLV_CODE_PRODUCT_NAME, 'Unknown') + + tlvinfo_data.add_tlv_str(TLV_CODE_MANUF_NAME, 'Broadcom') + + eth0_mac_str = getmac('eth0') + eth0_mac = eth0_mac_str.split(':') + tlvinfo_data.add_tlv_mac(TLV_CODE_MAC_BASE, eth0_mac) + + brcm_dev = os.popen("lspci | grep -m1 'Ethernet controller: Broadcom ' | grep 'Device' | sed 's/(.*//' | awk '{print $NF}'").read().strip() + if brcm_dev == 'b960': + tlvinfo_data.add_tlv_str(TLV_CODE_PLATFORM_NAME, 'BCM956960K') + + onie_version = os.popen("cat /host/machine.conf | grep 'onie_version' | sed 's/onie_version=//'").read().strip() + tlvinfo_data.add_tlv_str(TLV_CODE_ONIE_VERSION, onie_version) + + tlvinfo_header.totallen = len(tlvinfo_data.dump())+4; + + try: + f = open('/etc/sys_eeprom.bin', 'w+') + f.write(tlvinfo_header.dump()) + f.write(tlvinfo_data.dump()) + f.write(crc(tlvinfo_header.dump(), tlvinfo_data.dump())) + f.close() + except: + print('Unable to write file /etc/sys_eeprom.bin') + +if __name__== "__main__": + main() diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/utils/brcm-xlr-gts-platform-setup b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/utils/brcm-xlr-gts-platform-setup new file mode 100755 index 0000000000..1b5d20a5c9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/utils/brcm-xlr-gts-platform-setup @@ -0,0 +1,23 @@ +#!/bin/sh + +. /host/machine.conf + +# We boot SONiC from an XMC card : identify the switch at run-time and update the SKU +if [ "${onie_machine}" = "bcm_xlr" ]; then + grep "HandleLidSwitch=ignore" /etc/systemd/logind.conf > /dev/null + if [ ! $? = 0 ]; then + echo "HandleLidSwitch=ignore" >> /etc/systemd/logind.conf + echo "IdleAction=ignore" >> /etc/systemd/logind.conf + systemctl is-active --quiet systemd-logind + if [ $? = 0 ]; then + systemctl restart systemd-logind + fi + fi + /usr/bin/brcm-xlr-gts-create-eeprom-file.py + brcm_sw=$(lspci | grep -m1 "Ethernet controller: Broadcom " | grep "Device" | sed 's/(.*//' | awk '{print $NF}') + case "$brcm_sw" in + b960) + echo "BCM956960K t1" > /usr/share/sonic/device/${onie_platform}/default_sku + ;; + esac +fi diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.init b/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.init index f16f7e01ef..6566f362cc 100755 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.init +++ b/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.init @@ -67,6 +67,7 @@ start) depmod -a modprobe i2c_mux_gpio modprobe dell_s6000_platform + modprobe nvram add_i2c_devices @@ -81,6 +82,7 @@ stop) remove_i2c_devices + rmmod nvram rmmod dell_s6000_platform rmmod i2c_mux_gpio ;; diff --git a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install b/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install index a059f39ff3..8fdf12a41c 100644 --- a/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install +++ b/platform/broadcom/sonic-platform-modules-s6000/debian/platform-modules-s6000.install @@ -1 +1,2 @@ systemd/platform-modules-s6000.service lib/systemd/system +scripts/io_rd_wr.py usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py b/platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py new file mode 100755 index 0000000000..dc9dd09807 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-s6000/scripts/io_rd_wr.py @@ -0,0 +1,93 @@ +#!/usr/bin/python +#Script to read/write the io based registers + +import sys +import os +import getopt +import struct + +io_resource='/dev/port' + +def usage(): + ''' This is the Usage Method ''' + + print 'Utility for IO read/write' + print '\t\t io_rd_wr.py --get --offset ' + print '\t\t io_rd_wr.py --set --val --offset ' + sys.exit(1) + +def io_reg_read(io_resource,offset): + fd=os.open(io_resource, os.O_RDONLY) + if(fd<0): + print 'file open failed %s"%io_resource' + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print 'lseek failed on %s'%io_resource + return + buf=os.read(fd,1) + reg_val1=ord(buf) + print 'reg value %x'%reg_val1 + os.close(fd) + +def io_reg_write(io_resource,offset,val): + fd=os.open(io_resource,os.O_RDWR) + if(fd<0): + print 'file open failed %s"%io_resource' + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print 'lseek failed on %s'%io_resource + return + ret=os.write(fd,struct.pack('B',val)) + if(ret != 1): + print 'write failed %d'%ret + return + os.close(fd) + +def main(argv): + + ''' The main function will read the user input from the + command line argument and process the request ''' + + opts = '' + val = '' + choice = '' + resouce = '' + offset = '' + + try: + opts, args = getopt.getopt(argv, "hgs:" , \ + ["val=","offset=","help", "get", "set"]) + + except getopt.GetoptError: + usage() + + for opt,arg in opts: + + if opt in ('-h','--help'): + choice = 'help' + + elif opt in ('-g', '--get'): + choice = 'get' + + elif opt in ('-s', '--set'): + choice = 'set' + + elif opt == '--offset': + offset = int(arg,16) + + elif opt == '--val': + val = int(arg,16) + + if choice == 'get' and offset != '': + io_reg_read(io_resource,offset) + + elif choice == 'set' and offset != '' and val != '': + io_reg_write(io_resource,offset,val) + + else: + usage() + +#Calling the main method +if __name__ == "__main__": + main(sys.argv[1:]) + diff --git a/platform/mellanox/docker-saiserver-mlnx.mk b/platform/mellanox/docker-saiserver-mlnx.mk index 4a686f2d32..d91756a1f2 100644 --- a/platform/mellanox/docker-saiserver-mlnx.mk +++ b/platform/mellanox/docker-saiserver-mlnx.mk @@ -4,7 +4,7 @@ DOCKER_SAISERVER_MLNX = docker-saiserver-mlnx.gz $(DOCKER_SAISERVER_MLNX)_PATH = $(PLATFORM_PATH)/docker-saiserver-mlnx $(DOCKER_SAISERVER_MLNX)_DEPENDS += $(SAISERVER) $(PYTHON_SDK_API) $(DOCKER_SAISERVER_MLNX)_PYTHON_DEBS += $(MLNX_SFPD) -$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) +$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MLNX) $(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver diff --git a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 index 4b3afaa6ec..b202be5b34 100644 --- a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine +FROM docker-config-engine-stretch ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/rules/docker-dhcp-relay.mk b/rules/docker-dhcp-relay.mk index d15bdbf84d..f2432cdc00 100644 --- a/rules/docker-dhcp-relay.mk +++ b/rules/docker-dhcp-relay.mk @@ -6,7 +6,7 @@ DOCKER_DHCP_RELAY_DBG = $(DOCKER_DHCP_RELAY_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/$(DOCKER_DHCP_RELAY_STEM) -$(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_COMMON) $(ISC_DHCP_RELAY) $(REDIS_TOOLS) +$(DOCKER_DHCP_RELAY)_DEPENDS += $(ISC_DHCP_RELAY) $(REDIS_TOOLS) $(DOCKER_DHCP_RELAY)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS) $(DOCKER_DHCP_RELAY)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES) diff --git a/rules/docker-ptf.mk b/rules/docker-ptf.mk index aa517bf16d..2782c45339 100644 --- a/rules/docker-ptf.mk +++ b/rules/docker-ptf.mk @@ -4,4 +4,3 @@ DOCKER_PTF = docker-ptf.gz $(DOCKER_PTF)_PATH = $(DOCKERS_PATH)/docker-ptf $(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF) SONIC_DOCKER_IMAGES += $(DOCKER_PTF) -SONIC_JESSIE_DOCKERS += $(DOCKER_PTF) diff --git a/rules/isc-dhcp.mk b/rules/isc-dhcp.mk index 16b14ac5c0..67d7ed7564 100644 --- a/rules/isc-dhcp.mk +++ b/rules/isc-dhcp.mk @@ -1,14 +1,11 @@ # isc-dhcp packages -ISC_DHCP_VERSION = 4.3.5-3.1 +ISC_DHCP_VERSION = 4.3.5-2 export ISC_DHCP_VERSION -ISC_DHCP_COMMON = isc-dhcp-common_$(ISC_DHCP_VERSION)_amd64.deb -$(ISC_DHCP_COMMON)_SRC_PATH = $(SRC_PATH)/isc-dhcp -SONIC_MAKE_DEBS += $(ISC_DHCP_COMMON) - ISC_DHCP_RELAY = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb -$(eval $(call add_derived_package,$(ISC_DHCP_COMMON),$(ISC_DHCP_RELAY))) +$(ISC_DHCP_RELAY)_SRC_PATH = $(SRC_PATH)/isc-dhcp +SONIC_MAKE_DEBS += $(ISC_DHCP_RELAY) -SONIC_STRETCH_DEBS += $(ISC_DHCP_COMMON) $(ISC_DHCP_RELAY) +SONIC_STRETCH_DEBS += $(ISC_DHCP_RELAY) diff --git a/rules/libteam.mk b/rules/libteam.mk index 9aecb07ce8..d781db8ba9 100644 --- a/rules/libteam.mk +++ b/rules/libteam.mk @@ -1,6 +1,6 @@ # libteam packages -LIBTEAM_VERSION = 1.26-1 +LIBTEAM_VERSION = 1.28-1 export LIBTEAM_VERSION diff --git a/slave.mk b/slave.mk index 6cedda6120..f46a76e96b 100644 --- a/slave.mk +++ b/slave.mk @@ -596,7 +596,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export files_path="$(FILES_PATH)" export python_debs_path="$(PYTHON_DEBS_PATH)" export initramfs_tools="$(STRETCH_DEBS_PATH)/$(INITRAMFS_TOOLS)" - export linux_kernel="$(STRTCH_DEBS_PATH)/$(LINUX_KERNEL)" + export linux_kernel="$(STRETCH_DEBS_PATH)/$(LINUX_KERNEL)" export onie_recovery_image="$(FILES_PATH)/$(ONIE_RECOVERY_IMAGE)" export kversion="$(KVERSION)" export image_type="$($*_IMAGE_TYPE)" diff --git a/src/isc-dhcp/Makefile b/src/isc-dhcp/Makefile index 1227b3a0c3..3994f7e4a4 100644 --- a/src/isc-dhcp/Makefile +++ b/src/isc-dhcp/Makefile @@ -2,8 +2,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MAIN_TARGET = isc-dhcp-common_$(ISC_DHCP_VERSION)_amd64.deb -DERIVED_TARGETS = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb +MAIN_TARGET = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Remove any stale files @@ -27,6 +26,4 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : popd # Move the newly-built .deb packages to the destination directory - mv $* $(DERIVED_TARGETS) $(DEST)/ - -$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) + mv $* $(DEST)/ diff --git a/src/isc-dhcp/patch/0005-Add-enable-use-sockets-to-configure-flags-in-debian-.patch b/src/isc-dhcp/patch/0005-Add-enable-use-sockets-to-configure-flags-in-debian-.patch new file mode 100644 index 0000000000..7c39f977bb --- /dev/null +++ b/src/isc-dhcp/patch/0005-Add-enable-use-sockets-to-configure-flags-in-debian-.patch @@ -0,0 +1,26 @@ +From 5c64cb06e3ac50a1cbca85669625fe16439064ad Mon Sep 17 00:00:00 2001 +From: Joe LeVeque +Date: Fri, 17 May 2019 21:49:00 +0000 +Subject: [PATCH 1/3] Add --enable-use-sockets to configure flags in + debian/rules + +--- + debian/rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/debian/rules b/debian/rules +index 114606b..9919237 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -23,7 +23,7 @@ CFLAGS+=-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"' + CFLAGS+=-D_PATH_DHCLIENT_DB='\"$(LEASE_PATH)/dhclient.leases\"' + CFLAGS+=-D_PATH_DHCLIENT6_DB='\"$(LEASE_PATH)/dhclient6.leases\"' + +-CONFFLAGS=--prefix=/usr --enable-log-pid --enable-paranoia ++CONFFLAGS=--prefix=/usr --enable-log-pid --enable-paranoia --enable-use-sockets + + # cross-architecture building + ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +-- +2.17.1 + diff --git a/src/isc-dhcp/patch/0006-Bugfix-Ensure-HAVE_SO_BINDTODEVICE-has-a-chance-to-b.patch b/src/isc-dhcp/patch/0006-Bugfix-Ensure-HAVE_SO_BINDTODEVICE-has-a-chance-to-b.patch new file mode 100644 index 0000000000..5553180f40 --- /dev/null +++ b/src/isc-dhcp/patch/0006-Bugfix-Ensure-HAVE_SO_BINDTODEVICE-has-a-chance-to-b.patch @@ -0,0 +1,275 @@ +From 6620d4778fe36c89ce2e95d6932338cefc90df7d Mon Sep 17 00:00:00 2001 +From: Joe LeVeque +Date: Fri, 17 May 2019 21:53:52 +0000 +Subject: [PATCH 2/3] Bugfix: Ensure HAVE_SO_BINDTODEVICE has a chance to be + defined before it is referenced + +--- + includes/osdep.h | 239 ++++++++++++++++++++++++----------------------- + 1 file changed, 120 insertions(+), 119 deletions(-) + +diff --git a/includes/osdep.h b/includes/osdep.h +index cfae90b..f07c43c 100644 +--- a/includes/osdep.h ++++ b/includes/osdep.h +@@ -48,37 +48,6 @@ + #define BYTE_ORDER DHCP_BYTE_ORDER + #endif /* BYTE_ORDER */ + +-/* Porting:: +- +- If you add a new network API, you must add a check for it below: */ +- +-#if !defined (USE_SOCKETS) && \ +- !defined (USE_SOCKET_SEND) && \ +- !defined (USE_SOCKET_RECEIVE) && \ +- !defined (USE_RAW_SOCKETS) && \ +- !defined (USE_RAW_SEND) && \ +- !defined (USE_SOCKET_RECEIVE) && \ +- !defined (USE_BPF) && \ +- !defined (USE_BPF_SEND) && \ +- !defined (USE_BPF_RECEIVE) && \ +- !defined (USE_LPF) && \ +- !defined (USE_LPF_SEND) && \ +- !defined (USE_LPF_RECEIVE) && \ +- !defined (USE_NIT) && \ +- !defined (USE_NIT_SEND) && \ +- !defined (USE_NIT_RECEIVE) && \ +- !defined (USE_DLPI_SEND) && \ +- !defined (USE_DLPI_RECEIVE) +-/* Determine default socket API to USE. */ +-# if defined(HAVE_BPF) +-# define USE_BPF 1 +-# elif defined(HAVE_LPF) +-# define USE_LPF 1 +-# elif defined(HAVE_DLPI) +-# define USE_DLPI 1 +-# endif +-#endif +- + #if !defined (TIME_MAX) + # define TIME_MAX 2147483647 + #endif +@@ -91,94 +60,6 @@ + # define vsnprintf isc_print_vsnprintf + #endif + +-/* Porting:: +- +- If you add a new network API, and have it set up so that it can be +- used for sending or receiving, but doesn't have to be used for both, +- then set up an ifdef like the ones below: */ +- +-#ifdef USE_SOCKETS +-# define USE_SOCKET_SEND +-# define USE_SOCKET_RECEIVE +-# if defined(HAVE_DLPI) && !defined(sun) && !defined(USE_V4_PKTINFO) +-# define USE_DLPI_HWADDR +-# elif defined(HAVE_LPF) +-# define USE_LPF_HWADDR +-# elif defined(HAVE_BPF) +-# define USE_BPF_HWADDR +-# endif +-#endif +- +-#ifdef USE_RAW_SOCKETS +-# define USE_RAW_SEND +-# define USE_SOCKET_RECEIVE +-#endif +- +-#ifdef USE_BPF +-# define USE_BPF_SEND +-# define USE_BPF_RECEIVE +-#endif +- +-#ifdef USE_LPF +-# define USE_LPF_SEND +-# define USE_LPF_RECEIVE +-#endif +- +-#ifdef USE_NIT +-# define USE_NIT_SEND +-# define USE_NIT_RECEIVE +-#endif +- +-#ifdef USE_DLPI +-# define USE_DLPI_SEND +-# define USE_DLPI_RECEIVE +-#endif +- +-#ifdef USE_UPF +-# define USE_UPF_SEND +-# define USE_UPF_RECEIVE +-#endif +- +-/* Porting:: +- +- If you add support for sending packets directly out an interface, +- and your support does not do ARP or routing, you must use a fallback +- mechanism to deal with packets that need to be sent to routers. +- Currently, all low-level packet interfaces use BSD sockets as a +- fallback. */ +- +-#if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ +- defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \ +- defined (USE_LPF_SEND) || \ +- (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE)) +-# define USE_SOCKET_FALLBACK +-# define USE_FALLBACK +-#endif +- +-/* Porting:: +- +- If you add support for sending packets directly out an interface +- and need to be able to assemble packets, add the USE_XXX_SEND +- definition for your interface to the list tested below. */ +- +-#if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ +- defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ +- defined (USE_DLPI_SEND) || defined (USE_LPF_SEND) +-# define PACKET_ASSEMBLY +-#endif +- +-/* Porting:: +- +- If you add support for receiving packets directly from an interface +- and need to be able to decode raw packets, add the USE_XXX_RECEIVE +- definition for your interface to the list tested below. */ +- +-#if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ +- defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ +- defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE) +-# define PACKET_DECODING +-#endif +- + /* If we don't have a DLPI packet filter, we have to filter in userland. + Probably not worth doing, actually. */ + #if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD) +@@ -288,4 +169,124 @@ + # define STDERR_FILENO 2 + #endif + ++/* Porting:: ++ ++ If you add a new network API, you must add a check for it below: */ ++ ++#if !defined (USE_SOCKETS) && \ ++ !defined (USE_SOCKET_SEND) && \ ++ !defined (USE_SOCKET_RECEIVE) && \ ++ !defined (USE_RAW_SOCKETS) && \ ++ !defined (USE_RAW_SEND) && \ ++ !defined (USE_SOCKET_RECEIVE) && \ ++ !defined (USE_BPF) && \ ++ !defined (USE_BPF_SEND) && \ ++ !defined (USE_BPF_RECEIVE) && \ ++ !defined (USE_LPF) && \ ++ !defined (USE_LPF_SEND) && \ ++ !defined (USE_LPF_RECEIVE) && \ ++ !defined (USE_NIT) && \ ++ !defined (USE_NIT_SEND) && \ ++ !defined (USE_NIT_RECEIVE) && \ ++ !defined (USE_DLPI_SEND) && \ ++ !defined (USE_DLPI_RECEIVE) ++/* Determine default socket API to USE. */ ++# if defined(HAVE_BPF) ++# define USE_BPF 1 ++# elif defined(HAVE_LPF) ++# define USE_LPF 1 ++# elif defined(HAVE_DLPI) ++# define USE_DLPI 1 ++# endif ++#endif ++ ++/* Porting:: ++ ++ If you add a new network API, and have it set up so that it can be ++ used for sending or receiving, but doesn't have to be used for both, ++ then set up an ifdef like the ones below: */ ++ ++#ifdef USE_SOCKETS ++# define USE_SOCKET_SEND ++# define USE_SOCKET_RECEIVE ++# if defined(HAVE_DLPI) && !defined(sun) && !defined(USE_V4_PKTINFO) ++# define USE_DLPI_HWADDR ++# elif defined(HAVE_LPF) ++# define USE_LPF_HWADDR ++# elif defined(HAVE_BPF) ++# define USE_BPF_HWADDR ++# endif ++#endif ++ ++#ifdef USE_RAW_SOCKETS ++# define USE_RAW_SEND ++# define USE_SOCKET_RECEIVE ++#endif ++ ++#ifdef USE_BPF ++# define USE_BPF_SEND ++# define USE_BPF_RECEIVE ++#endif ++ ++#ifdef USE_LPF ++# define USE_LPF_SEND ++# define USE_LPF_RECEIVE ++#endif ++ ++#ifdef USE_NIT ++# define USE_NIT_SEND ++# define USE_NIT_RECEIVE ++#endif ++ ++#ifdef USE_DLPI ++# define USE_DLPI_SEND ++# define USE_DLPI_RECEIVE ++#endif ++ ++#ifdef USE_UPF ++# define USE_UPF_SEND ++# define USE_UPF_RECEIVE ++#endif ++ ++/* Porting:: ++ ++ If you add support for sending packets directly out an interface, ++ and your support does not do ARP or routing, you must use a fallback ++ mechanism to deal with packets that need to be sent to routers. ++ Currently, all low-level packet interfaces use BSD sockets as a ++ fallback. */ ++ ++#if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \ ++ defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || \ ++ defined (USE_LPF_SEND) || \ ++ (defined (USE_SOCKET_SEND) && defined (HAVE_SO_BINDTODEVICE)) ++# define USE_SOCKET_FALLBACK ++# define USE_FALLBACK ++#endif ++ ++/* Porting:: ++ ++ If you add support for sending packets directly out an interface ++ and need to be able to assemble packets, add the USE_XXX_SEND ++ definition for your interface to the list tested below. */ ++ ++#if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \ ++ defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \ ++ defined (USE_DLPI_SEND) || defined (USE_LPF_SEND) ++# define PACKET_ASSEMBLY ++#endif ++ ++/* Porting:: ++ ++ If you add support for receiving packets directly from an interface ++ and need to be able to decode raw packets, add the USE_XXX_RECEIVE ++ definition for your interface to the list tested below. */ ++ ++#if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \ ++ defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \ ++ defined (USE_DLPI_RECEIVE) || defined (USE_LPF_RECEIVE) ++# define PACKET_DECODING ++#endif ++ ++ + #endif /* __ISC_DHCP_OSDEP_H__ */ +-- +2.17.1 + diff --git a/src/isc-dhcp/patch/0007-If-destination-of-BOOTREQUEST-is-directed-broadcast-.patch b/src/isc-dhcp/patch/0007-If-destination-of-BOOTREQUEST-is-directed-broadcast-.patch new file mode 100644 index 0000000000..e64f8439e2 --- /dev/null +++ b/src/isc-dhcp/patch/0007-If-destination-of-BOOTREQUEST-is-directed-broadcast-.patch @@ -0,0 +1,267 @@ +From fe50ed9721d79be0bb5045a219f5f5bb4cb8868e Mon Sep 17 00:00:00 2001 +From: Joe LeVeque +Date: Fri, 17 May 2019 22:24:02 +0000 +Subject: [PATCH 3/3] If destination of BOOTREQUEST is directed broadcast, + forward on that interface. Otherwise forward on fallback or all upstream + interfaces + +--- + common/discover.c | 46 +++++++++++++++++++--- + includes/dhcpd.h | 3 ++ + relay/dhcrelay.c | 98 +++++++++++++++++++++++++++++++++++++++++------ + 3 files changed, 131 insertions(+), 16 deletions(-) + +diff --git a/common/discover.c b/common/discover.c +index 8e7f632..73eb8a9 100644 +--- a/common/discover.c ++++ b/common/discover.c +@@ -227,6 +227,7 @@ struct iface_conf_list { + struct iface_info { + char name[IF_NAMESIZE+1]; /* name of the interface, e.g. "bge0" */ + struct sockaddr_storage addr; /* address information */ ++ struct sockaddr_storage netmask; /* netmask information */ + isc_uint64_t flags; /* interface flags, e.g. IFF_LOOPBACK */ + }; + +@@ -401,6 +402,7 @@ struct iface_conf_list { + struct iface_info { + char name[IFNAMSIZ]; /* name of the interface, e.g. "eth0" */ + struct sockaddr_storage addr; /* address information */ ++ struct sockaddr_storage netmask; /* netmask information */ + isc_uint64_t flags; /* interface flags, e.g. IFF_LOOPBACK */ + }; + +@@ -576,6 +578,17 @@ next_iface4(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { + } + memcpy(&info->addr, &tmp.ifr_addr, sizeof(tmp.ifr_addr)); + ++ if (ioctl(ifaces->sock, SIOCGIFNETMASK, &tmp) < 0) { ++ if (errno == EADDRNOTAVAIL) { ++ continue; ++ } ++ log_error("Error getting netmask " ++ "for '%s'; %m", name); ++ *err = 1; ++ return 0; ++ } ++ memcpy(&info->netmask, &tmp.ifr_netmask, sizeof(tmp.ifr_netmask)); ++ + memset(&tmp, 0, sizeof(tmp)); + strncpy(tmp.ifr_name, name, sizeof(tmp.ifr_name) - 1); + if (ioctl(ifaces->sock, SIOCGIFFLAGS, &tmp) < 0) { +@@ -780,6 +793,7 @@ struct iface_conf_list { + struct iface_info { + char name[IFNAMSIZ]; /* name of the interface, e.g. "bge0" */ + struct sockaddr_storage addr; /* address information */ ++ struct sockaddr_storage netmask; /* netmask information */ + isc_uint64_t flags; /* interface flags, e.g. IFF_LOOPBACK */ + }; + +@@ -840,7 +854,8 @@ end_iface_scan(struct iface_conf_list *ifaces) { + /* XXX: perhaps create drealloc() rather than do it manually */ + void + add_ipv4_addr_to_interface(struct interface_info *iface, +- const struct in_addr *addr) { ++ const struct in_addr *addr, ++ const struct in_addr *netmask) { + /* + * We don't expect a lot of addresses per IPv4 interface, so + * we use 4, as our "chunk size" for collecting addresses. +@@ -851,6 +866,12 @@ add_ipv4_addr_to_interface(struct interface_info *iface, + log_fatal("Out of memory saving IPv4 address " + "on interface."); + } ++ ++ iface->netmasks = dmalloc(4 * sizeof(struct in_addr), MDL); ++ if (iface->netmasks == NULL) { ++ log_fatal("Out of memory saving IPv4 netmask " ++ "on interface."); ++ } + iface->address_count = 0; + iface->address_max = 4; + } else if (iface->address_count >= iface->address_max) { +@@ -863,14 +884,28 @@ add_ipv4_addr_to_interface(struct interface_info *iface, + log_fatal("Out of memory saving IPv4 address " + "on interface."); + } +- memcpy(tmp, +- iface->addresses, ++ memcpy(tmp, ++ iface->addresses, + iface->address_max * sizeof(struct in_addr)); + dfree(iface->addresses, MDL); + iface->addresses = tmp; ++ ++ tmp = dmalloc(new_max * sizeof(struct in_addr), MDL); ++ if (tmp == NULL) { ++ log_fatal("Out of memory saving IPv4 netmask " ++ "on interface."); ++ } ++ memcpy(tmp, ++ iface->netmasks, ++ iface->address_max * sizeof(struct in_addr)); ++ dfree(iface->netmasks, MDL); ++ iface->netmasks = tmp; ++ + iface->address_max = new_max; + } +- iface->addresses[iface->address_count++] = *addr; ++ iface->addresses[iface->address_count] = *addr; ++ iface->netmasks[iface->address_count] = *netmask; ++ iface->address_count++; + } + + #ifdef DHCPv6 +@@ -1005,6 +1040,7 @@ discover_interfaces(int state) { + if ((info.addr.ss_family == AF_INET) && + (local_family == AF_INET)) { + struct sockaddr_in *a = (struct sockaddr_in*)&info.addr; ++ struct sockaddr_in *n = (struct sockaddr_in*)&info.netmask; + struct iaddr addr; + + /* We don't want the loopback interface. */ +@@ -1019,7 +1055,7 @@ discover_interfaces(int state) { + if (a->sin_addr.s_addr != htonl(INADDR_ANY)) + tmp->configured = 1; + +- add_ipv4_addr_to_interface(tmp, &a->sin_addr); ++ add_ipv4_addr_to_interface(tmp, &a->sin_addr, &n->sin_addr); + + /* invoke the setup hook */ + addr.len = 4; +diff --git a/includes/dhcpd.h b/includes/dhcpd.h +index 261714d..89bfe82 100644 +--- a/includes/dhcpd.h ++++ b/includes/dhcpd.h +@@ -1347,6 +1347,9 @@ struct interface_info { + struct in_addr *addresses; /* Addresses associated with this + * interface. + */ ++ struct in_addr *netmasks; /* Netmask associated with this ++ * interface. ++ */ + int address_count; /* Number of addresses stored. */ + int address_max; /* Size of addresses buffer. */ + struct in6_addr *v6addresses; /* IPv6 addresses associated with +diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c +index c9b6d8e..8aac4b3 100644 +--- a/relay/dhcrelay.c ++++ b/relay/dhcrelay.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + + TIME default_lease_time = 43200; /* 12 hours... */ +@@ -881,20 +882,95 @@ do_relay4(struct interface_info *ip, struct dhcp_packet *packet, + /* Otherwise, it's a BOOTREQUEST, so forward it to all the + servers. */ + for (sp = servers; sp; sp = sp->next) { +- if (send_packet((fallback_interface +- ? fallback_interface : interfaces), +- NULL, packet, length, ip->addresses[0], +- &sp->to, NULL) < 0) { +- ++client_packet_errors; ++ int packet_relay_attempted = 0; ++ ++ log_debug("Server IP: %s", inet_ntoa(sp->to.sin_addr)); ++ ++ /* If the server's IP address is the broadcast IP of one ++ of our interfaces, we send it directly on that interface's ++ socket, because the kernel will drop directed broadcast ++ packets if we send on the fallback. */ ++ for (out = interfaces; out; out = out->next) { ++ int i = 0; ++ ++ // Only relay BOOTREQUEST on upstream interfaces ++ if (!(out->flags & INTERFACE_UPSTREAM)) ++ continue; ++ ++ if (!out->addresses || !out->netmasks) ++ continue; ++ ++ for (i = 0; i < out->address_count; i++) { ++ struct in_addr bcast_addr; ++ ++ log_debug("Iface %s addr: %s", out->name, inet_ntoa(out->addresses[i])); ++ log_debug("Iface %s netmask: %s", out->name, inet_ntoa(out->netmasks[i])); ++ ++ // Broadcast = ip_addr | ~netmask ++ bcast_addr.s_addr = out->addresses[i].s_addr | ~out->netmasks[i].s_addr; ++ log_debug("Iface %s broadcast: %s", out->name, inet_ntoa(bcast_addr)); ++ ++ if (sp->to.sin_addr.s_addr == bcast_addr.s_addr) { ++ log_debug("Packet destined for broadcast IP of %s", out->name); ++ if (send_packet(out, NULL, packet, ++ length, ip->addresses[0],&sp->to, NULL) < 0) { ++ ++client_packet_errors; ++ } else { ++ log_debug("Forwarded BOOTREQUEST for %s to %s on interface %s", ++ print_hw_addr(packet->htype, packet->hlen, ++ packet->chaddr), ++ inet_ntoa(sp->to.sin_addr), out->name); ++ ++ ++client_packets_relayed; ++ } ++ ++ packet_relay_attempted = 1; ++ ++ break; ++ } ++ } ++ ++ if (packet_relay_attempted) ++ break; ++ } ++ ++ if (packet_relay_attempted) ++ continue; ++ ++ /* Otherwise, if we have a fallback interface, we send the packet ++ on it. If not, we send the packet out all interfaces.*/ ++ if (fallback_interface) { ++ if (send_packet(fallback_interface, NULL, packet, ++ length, ip->addresses[0],&sp->to, NULL) < 0) { ++ ++client_packet_errors; ++ } else { ++ log_debug("Forwarded BOOTREQUEST for %s to %s on fallback interface", ++ print_hw_addr(packet->htype, packet->hlen, ++ packet->chaddr), ++ inet_ntoa(sp->to.sin_addr)); ++ ++ ++client_packets_relayed; ++ } + } else { +- log_debug("Forwarded BOOTREQUEST for %s to %s", +- print_hw_addr(packet->htype, packet->hlen, +- packet->chaddr), +- inet_ntoa(sp->to.sin_addr)); +- ++client_packets_relayed; ++ for (out = interfaces; out; out = out->next) { ++ // Only relay BOOTREQUEST on upstream interfaces ++ if (!(out->flags & INTERFACE_UPSTREAM)) ++ continue; ++ ++ if (send_packet(out, NULL, packet, ++ length, ip->addresses[0],&sp->to, NULL) < 0) { ++ ++client_packet_errors; ++ } else { ++ log_debug("Forwarded BOOTREQUEST for %s to %s on interface %s", ++ print_hw_addr(packet->htype, packet->hlen, ++ packet->chaddr), ++ inet_ntoa(sp->to.sin_addr), out->name); ++ ++ ++client_packets_relayed; ++ } ++ } + } + } +- + } + + /* Strip any Relay Agent Information options from the DHCP packet +-- +2.17.1 + diff --git a/src/isc-dhcp/patch/0008-CVE-2017-3144.patch b/src/isc-dhcp/patch/0008-CVE-2017-3144.patch new file mode 100644 index 0000000000..fe066e177a --- /dev/null +++ b/src/isc-dhcp/patch/0008-CVE-2017-3144.patch @@ -0,0 +1,47 @@ +From: Thomas Markwalder +Date: Thu, 7 Dec 2017 11:23:36 -0500 +Subject: [master] Plugs a socket descriptor leak in OMAPI +Origin: https://source.isc.org/cgi-bin/gitweb.cgi?p=dhcp.git;a=commit;h=1a6b62fe17a42b00fa234d06b6dfde3d03451894 +Bug: https://bugs.isc.org/Public/Bug/Display.html?id=46767 +Bug-Debian: https://bugs.debian.org/887413 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-3144 + + Merges in rt46767. +--- + +diff --git a/omapip/buffer.c b/omapip/buffer.c +index 6e0621b5..a21f0a80 100644 +--- a/omapip/buffer.c ++++ b/omapip/buffer.c +@@ -565,6 +565,15 @@ isc_result_t omapi_connection_writer (omapi_object_t *h) + omapi_buffer_dereference (&buffer, MDL); + } + } ++ ++ /* If we had data left to write when we're told to disconnect, ++ * we need recall disconnect, now that we're done writing. ++ * See rt46767. */ ++ if (c->out_bytes == 0 && c->state == omapi_connection_disconnecting) { ++ omapi_disconnect (h, 1); ++ return ISC_R_SHUTTINGDOWN; ++ } ++ + return ISC_R_SUCCESS; + } + +diff --git a/omapip/message.c b/omapip/message.c +index ee15d821..37abbd25 100644 +--- a/omapip/message.c ++++ b/omapip/message.c +@@ -339,7 +339,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo) + } + + #ifdef DEBUG_PROTOCOL +-static const char *omapi_message_op_name(int op) { ++const char *omapi_message_op_name(int op) { + switch (op) { + case OMAPI_OP_OPEN: return "OMAPI_OP_OPEN"; + case OMAPI_OP_REFRESH: return "OMAPI_OP_REFRESH"; +-- +2.16.2 + diff --git a/src/isc-dhcp/patch/0009-CVE-2018-5733.patch b/src/isc-dhcp/patch/0009-CVE-2018-5733.patch new file mode 100644 index 0000000000..99017fc983 --- /dev/null +++ b/src/isc-dhcp/patch/0009-CVE-2018-5733.patch @@ -0,0 +1,131 @@ +From: Thomas Markwalder +Date: Fri, 9 Feb 2018 14:46:08 -0500 +Subject: [master] Corrected refcnt loss in option parsing +Origin: https://source.isc.org/cgi-bin/gitweb.cgi?p=dhcp.git;a=commit;h=197b26f25309f947b97a83b8fdfc414b767798f8 +Bug: https://bugs.isc.org/Public/Bug/Display.html?id=47140 +Bug-Debian: https://bugs.debian.org/891785 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5733 + + Merges in 47140. +--- + +--- a/common/options.c ++++ b/common/options.c +@@ -177,6 +177,8 @@ int parse_option_buffer (options, buffer + + /* If the length is outrageous, the options are bad. */ + if (offset + len > length) { ++ /* Avoid reference count overflow */ ++ option_dereference(&option, MDL); + reason = "option length exceeds option buffer length"; + bogus: + log_error("parse_option_buffer: malformed option " +--- a/common/tests/Makefile.am ++++ b/common/tests/Makefile.am +@@ -10,7 +10,8 @@ ATF_TESTS = + + if HAVE_ATF + +-ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest ++ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest \ ++ option_unittest + + alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c + alloc_unittest_LDADD = $(ATF_LDFLAGS) +@@ -36,6 +37,14 @@ ns_name_unittest_LDADD += ../libdhcp.a + ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \ + $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a + ++option_unittest_SOURCES = option_unittest.c $(top_srcdir)/tests/t_api_dhcp.c ++option_unittest_LDADD = $(ATF_LDFLAGS) ++option_unittest_LDADD += ../libdhcp.@A@ ../../omapip/libomapi.@A@ \ ++ @BINDLIBIRSDIR@/libirs.@A@ \ ++ @BINDLIBDNSDIR@/libdns.@A@ \ ++ @BINDLIBISCCFGDIR@/libisccfg.@A@ \ ++ @BINDLIBISCDIR@/libisc.@A@ ++ + check: $(ATF_TESTS) + @if test $(top_srcdir) != ${top_builddir}; then \ + cp $(top_srcdir)/common/tests/Atffile Atffile; \ +--- /dev/null ++++ b/common/tests/option_unittest.c +@@ -0,0 +1,79 @@ ++/* ++ * Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") ++ * ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH ++ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ++ * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, ++ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ++ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE ++ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ++ * PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++#include ++#include "dhcpd.h" ++ ++ATF_TC(option_refcnt); ++ ++ATF_TC_HEAD(option_refcnt, tc) ++{ ++ atf_tc_set_md_var(tc, "descr", ++ "Verify option reference count does not overflow."); ++} ++ ++/* This test does a simple check to see if option reference count is ++ * decremented even an error path exiting parse_option_buffer() ++ */ ++ATF_TC_BODY(option_refcnt, tc) ++{ ++ struct option_state *options; ++ struct option *option; ++ unsigned code; ++ int refcnt; ++ unsigned char buffer[3] = { 15, 255, 0 }; ++ ++ initialize_common_option_spaces(); ++ ++ options = NULL; ++ if (!option_state_allocate(&options, MDL)) { ++ atf_tc_fail("can't allocate option state"); ++ } ++ ++ option = NULL; ++ code = 15; /* domain-name */ ++ if (!option_code_hash_lookup(&option, dhcp_universe.code_hash, ++ &code, 0, MDL)) { ++ atf_tc_fail("can't find option 15"); ++ } ++ if (option == NULL) { ++ atf_tc_fail("option is NULL"); ++ } ++ refcnt = option->refcnt; ++ ++ buffer[0] = 15; ++ buffer[1] = 255; /* invalid */ ++ buffer[2] = 0; ++ ++ if (parse_option_buffer(options, buffer, 3, &dhcp_universe)) { ++ atf_tc_fail("parse_option_buffer is expected to fail"); ++ } ++ ++ if (refcnt != option->refcnt) { ++ atf_tc_fail("refcnt changed from %d to %d", refcnt, option->refcnt); ++ } ++} ++ ++/* This macro defines main() method that will call specified ++ test cases. tp and simple_test_case names can be whatever you want ++ as long as it is a valid variable identifier. */ ++ATF_TP_ADD_TCS(tp) ++{ ++ ATF_TP_ADD_TC(tp, option_refcnt); ++ ++ return (atf_no_error()); ++} diff --git a/src/isc-dhcp/patch/0010-CVE-2018-5732.patch b/src/isc-dhcp/patch/0010-CVE-2018-5732.patch new file mode 100644 index 0000000000..d6c10e2e65 --- /dev/null +++ b/src/isc-dhcp/patch/0010-CVE-2018-5732.patch @@ -0,0 +1,144 @@ +From: Thomas Markwalder +Date: Sat, 10 Feb 2018 12:15:27 -0500 +Subject: [master] Correct buffer overrun in pretty_print_option +Origin: https://source.isc.org/cgi-bin/gitweb.cgi?p=dhcp.git;a=commit;h=c5931725b48b121d232df4ba9e45bc41e0ba114d +Bug: https://bugs.isc.org/Public/Bug/Display.html?id=47139 +Bug-Debian: https://bugs.debian.org/891786 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2018-5732 + + Merges in rt47139. +--- + +diff --git a/common/options.c b/common/options.c +index 6f23bc15..fc0e0889 100644 +--- a/common/options.c ++++ b/common/options.c +@@ -1776,7 +1776,8 @@ format_min_length(format, oc) + + + /* Format the specified option so that a human can easily read it. */ +- ++/* Maximum pretty printed size */ ++#define MAX_OUTPUT_SIZE 32*1024 + const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) + struct option *option; + const unsigned char *data; +@@ -1784,8 +1785,9 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) + int emit_commas; + int emit_quotes; + { +- static char optbuf [32768]; /* XXX */ +- static char *endbuf = &optbuf[sizeof(optbuf)]; ++ /* We add 128 byte pad so we don't have to add checks everywhere. */ ++ static char optbuf [MAX_OUTPUT_SIZE + 128]; /* XXX */ ++ static char *endbuf = optbuf + MAX_OUTPUT_SIZE; + int hunksize = 0; + int opthunk = 0; + int hunkinc = 0; +@@ -2211,7 +2213,14 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes) + log_error ("Unexpected format code %c", + fmtbuf [j]); + } ++ + op += strlen (op); ++ if (op >= endbuf) { ++ log_error ("Option data exceeds" ++ " maximum size %d", MAX_OUTPUT_SIZE); ++ return (""); ++ } ++ + if (dp == data + len) + break; + if (j + 1 < numelem && comma != ':') +diff --git a/common/tests/option_unittest.c b/common/tests/option_unittest.c +index 36236b84..cd52cfb4 100644 +--- a/common/tests/option_unittest.c ++++ b/common/tests/option_unittest.c +@@ -43,7 +43,7 @@ ATF_TC_BODY(option_refcnt, tc) + if (!option_state_allocate(&options, MDL)) { + atf_tc_fail("can't allocate option state"); + } +- ++ + option = NULL; + code = 15; /* domain-name */ + if (!option_code_hash_lookup(&option, dhcp_universe.code_hash, +@@ -68,12 +68,75 @@ ATF_TC_BODY(option_refcnt, tc) + } + } + ++ATF_TC(pretty_print_option); ++ ++ATF_TC_HEAD(pretty_print_option, tc) ++{ ++ atf_tc_set_md_var(tc, "descr", ++ "Verify pretty_print_option does not overrun its buffer."); ++} ++ ++ ++/* ++ * This test verifies that pretty_print_option() will not overrun its ++ * internal, static buffer when given large 'x/X' format options. ++ * ++ */ ++ATF_TC_BODY(pretty_print_option, tc) ++{ ++ struct option *option; ++ unsigned code; ++ unsigned char bad_data[32*1024]; ++ unsigned char good_data[] = { 1,2,3,4,5,6 }; ++ int emit_commas = 1; ++ int emit_quotes = 1; ++ const char *output_buf; ++ ++ /* Initialize whole thing to non-printable chars */ ++ memset(bad_data, 0x1f, sizeof(bad_data)); ++ ++ initialize_common_option_spaces(); ++ ++ /* We'll use dhcp_client_identitifer because it happens to be format X */ ++ code = 61; ++ option = NULL; ++ if (!option_code_hash_lookup(&option, dhcp_universe.code_hash, ++ &code, 0, MDL)) { ++ atf_tc_fail("can't find option %d", code); ++ } ++ ++ if (option == NULL) { ++ atf_tc_fail("option is NULL"); ++ } ++ ++ /* First we will try a good value we know should fit. */ ++ output_buf = pretty_print_option (option, good_data, sizeof(good_data), ++ emit_commas, emit_quotes); ++ ++ /* Make sure we get what we expect */ ++ if (!output_buf || strcmp(output_buf, "1:2:3:4:5:6")) { ++ atf_tc_fail("pretty_print_option did not return \"\""); ++ } ++ ++ ++ /* Now we'll try a data value that's too large */ ++ output_buf = pretty_print_option (option, bad_data, sizeof(bad_data), ++ emit_commas, emit_quotes); ++ ++ /* Make sure we safely get an error */ ++ if (!output_buf || strcmp(output_buf, "")) { ++ atf_tc_fail("pretty_print_option did not return \"\""); ++ } ++} ++ ++ + /* This macro defines main() method that will call specified + test cases. tp and simple_test_case names can be whatever you want + as long as it is a valid variable identifier. */ + ATF_TP_ADD_TCS(tp) + { + ATF_TP_ADD_TC(tp, option_refcnt); ++ ATF_TP_ADD_TC(tp, pretty_print_option); + + return (atf_no_error()); + } +-- +2.16.2 + diff --git a/src/isc-dhcp/patch/series b/src/isc-dhcp/patch/series index 9f7164f5c4..4da1b494ae 100644 --- a/src/isc-dhcp/patch/series +++ b/src/isc-dhcp/patch/series @@ -3,4 +3,9 @@ 0002-Customizable-Option-82-circuit-ID-and-remote-ID-fiel.patch 0003-Support-for-obtaining-name-of-physical-interface-tha.patch 0004-Support-for-loading-port-alias-map-file-to-replace-p.patch - +0005-Add-enable-use-sockets-to-configure-flags-in-debian-.patch +0006-Bugfix-Ensure-HAVE_SO_BINDTODEVICE-has-a-chance-to-b.patch +0007-If-destination-of-BOOTREQUEST-is-directed-broadcast-.patch +0008-CVE-2017-3144.patch +0009-CVE-2018-5733.patch +0010-CVE-2018-5732.patch diff --git a/src/libteam/0001-libteam-Add-team_get_port_enabled-function.patch b/src/libteam/0001-libteam-Add-team_get_port_enabled-function.patch deleted file mode 100644 index 9bf08ce613..0000000000 --- a/src/libteam/0001-libteam-Add-team_get_port_enabled-function.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 2f9248dd07d51361bc0a93ef70d0f8ac2631af35 Mon Sep 17 00:00:00 2001 -From: Shuotian Cheng -Date: Fri, 20 Jan 2017 12:10:13 -0800 -Subject: [PATCH] libteam: Add team_get_port_enabled function - ---- - include/team.h | 2 ++ - libteam/libteam.c | 22 ++++++++++++++++++++++ - 2 files changed, 24 insertions(+) - -diff --git a/include/team.h b/include/team.h -index 20ebcf6..9ae517d 100644 ---- a/include/team.h -+++ b/include/team.h -@@ -68,6 +68,8 @@ int team_get_bpf_hash_func(struct team_handle *th, struct sock_fprog *fp); - int team_set_bpf_hash_func(struct team_handle *th, const struct sock_fprog *fp); - int team_set_port_enabled(struct team_handle *th, - uint32_t port_ifindex, bool val); -+int team_get_port_enabled(struct team_handle *th, -+ uint32_t port_ifindex, bool *enabled); - int team_set_port_user_linkup_enabled(struct team_handle *th, - uint32_t port_ifindex, bool val); - int team_get_port_user_linkup(struct team_handle *th, -diff --git a/libteam/libteam.c b/libteam/libteam.c -index ac187aa..106e5cf 100644 ---- a/libteam/libteam.c -+++ b/libteam/libteam.c -@@ -1295,6 +1295,28 @@ int team_set_port_enabled(struct team_handle *th, - /** - * @param th libteam library context - * @param port_ifindex port interface index -+ * @param enabled where the enabled state will be stored -+ * -+ * @details Gets enabled state for port identified by port_ifindex -+ * -+ * @return Zero on success or negative number in case of an error. -+ **/ -+TEAM_EXPORT -+int team_get_port_enabled(struct team_handle *th, -+ uint32_t port_ifindex, bool *enabled) -+{ -+ struct team_option *option; -+ -+ option = team_get_option(th, "np", "enabled", port_ifindex); -+ if (!option) -+ return -ENOENT; -+ *enabled = team_get_option_value_bool(option); -+ return 0; -+} -+ -+/** -+ * @param th libteam library context -+ * @param port_ifindex port interface index - * @param val boolean value - * - * @details Enables or disable user linkup for port identified by port_ifindex --- -2.1.4 - diff --git a/src/libteam/0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch b/src/libteam/0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch deleted file mode 100644 index 8a59756bb0..0000000000 --- a/src/libteam/0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 43e512b114176feb1828ff0a75f0224f2b219a2d Mon Sep 17 00:00:00 2001 -From: Jipan Yang -Date: Sun, 24 Feb 2019 00:04:15 -0800 -Subject: [PATCH] Skip setting the same hwaddr to lag port to avoid disrupting - neighbor entries - -Signed-off-by: Jipan Yang ---- - teamd/teamd.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/teamd/teamd.c b/teamd/teamd.c -index 225b8c8..e28aa7d 100644 ---- a/teamd/teamd.c -+++ b/teamd/teamd.c -@@ -866,7 +866,16 @@ static int teamd_set_hwaddr(struct teamd_context *ctx) - err = -EINVAL; - goto free_hwaddr; - } -- err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len); -+ -+ if(!memcmp(hwaddr, ctx->hwaddr, hwaddr_len)) -+ { -+ err = 0; -+ teamd_log_dbg("Skip setting same hwaddr string: \"%s\".", hwaddr_str); -+ } -+ else -+ { -+ err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len); -+ } - if (!err) - ctx->hwaddr_explicit = true; - free_hwaddr: --- -2.9.2 - diff --git a/src/libteam/0010-teamd-lacp-update-port-state-according-to-partners-sy.patch b/src/libteam/0010-teamd-lacp-update-port-state-according-to-partners-sy.patch deleted file mode 100644 index 33e6140bab..0000000000 --- a/src/libteam/0010-teamd-lacp-update-port-state-according-to-partners-sy.patch +++ /dev/null @@ -1,71 +0,0 @@ -commit 15b56de0f309c942f0f3a588f40944d078db97f9 -Author: Pavel Shirshov -Date: Tue Apr 16 12:18:12 2019 -0700 - - teamd: lacp: update port state according to partner's sync bit - - Backport of - https://github.com/jpirko/libteam/commit/54f137c10579bf97800c61ebb13e732aa1d843e6#diff-f17610bfcc2bafe661a9f3ba496ebf12 - - According to 6.4.15 of IEEE 802.1AX-2014, Figure 6-22, the state that the - port is selected moves MUX state from DETACHED to ATTACHED. - - But ATTACHED state does not mean that the port can send and receive user - frames. COLLECTING_DISTRIBUTION state is the state that the port can send - and receive user frames. To move MUX state from ATTACHED to - COLLECTING_DISTRIBUTION, the partner state should be sync as well as the - port selected. - - In function lacp_port_actor_update(), only INFO_STATE_SYNCHRONIZATION - should be set to the actor.state when the port is selected. - INFO_STATE_COLLECTING and INFO_STATE_DISTRIBUTING should be set to false - with ATTACHED mode and set to true when INFO_STATE_SYNCHRONIZATION of - partner.state is set. - - In function lacp_port_should_be_{enabled, disabled}(), we also need to - check the INFO_STATE_SYNCHRONIZATION bit of partner.state. - - Signed-off-by: Hangbin Liu - Signed-off-by: Jiri Pirko - -diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index dae9086..5fa026a 100644 ---- a/teamd/teamd_runner_lacp.c -+++ b/teamd/teamd_runner_lacp.c -@@ -361,7 +361,8 @@ static int lacp_port_should_be_enabled(struct lacp_port *lacp_port) - struct lacp *lacp = lacp_port->lacp; - - if (lacp_port_selected(lacp_port) && -- lacp_port->agg_lead == lacp->selected_agg_lead) -+ lacp_port->agg_lead == lacp->selected_agg_lead && -+ lacp_port->partner.state & INFO_STATE_SYNCHRONIZATION) - return true; - return false; - } -@@ -371,7 +372,8 @@ static int lacp_port_should_be_disabled(struct lacp_port *lacp_port) - struct lacp *lacp = lacp_port->lacp; - - if (!lacp_port_selected(lacp_port) || -- lacp_port->agg_lead != lacp->selected_agg_lead) -+ lacp_port->agg_lead != lacp->selected_agg_lead || -+ !(lacp_port->partner.state & INFO_STATE_SYNCHRONIZATION)) - return true; - return false; - } -@@ -966,9 +968,14 @@ static void lacp_port_actor_update(struct lacp_port *lacp_port) - state |= INFO_STATE_LACP_ACTIVITY; - if (lacp_port->lacp->cfg.fast_rate) - state |= INFO_STATE_LACP_TIMEOUT; -- if (lacp_port_selected(lacp_port)) -+ if (lacp_port_selected(lacp_port) && -+ lacp_port_agg_selected(lacp_port)) { - state |= INFO_STATE_SYNCHRONIZATION; -- state |= INFO_STATE_COLLECTING | INFO_STATE_DISTRIBUTING; -+ state &= ~(INFO_STATE_COLLECTING | INFO_STATE_DISTRIBUTING); -+ if (lacp_port->partner.state & INFO_STATE_SYNCHRONIZATION) -+ state |= INFO_STATE_COLLECTING | -+ INFO_STATE_DISTRIBUTING; -+ } - if (lacp_port->state == PORT_STATE_EXPIRED) - state |= INFO_STATE_EXPIRED; - if (lacp_port->state == PORT_STATE_DEFAULTED) diff --git a/src/libteam/0011-libteam-resynchronize-ifinfo-after-lost-RTNLGRP_LINK-.patch b/src/libteam/0011-libteam-resynchronize-ifinfo-after-lost-RTNLGRP_LINK-.patch deleted file mode 100644 index fcda983011..0000000000 --- a/src/libteam/0011-libteam-resynchronize-ifinfo-after-lost-RTNLGRP_LINK-.patch +++ /dev/null @@ -1,302 +0,0 @@ -commit 046fb6ba0aec8246075b18d787daec43201566fa -Author: Antti Tiainen -Date: Mon Feb 6 15:41:05 2017 +0200 - - libteam: resynchronize ifinfo after lost RTNLGRP_LINK notifications - - When there's a large number of interfaces (e.g. vlans), teamd loses - link notifications as it cannot read them as fast as kernel is - broadcasting them. This often prevents teamd starting properly if - started concurrently when other links are being set up. It can also - fail when it's up and running, especially in the cases where the team - device itself has a lot of vlans under it. - - This can easily be reproduces by simple example (in SMP system) by - manually adding team device with a bunch of vlans, putting it up, - and starting teamd with --take-over option: - - root@debian:~# ip link add name team0 type team - root@debian:~# for i in `seq 100 150` ; do - > ip link add link team0 name team0.$i type vlan id $i ; done - root@debian:~# ip link set team0 up - root@debian:~# cat teamd.conf - { - "device": "team0", - "runner": { - "name": "activebackup" - }, - "ports": { - "eth1": {}, - "eth2": {} - } - } - root@debian:~# teamd -o -N -f teamd.conf - - At this point, teamd will not give any error messages or other - indication that something is wrong. But state will not look healthy: - - root@debian:~# teamdctl team0 state - setup: - runner: activebackup - ports: - eth1 - link watches: - link summary: up - instance[link_watch_0]: - name: ethtool - link: up - down count: 0 - Failed to parse JSON port dump. - command call failed (Invalid argument) - - If checking state dump, it will show that port eth2 is missing info. - Running strace to teamd will reveal that there's one recvmsgs() that - returned -1 with errno ENOBUFS. What happened in this example was - that when teamd started, all vlans got carrier up, and kernel flooded - notifications faster than teamd could read them. It then lost events - related to port eth2 getting enslaved and up. - - The socket that joins RTNLGRP_LINK notifications uses default libnl - 32k buffer size. Netlink messages are large (over 1k), and this buffer - gets easily full. Kernel neither knows nor cares were notification - broadcasts delivered. This cannot be fixed by simply increasing the - buffer size, as there's no size that is guaranteed to work in every - use case, and this can require several megabytes of buffer (a way over - normal rmem_max limit) if there are hunderds of vlans. - - Only way to recover from this is to refresh all ifinfo list, as it's - invalidated at this point. It cannot easily work around of this by - just refreshing team device and its ports, because library side might - not have ports linked due to events missed, and it doesn't know about - teamd configuration. - - Checks now return value of nl_recvmsgs_default() for event socket. In - case of ENOBUFS (which libnl nicely changes to ENOMEM), refreshes - all ifinfo list. get_ifinfo_list() also checks now for removed interfaces - in case of missed dellink event. Currently all TEAM_IFINFO_CHANGE - handlers processed events one by one, so it had to be changed to support - multiple ifinfo changes. For this, ifinfo changed flags are cleared - and removed entries destroyed only after all handlers have been called. - - Also, increased nl_cli.sock_event receive buffers to 96k like all other - sockets. Added possibility to change this via environment variable. - - Signed-off-by: Antti Tiainen - Signed-off-by: Jiri Pirko - -diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c -index 72155ae..5c32a9c 100644 ---- a/libteam/ifinfo.c -+++ b/libteam/ifinfo.c -@@ -72,6 +72,10 @@ struct team_ifinfo { - #define CHANGED_PHYS_PORT_ID (1 << 5) - #define CHANGED_PHYS_PORT_ID_LEN (1 << 6) - #define CHANGED_ADMIN_STATE (1 << 7) -+/* This is only used when tagging interfaces for finding -+ * removed, and thus not included to CHANGED_ANY. -+ */ -+#define CHANGED_REFRESHING (1 << 8) - #define CHANGED_ANY (CHANGED_REMOVED | CHANGED_HWADDR | \ - CHANGED_HWADDR_LEN | CHANGED_IFNAME | \ - CHANGED_MASTER_IFINDEX | CHANGED_PHYS_PORT_ID | \ -@@ -202,7 +206,7 @@ static struct team_ifinfo *ifinfo_find(struct team_handle *th, uint32_t ifindex) - return NULL; - } - --static void clear_last_changed(struct team_handle *th) -+void ifinfo_clear_changed(struct team_handle *th) - { - struct team_ifinfo *ifinfo; - -@@ -236,7 +240,7 @@ static void ifinfo_destroy(struct team_ifinfo *ifinfo) - free(ifinfo); - } - --static void ifinfo_destroy_removed(struct team_handle *th) -+void ifinfo_destroy_removed(struct team_handle *th) - { - struct team_ifinfo *ifinfo, *tmp; - -@@ -254,8 +258,6 @@ static void obj_input_newlink(struct nl_object *obj, void *arg, bool event) - uint32_t ifindex; - int err; - -- ifinfo_destroy_removed(th); -- - link = (struct rtnl_link *) obj; - - ifindex = rtnl_link_get_ifindex(link); -@@ -269,7 +271,7 @@ static void obj_input_newlink(struct nl_object *obj, void *arg, bool event) - return; - } - -- clear_last_changed(th); -+ clear_changed(ifinfo); - ifinfo_update(ifinfo, link); - - if (event) -@@ -292,8 +294,6 @@ static void event_handler_obj_input_dellink(struct nl_object *obj, void *arg) - uint32_t ifindex; - int err; - -- ifinfo_destroy_removed(th); -- - link = (struct rtnl_link *) obj; - - ifindex = rtnl_link_get_ifindex(link); -@@ -311,7 +311,7 @@ static void event_handler_obj_input_dellink(struct nl_object *obj, void *arg) - return; - } - -- clear_last_changed(th); -+ clear_changed(ifinfo); - set_changed(ifinfo, CHANGED_REMOVED); - set_call_change_handlers(th, TEAM_IFINFO_CHANGE); - } -@@ -367,6 +367,14 @@ int get_ifinfo_list(struct team_handle *th) - }; - int ret; - int retry = 1; -+ struct team_ifinfo *ifinfo; -+ -+ /* Tag all ifinfo, this is cleared in newlink handler. -+ * Any interface that has this after dump is processed -+ * has been removed. -+ */ -+ list_for_each_node_entry(ifinfo, &th->ifinfo_list, list) -+ set_changed(ifinfo, CHANGED_REFRESHING); - - while (retry) { - retry = 0; -@@ -395,6 +403,15 @@ int get_ifinfo_list(struct team_handle *th) - retry = 1; - } - } -+ -+ list_for_each_node_entry(ifinfo, &th->ifinfo_list, list) { -+ if (is_changed(ifinfo, CHANGED_REFRESHING)) { -+ clear_changed(ifinfo); -+ set_changed(ifinfo, CHANGED_REMOVED); -+ set_call_change_handlers(th, TEAM_IFINFO_CHANGE); -+ } -+ } -+ - ret = check_call_change_handlers(th, TEAM_IFINFO_CHANGE); - if (ret < 0) - err(th, "get_ifinfo_list: check_call_change_handers failed"); -diff --git a/libteam/libteam.c b/libteam/libteam.c -index ac187aa..d5f22cd 100644 ---- a/libteam/libteam.c -+++ b/libteam/libteam.c -@@ -236,6 +236,10 @@ int check_call_change_handlers(struct team_handle *th, - break; - } - } -+ if (call_type_mask & TEAM_IFINFO_CHANGE) { -+ ifinfo_destroy_removed(th); -+ ifinfo_clear_changed(th); -+ } - th->change_handler.pending_type_mask &= ~call_type_mask; - return err; - } -@@ -546,6 +550,11 @@ int team_destroy(struct team_handle *th) - #endif - /* \endcond */ - -+/* libnl uses default 32k socket receive buffer size, -+ * whicn can get too small. Use 96k for all sockets. -+ */ -+#define NETLINK_RCVBUF 983040 -+ - /** - * @param th libteam library context - * @param ifindex team device interface index -@@ -561,6 +570,8 @@ int team_init(struct team_handle *th, uint32_t ifindex) - int err; - int grp_id; - int val; -+ int eventbufsize; -+ const char *env; - - if (!ifindex) { - err(th, "Passed interface index %d is not valid.", ifindex); -@@ -589,12 +600,12 @@ int team_init(struct team_handle *th, uint32_t ifindex) - return -errno; - } - -- err = nl_socket_set_buffer_size(th->nl_sock, 98304, 0); -+ err = nl_socket_set_buffer_size(th->nl_sock, NETLINK_RCVBUF, 0); - if (err) { - err(th, "Failed to set buffer size of netlink sock."); - return -nl2syserr(err); - } -- err = nl_socket_set_buffer_size(th->nl_sock_event, 98304, 0); -+ err = nl_socket_set_buffer_size(th->nl_sock_event, NETLINK_RCVBUF, 0); - if (err) { - err(th, "Failed to set buffer size of netlink event sock."); - return -nl2syserr(err); -@@ -627,6 +638,25 @@ int team_init(struct team_handle *th, uint32_t ifindex) - nl_socket_modify_cb(th->nl_cli.sock_event, NL_CB_VALID, - NL_CB_CUSTOM, cli_event_handler, th); - nl_cli_connect(th->nl_cli.sock_event, NETLINK_ROUTE); -+ -+ env = getenv("TEAM_EVENT_BUFSIZE"); -+ if (env) { -+ eventbufsize = strtol(env, NULL, 10); -+ /* ignore other errors, libnl forces minimum 32k and -+ * too large values are truncated to system rmem_max -+ */ -+ if (eventbufsize < 0) -+ eventbufsize = 0; -+ } else { -+ eventbufsize = NETLINK_RCVBUF; -+ } -+ -+ err = nl_socket_set_buffer_size(th->nl_cli.sock_event, eventbufsize, 0); -+ if (err) { -+ err(th, "Failed to set cli event socket buffer size."); -+ return err; -+ } -+ - err = nl_socket_add_membership(th->nl_cli.sock_event, RTNLGRP_LINK); - if (err < 0) { - err(th, "Failed to add netlink membership."); -@@ -767,7 +797,23 @@ static int get_cli_sock_event_fd(struct team_handle *th) - - static int cli_sock_event_handler(struct team_handle *th) - { -- nl_recvmsgs_default(th->nl_cli.sock_event); -+ int err; -+ -+ err = nl_recvmsgs_default(th->nl_cli.sock_event); -+ err = -nl2syserr(err); -+ -+ /* libnl thinks ENOBUFS and ENOMEM are same. Hope it was ENOBUFS. */ -+ if (err == -ENOMEM) { -+ warn(th, "Lost link notifications from kernel."); -+ /* There's no way to know what events were lost and no -+ * way to get them again. Refresh all. -+ */ -+ err = get_ifinfo_list(th); -+ } -+ -+ if (err) -+ return err; -+ - return check_call_change_handlers(th, TEAM_IFINFO_CHANGE); - } - -diff --git a/libteam/team_private.h b/libteam/team_private.h -index a07632f..a5eb0be 100644 ---- a/libteam/team_private.h -+++ b/libteam/team_private.h -@@ -115,6 +115,9 @@ int ifinfo_link_with_port(struct team_handle *th, uint32_t ifindex, - int ifinfo_link(struct team_handle *th, uint32_t ifindex, - struct team_ifinfo **p_ifinfo); - void ifinfo_unlink(struct team_ifinfo *ifinfo); -+void ifinfo_clear_changed(struct team_handle *th); -+void ifinfo_destroy_removed(struct team_handle *th); -+int get_ifinfo_list(struct team_handle *th); - int get_options_handler(struct nl_msg *msg, void *arg); - int option_list_alloc(struct team_handle *th); - int option_list_init(struct team_handle *th); diff --git a/src/libteam/0012-teamd-do-not-process-lacpdu-before-the-port-ifinfo-i.patch b/src/libteam/0012-teamd-do-not-process-lacpdu-before-the-port-ifinfo-i.patch deleted file mode 100644 index db29825fb9..0000000000 --- a/src/libteam/0012-teamd-do-not-process-lacpdu-before-the-port-ifinfo-i.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 28ccb37eb388e7e3d214a9b05011f8421f0d65ac Mon Sep 17 00:00:00 2001 -From: Ying Xie -Date: Fri, 26 Apr 2019 23:30:38 +0000 -Subject: [PATCH] teamd: do not process lacpdu before the port ifinfo is set - -Now the port ifinfo will be set in obj_input_newlink when a RTM_NEWLINK -event is received. - -But when a port is being added, if a lacpdu gets received on this port -before the RTM_NEWLINK event, lacpdu_recv will process the packet with -incorrect port ifinfo. - -In Patrick's case, as ifinfo->master_ifindex was 0, it would skip this -port in teamd_for_each_tdport, which caused lacp_port->agg_lead not to -be updated in lacp_switch_agg_lead. Later the lacp_port actor would go -to a unexpected state. - -This patch is to avoid it by checking teamd_port_present in lacpdu_recv -so that it would not process lacpdu before the port ifinfo is set. - -Reported-by: Patrick Talbert -Tested-by: Patrick Talbert -Signed-off-by: Xin Long -Reviewed-by: Marcelo Ricardo Leitner -Signed-off-by: Jiri Pirko ---- - teamd/teamd_runner_lacp.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 78f05dd..c8ae541 100644 ---- a/teamd/teamd_runner_lacp.c -+++ b/teamd/teamd_runner_lacp.c -@@ -1132,6 +1132,9 @@ static int lacpdu_process(struct lacp_port *lacp_port, struct lacpdu* lacpdu) - { - int err; - -+ if (!teamd_port_present(lacp_port->ctx, lacp_port->tdport)) -+ return 0; -+ - if (!lacpdu_check(lacpdu)) { - teamd_log_warn("malformed LACP PDU came."); - return 0; --- -2.7.4 - diff --git a/src/libteam/0013-teamd-lacp-port-admin-down-recv-not-processing.patch b/src/libteam/0013-teamd-lacp-port-admin-down-recv-not-processing.patch deleted file mode 100644 index 6e6c37e096..0000000000 --- a/src/libteam/0013-teamd-lacp-port-admin-down-recv-not-processing.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 4a3fe6b..19592c5 100644 ---- a/teamd/teamd_runner_lacp.c -+++ b/teamd/teamd_runner_lacp.c -@@ -1182,12 +1182,17 @@ static int lacpdu_recv(struct lacp_port *lacp_port) - struct lacpdu lacpdu; - struct sockaddr_ll ll_from; - int err; -+ bool admin_state; - - err = teamd_recvfrom(lacp_port->sock, &lacpdu, sizeof(lacpdu), 0, - (struct sockaddr *) &ll_from, sizeof(ll_from)); - if (err <= 0) - return err; - -+ admin_state = team_get_ifinfo_admin_state(lacp_port->ctx->ifinfo); -+ if (!admin_state) -+ return 0; -+ - return lacpdu_process(lacp_port, &lacpdu); - } - diff --git a/src/libteam/Makefile b/src/libteam/Makefile index 256680d349..15730885a8 100644 --- a/src/libteam/Makefile +++ b/src/libteam/Makefile @@ -12,17 +12,17 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : rm -rf ./libteam git clone https://github.com/jpirko/libteam.git pushd ./libteam - git checkout -b teamd -f v1.26 + git checkout -b teamd -f 5c5e498bff9 # Apply patch series stg init - stg import -s ../series + stg import -s ../patch/series popd # Obtain debian packaging git clone https://salsa.debian.org/debian/libteam.git tmp pushd ./tmp - git checkout -f da006f2 # v1.26 + git checkout -f 7188c361 # v1.28-1 popd mv tmp/debian libteam/ diff --git a/src/libteam/0002-libteam-Temporarily-remove-redundant-debug-mes.patch b/src/libteam/patch/0001-libteam-Temporarily-remove-redundant-debug-messages.patch similarity index 70% rename from src/libteam/0002-libteam-Temporarily-remove-redundant-debug-mes.patch rename to src/libteam/patch/0001-libteam-Temporarily-remove-redundant-debug-messages.patch index a640f40e6e..d922c91c42 100644 --- a/src/libteam/0002-libteam-Temporarily-remove-redundant-debug-mes.patch +++ b/src/libteam/patch/0001-libteam-Temporarily-remove-redundant-debug-messages.patch @@ -1,17 +1,17 @@ -From a5c8f3f41c575ebb7018e67cb3d1f724f0685850 Mon Sep 17 00:00:00 2001 +From 10602c2b1184aa0c6907b5a7f06fcba8a7141148 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Mon, 27 Feb 2017 14:21:09 -0800 -Subject: [PATCH] libteam: Temporarily remove redundant debug messages +Subject: [PATCH 1/8] libteam: Temporarily remove redundant debug messages --- teamd/teamd_runner_lacp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 9c77fae..5e37a4c 100644 +index d292d69..7c91aed 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c -@@ -922,8 +922,6 @@ static void lacp_port_actor_update(struct lacp_port *lacp_port) +@@ -929,8 +929,6 @@ static void lacp_port_actor_update(struct lacp_port *lacp_port) state |= INFO_STATE_DEFAULTED; if (teamd_port_count(lacp_port->ctx) > 0) state |= INFO_STATE_AGGREGATION; @@ -21,5 +21,5 @@ index 9c77fae..5e37a4c 100644 } -- -2.1.4 +2.7.4 diff --git a/src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch b/src/libteam/patch/0002-teamd-lacp-runner-will-send-lacp-update-right-after-.patch similarity index 67% rename from src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch rename to src/libteam/patch/0002-teamd-lacp-runner-will-send-lacp-update-right-after-.patch index 1cae8bad21..c4e7825710 100644 --- a/src/libteam/0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch +++ b/src/libteam/patch/0002-teamd-lacp-runner-will-send-lacp-update-right-after-.patch @@ -1,21 +1,23 @@ -From 417e9dfdccbbee2cf86e46e994e8ece3433b46a4 Mon Sep 17 00:00:00 2001 -From: Pavel Shirshov -Date: Wed, 20 Sep 2017 00:34:07 +0000 -Subject: [PATCH] [teamd] lacp runner will send lacp update right after it - received SIGINT signal +From 0ce56490a44191c4b17a75cc21aa6a5bdc535f1d Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 11:58:19 +0800 +Subject: [PATCH 2/8] [teamd] lacp runner will send lacp update right after it + received SIGINT signal From: Pavel Shirshov + Date: Wed, 20 Sep 2017 00:34:07 +0000 +Signed-off-by: yorke --- teamd/teamd.c | 1 + teamd/teamd.h | 3 +++ teamd/teamd_events.c | 13 +++++++++++++ - teamd/teamd_runner_lacp.c | 10 ++++++++++ - 4 files changed, 27 insertions(+) + teamd/teamd_runner_lacp.c | 11 +++++++++++ + 4 files changed, 28 insertions(+) diff --git a/teamd/teamd.c b/teamd/teamd.c -index aac2511..c987333 100644 +index 6c47312..58d4fc8 100644 --- a/teamd/teamd.c +++ b/teamd/teamd.c -@@ -386,6 +386,7 @@ static int teamd_run_loop_run(struct teamd_context *ctx) +@@ -392,6 +392,7 @@ static int teamd_run_loop_run(struct teamd_context *ctx) case 'q': if (quit_in_progress) return -EBUSY; @@ -24,13 +26,13 @@ index aac2511..c987333 100644 if (err) return err; diff --git a/teamd/teamd.h b/teamd/teamd.h -index 5dbfb9b..ef0fb1c 100644 +index 01bd022..e71a5dc 100644 --- a/teamd/teamd.h +++ b/teamd/teamd.h -@@ -189,11 +189,14 @@ struct teamd_event_watch_ops { - struct teamd_port *tdport, void *priv); - int (*port_ifname_changed)(struct teamd_context *ctx, - struct teamd_port *tdport, void *priv); +@@ -193,11 +193,14 @@ struct teamd_event_watch_ops { + int (*port_master_ifindex_changed)(struct teamd_context *ctx, + struct teamd_port *tdport, + void *priv); + void (*refresh)(struct teamd_context *ctx, + struct teamd_port *tdport, void *priv); int (*option_changed)(struct teamd_context *ctx, @@ -43,7 +45,7 @@ index 5dbfb9b..ef0fb1c 100644 struct teamd_port *tdport); void teamd_event_port_removed(struct teamd_context *ctx, diff --git a/teamd/teamd_events.c b/teamd/teamd_events.c -index 1a95974..5c2ef56 100644 +index 65aa46a..221803e 100644 --- a/teamd/teamd_events.c +++ b/teamd/teamd_events.c @@ -34,6 +34,19 @@ struct event_watch_item { @@ -67,25 +69,27 @@ index 1a95974..5c2ef56 100644 struct teamd_port *tdport) { diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 9c77fae..e38c291 100644 +index 7c91aed..4dbd015 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c -@@ -1383,12 +1383,22 @@ static int lacp_event_watch_port_changed(struct teamd_context *ctx, +@@ -1421,6 +1421,16 @@ static int lacp_event_watch_port_changed(struct teamd_context *ctx, return lacp_port_link_update(lacp_port); } -+static void lacp_event_watch_refresh(struct teamd_context *ctx, struct teamd_port *tdport, void *priv) ++static void lacp_event_watch_refresh(struct teamd_context *ctx, ++ struct teamd_port *tdport, void *priv) +{ + struct lacp *lacp = priv; -+ + struct lacp_port *lacp_port = lacp_port_get(lacp, tdport); ++ + if (lacp_port_selected(lacp_port)) + (void) lacpdu_send(lacp_port); +} + static const struct teamd_event_watch_ops lacp_event_watch_ops = { .hwaddr_changed = lacp_event_watch_hwaddr_changed, - .port_added = lacp_event_watch_port_added, + .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, +@@ -1428,6 +1438,7 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { .port_removed = lacp_event_watch_port_removed, .port_changed = lacp_event_watch_port_changed, .admin_state_changed = lacp_event_watch_admin_state_changed, diff --git a/src/libteam/0004-libteam-Add-lacp-fallback-support-for-single-member-.patch b/src/libteam/patch/0003-libteam-Add-fallback-support-for-single-member-port-.patch similarity index 84% rename from src/libteam/0004-libteam-Add-lacp-fallback-support-for-single-member-.patch rename to src/libteam/patch/0003-libteam-Add-fallback-support-for-single-member-port-.patch index 3139f83f33..8559e476ae 100644 --- a/src/libteam/0004-libteam-Add-lacp-fallback-support-for-single-member-.patch +++ b/src/libteam/patch/0003-libteam-Add-fallback-support-for-single-member-port-.patch @@ -1,16 +1,17 @@ -From ec966f9a0229bd7226e3abe15b56659b36af9d66 Mon Sep 17 00:00:00 2001 -From: Haiyang Zheng -Date: Fri, 15 Dec 2017 21:07:53 -0800 -Subject: [patch libteam] [libteam] Add fallback support for single-member-port - LAG +From 9b40af58575a89d06be51cfbb5a2265a59826110 Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 12:02:36 +0800 +Subject: [PATCH 3/8] [libteam] Add fallback support for single-member-port LAG + From: Haiyang Zheng Date: Fri, 15 Dec + 2017 21:07:53 -0800 -Signed-off-by: Haiyang Zheng +Signed-off-by: yorke --- teamd/teamd_runner_lacp.c | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 9c77fae..a3646a6 100644 +index 4dbd015..9836824 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -138,6 +138,8 @@ struct lacp { @@ -70,7 +71,7 @@ index 9c77fae..a3646a6 100644 return false; return true; } -@@ -1452,6 +1475,16 @@ static int lacp_state_fast_rate_get(struct teamd_context *ctx, +@@ -1502,6 +1525,16 @@ static int lacp_state_fast_rate_get(struct teamd_context *ctx, return 0; } @@ -87,7 +88,7 @@ index 9c77fae..a3646a6 100644 static int lacp_state_select_policy_get(struct teamd_context *ctx, struct team_state_gsc *gsc, void *priv) -@@ -1479,6 +1512,11 @@ static const struct teamd_state_val lacp_state_vals[] = { +@@ -1529,6 +1562,11 @@ static const struct teamd_state_val lacp_state_vals[] = { .getter = lacp_state_fast_rate_get, }, { diff --git a/src/libteam/patch/0004-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch b/src/libteam/patch/0004-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch new file mode 100644 index 0000000000..3d99132b92 --- /dev/null +++ b/src/libteam/patch/0004-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch @@ -0,0 +1,36 @@ +From e18cbe5a6c76366923a8ace830c89056a1542745 Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 12:06:00 +0800 +Subject: [PATCH 4/8] Skip setting the same hwaddr to lag port to avoid + disrupting From: Jipan Yang Date: Sun, + 24 Feb 2019 00:04:15 -0800 + +Signed-off-by: yorke +--- + teamd/teamd.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/teamd/teamd.c b/teamd/teamd.c +index 58d4fc8..9dc85b5 100644 +--- a/teamd/teamd.c ++++ b/teamd/teamd.c +@@ -834,7 +834,15 @@ static int teamd_set_hwaddr(struct teamd_context *ctx) + err = -EINVAL; + goto free_hwaddr; + } +- err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len); ++ ++ if(!memcmp(hwaddr, ctx->hwaddr, hwaddr_len)) { ++ err = 0; ++ teamd_log_dbg("Skip setting same hwaddr string: \"%s\".", hwaddr_str); ++ } ++ else{ ++ err = team_hwaddr_set(ctx->th, ctx->ifindex, hwaddr, hwaddr_len); ++ } ++ + if (!err) + ctx->hwaddr_explicit = true; + free_hwaddr: +-- +2.7.4 + diff --git a/src/libteam/patch/0005-Increase-default-buffer-size-from-98304-to-983040.patch b/src/libteam/patch/0005-Increase-default-buffer-size-from-98304-to-983040.patch new file mode 100644 index 0000000000..517b86992e --- /dev/null +++ b/src/libteam/patch/0005-Increase-default-buffer-size-from-98304-to-983040.patch @@ -0,0 +1,31 @@ +From 39e5b0a15bf276dffa6b8c61594ee945248a4e27 Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 12:32:33 +0800 +Subject: [PATCH 5/8] Increase default buffer size from 98304 to 983040 + From: Pavel Shirshov + https://github.com/Azure/sonic-buildimage/pull/2822 + +Signed-off-by: yorke +--- + libteam/libteam.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libteam/libteam.c b/libteam/libteam.c +index 9c9c93a..2cc80ca 100644 +--- a/libteam/libteam.c ++++ b/libteam/libteam.c +@@ -551,9 +551,9 @@ int team_destroy(struct team_handle *th) + /* \endcond */ + + /* libnl uses default 32k socket receive buffer size, +- * which can get too small. Use 192k for all sockets. ++ * which can get too small. Use 960k for all sockets. + */ +-#define NETLINK_RCVBUF 196608 ++#define NETLINK_RCVBUF 983040 + + /** + * @param th libteam library context +-- +2.7.4 + diff --git a/src/libteam/patch/0006-teamd-Administratively-shutdown-port-channel-has-mem.patch b/src/libteam/patch/0006-teamd-Administratively-shutdown-port-channel-has-mem.patch new file mode 100644 index 0000000000..344dbc8d26 --- /dev/null +++ b/src/libteam/patch/0006-teamd-Administratively-shutdown-port-channel-has-mem.patch @@ -0,0 +1,37 @@ +From f1eec95dd0475591897a781eba15d8d8ce370a6a Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 13:21:07 +0800 +Subject: [PATCH 6/8] [teamd]: Administratively shutdown port channel has + member ports in deselected state and traffic is not forwarded From: + phanindra-tv https://github.com/Azure/sonic-buildimage/pull/2882 + +Signed-off-by: yorke +--- + teamd/teamd_runner_lacp.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c +index 9836824..7bf3700 100644 +--- a/teamd/teamd_runner_lacp.c ++++ b/teamd/teamd_runner_lacp.c +@@ -1101,12 +1101,17 @@ static int lacpdu_recv(struct lacp_port *lacp_port) + struct lacpdu lacpdu; + struct sockaddr_ll ll_from; + int err; ++ bool admin_state; + + err = teamd_recvfrom(lacp_port->sock, &lacpdu, sizeof(lacpdu), 0, + (struct sockaddr *) &ll_from, sizeof(ll_from)); + if (err <= 0) + return err; + ++ admin_state = team_get_ifinfo_admin_state(lacp_port->ctx->ifinfo); ++ if (!admin_state) ++ return 0; ++ + if (!teamd_port_present(lacp_port->ctx, lacp_port->tdport)) + return 0; + +-- +2.7.4 + diff --git a/src/libteam/patch/0007-Send-LACP-PDU-immediately-if-our-state-changed.patch b/src/libteam/patch/0007-Send-LACP-PDU-immediately-if-our-state-changed.patch new file mode 100644 index 0000000000..d26e2a74ea --- /dev/null +++ b/src/libteam/patch/0007-Send-LACP-PDU-immediately-if-our-state-changed.patch @@ -0,0 +1,42 @@ +From b82da0dc94ca34b039396328a8c2fcb61aa73c0f Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 13:27:26 +0800 +Subject: [PATCH 7/8] Send LACP PDU immediately if our state changed From: + Pavel Shirshov Date: Wed, 29 May 2019 19:15:20 + +0000 + +Signed-off-by: yorke +--- + teamd/teamd_runner_lacp.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c +index 7bf3700..4016b15 100644 +--- a/teamd/teamd_runner_lacp.c ++++ b/teamd/teamd_runner_lacp.c +@@ -1017,8 +1017,7 @@ static int lacp_port_set_state(struct lacp_port *lacp_port, + return err; + + lacp_port_actor_update(lacp_port); +- if (lacp_port->periodic_on) +- return 0; ++ + return lacpdu_send(lacp_port); + } + +@@ -1136,9 +1135,10 @@ static int lacpdu_recv(struct lacp_port *lacp_port) + if (err) + return err; + ++ lacp_port_actor_update(lacp_port); ++ + /* Check if the other side has correct info about us */ +- if (!lacp_port->periodic_on && +- memcmp(&lacpdu.partner, &lacp_port->actor, ++ if (memcmp(&lacpdu.partner, &lacp_port->actor, + sizeof(struct lacpdu_info))) { + err = lacpdu_send(lacp_port); + if (err) +-- +2.7.4 + diff --git a/src/libteam/0005-libteam-Add-warm_reboot-mode.patch b/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch similarity index 83% rename from src/libteam/0005-libteam-Add-warm_reboot-mode.patch rename to src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch index 625af96eaa..9e3f94e441 100644 --- a/src/libteam/0005-libteam-Add-warm_reboot-mode.patch +++ b/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch @@ -1,8 +1,24 @@ +From fe097ebcadd52e56a589c38a9c821cf1a84d6b67 Mon Sep 17 00:00:00 2001 +From: yorke +Date: Mon, 3 Jun 2019 14:48:14 +0800 +Subject: [PATCH 8/8] [libteam] Add warm_reboot mode From: pavel-shirshov + and Ying Xie + https://github.com/Azure/sonic-buildimage/pull/2173 + +Signed-off-by: yorke +--- + libteam/ifinfo.c | 6 +- + teamd/teamd.c | 46 +++++++++- + teamd/teamd.h | 7 ++ + teamd/teamd_events.c | 13 +++ + teamd/teamd_runner_lacp.c | 209 +++++++++++++++++++++++++++++++++++++++------- + 5 files changed, 245 insertions(+), 36 deletions(-) + diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c -index 72155ae..44de4ca 100644 +index 46d56a2..b86d34c 100644 --- a/libteam/ifinfo.c +++ b/libteam/ifinfo.c -@@ -105,15 +105,13 @@ static void update_hwaddr(struct team_ifinfo *ifinfo, struct rtnl_link *link) +@@ -109,15 +109,13 @@ static void update_hwaddr(struct team_ifinfo *ifinfo, struct rtnl_link *link) hwaddr_len = nl_addr_get_len(nl_addr); if (ifinfo->hwaddr_len != hwaddr_len) { ifinfo->hwaddr_len = hwaddr_len; @@ -21,10 +37,10 @@ index 72155ae..44de4ca 100644 } } diff --git a/teamd/teamd.c b/teamd/teamd.c -index c987333..225b8c8 100644 +index 9dc85b5..1a974d1 100644 --- a/teamd/teamd.c +++ b/teamd/teamd.c -@@ -116,7 +116,9 @@ static void print_help(const struct teamd_context *ctx) { +@@ -117,7 +117,9 @@ static void print_help(const struct teamd_context *ctx) { " -D --dbus-enable Enable D-Bus interface\n" " -Z --zmq-enable=ADDRESS Enable ZeroMQ interface\n" " -U --usock-enable Enable UNIX domain socket interface\n" @@ -35,7 +51,7 @@ index c987333..225b8c8 100644 ctx->argv0); printf("Available runners: "); for (i = 0; i < TEAMD_RUNNER_LIST_SIZE; i++) { -@@ -129,7 +131,7 @@ static void print_help(const struct teamd_context *ctx) { +@@ -130,7 +132,7 @@ static void print_help(const struct teamd_context *ctx) { static int parse_command_line(struct teamd_context *ctx, int argc, char *argv[]) { @@ -44,7 +60,7 @@ index c987333..225b8c8 100644 static const struct option long_options[] = { { "help", no_argument, NULL, 'h' }, { "daemonize", no_argument, NULL, 'd' }, -@@ -149,10 +151,12 @@ static int parse_command_line(struct teamd_context *ctx, +@@ -151,10 +153,12 @@ static int parse_command_line(struct teamd_context *ctx, { "zmq-enable", required_argument, NULL, 'Z' }, { "usock-enable", no_argument, NULL, 'U' }, { "usock-disable", no_argument, NULL, 'u' }, @@ -53,12 +69,12 @@ index c987333..225b8c8 100644 { NULL, 0, NULL, 0 } }; -- while ((opt = getopt_long(argc, argv, "hdkevf:c:p:groNt:nDZ:Uu", -+ while ((opt = getopt_long(argc, argv, "hdkevf:c:p:groNt:nDZ:UuwL:", +- while ((opt = getopt_long(argc, argv, "hdkevf:c:p:gl:roNt:nDZ:Uu", ++ while ((opt = getopt_long(argc, argv, "hdkevf:c:p:gl:roNt:nDZ:UuwL:", long_options, NULL)) >= 0) { switch(opt) { -@@ -230,11 +234,29 @@ static int parse_command_line(struct teamd_context *ctx, +@@ -236,11 +240,29 @@ static int parse_command_line(struct teamd_context *ctx, case 'u': ctx->usock.enabled = false; break; @@ -88,7 +104,7 @@ index c987333..225b8c8 100644 if (optind < argc) { fprintf(stderr, "Too many arguments\n"); return -1; -@@ -384,8 +406,14 @@ static int teamd_run_loop_run(struct teamd_context *ctx) +@@ -390,8 +412,14 @@ static int teamd_run_loop_run(struct teamd_context *ctx) if (err != -1) { switch(ctrl_byte) { case 'q': @@ -103,7 +119,7 @@ index c987333..225b8c8 100644 teamd_refresh_ports(ctx); err = teamd_flush_ports(ctx); if (err) -@@ -428,6 +456,12 @@ void teamd_run_loop_quit(struct teamd_context *ctx, int err) +@@ -434,6 +462,12 @@ void teamd_run_loop_quit(struct teamd_context *ctx, int err) teamd_run_loop_sent_ctrl_byte(ctx, 'q'); } @@ -116,7 +132,7 @@ index c987333..225b8c8 100644 void teamd_run_loop_restart(struct teamd_context *ctx) { teamd_run_loop_sent_ctrl_byte(ctx, 'r'); -@@ -694,6 +728,10 @@ static int callback_daemon_signal(struct teamd_context *ctx, int events, +@@ -700,6 +734,10 @@ static int callback_daemon_signal(struct teamd_context *ctx, int events, teamd_log_warn("Got SIGINT, SIGQUIT or SIGTERM."); teamd_run_loop_quit(ctx, 0); break; @@ -127,7 +143,7 @@ index c987333..225b8c8 100644 } return 0; } -@@ -1507,7 +1545,7 @@ static int teamd_start(struct teamd_context *ctx, enum teamd_exit_code *p_ret) +@@ -1531,7 +1569,7 @@ static int teamd_start(struct teamd_context *ctx, enum teamd_exit_code *p_ret) return -errno; } @@ -137,10 +153,10 @@ index c987333..225b8c8 100644 daemon_retval_send(errno); err = -errno; diff --git a/teamd/teamd.h b/teamd/teamd.h -index ef0fb1c..622c365 100644 +index e71a5dc..f83a2d9 100644 --- a/teamd/teamd.h +++ b/teamd/teamd.h -@@ -125,6 +125,10 @@ struct teamd_context { +@@ -126,6 +126,10 @@ struct teamd_context { char * hwaddr; uint32_t hwaddr_len; bool hwaddr_explicit; @@ -151,8 +167,8 @@ index ef0fb1c..622c365 100644 struct { struct list_item callback_list; int ctrl_pipe_r; -@@ -191,12 +195,15 @@ struct teamd_event_watch_ops { - struct teamd_port *tdport, void *priv); +@@ -195,12 +199,15 @@ struct teamd_event_watch_ops { + void *priv); void (*refresh)(struct teamd_context *ctx, struct teamd_port *tdport, void *priv); + void (*port_flush_data)(struct teamd_context *ctx, @@ -168,7 +184,7 @@ index ef0fb1c..622c365 100644 struct teamd_port *tdport); void teamd_event_port_removed(struct teamd_context *ctx, diff --git a/teamd/teamd_events.c b/teamd/teamd_events.c -index 5c2ef56..50e5a08 100644 +index 221803e..bd4dcc1 100644 --- a/teamd/teamd_events.c +++ b/teamd/teamd_events.c @@ -47,6 +47,19 @@ void teamd_refresh_ports(struct teamd_context *ctx) @@ -192,7 +208,7 @@ index 5c2ef56..50e5a08 100644 struct teamd_port *tdport) { diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 81324de..9e88ce0 100644 +index 4016b15..087efa9 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -31,6 +31,7 @@ @@ -221,7 +237,7 @@ index 81324de..9e88ce0 100644 struct { uint32_t speed; uint8_t duplex; -@@ -491,15 +496,28 @@ static int lacp_update_carrier(struct lacp *lacp) +@@ -493,15 +498,28 @@ static int lacp_update_carrier(struct lacp *lacp) bool state; int err; @@ -251,7 +267,7 @@ index 81324de..9e88ce0 100644 return lacp_set_carrier(lacp, false); } -@@ -917,6 +935,18 @@ static void lacp_port_actor_system_update(struct lacp_port *lacp_port) +@@ -919,6 +937,18 @@ static void lacp_port_actor_system_update(struct lacp_port *lacp_port) memcpy(actor->system, lacp_port->ctx->hwaddr, ETH_ALEN); } @@ -270,7 +286,7 @@ index 81324de..9e88ce0 100644 static void lacp_port_actor_init(struct lacp_port *lacp_port) { struct lacpdu_info *actor = &lacp_port->actor; -@@ -924,7 +954,7 @@ static void lacp_port_actor_init(struct lacp_port *lacp_port) +@@ -926,7 +956,7 @@ static void lacp_port_actor_init(struct lacp_port *lacp_port) actor->system_priority = htons(lacp_port->lacp->cfg.sys_prio); actor->key = htons(lacp_port->cfg.lacp_key); actor->port_priority = htons(lacp_port->cfg.lacp_prio); @@ -279,7 +295,7 @@ index 81324de..9e88ce0 100644 lacp_port_actor_system_update(lacp_port); } -@@ -994,6 +1024,13 @@ static int lacp_port_set_state(struct lacp_port *lacp_port, +@@ -1006,6 +1036,13 @@ static int lacp_port_set_state(struct lacp_port *lacp_port, break; } @@ -293,7 +309,7 @@ index 81324de..9e88ce0 100644 teamd_log_info("%s: Changed port state: \"%s\" -> \"%s\"", lacp_port->tdport->ifname, lacp_port_state_name[lacp_port->state], -@@ -1084,26 +1121,23 @@ static int lacpdu_send(struct lacp_port *lacp_port) +@@ -1095,34 +1132,26 @@ static int lacpdu_send(struct lacp_port *lacp_port) return err; } @@ -303,12 +319,20 @@ index 81324de..9e88ce0 100644 - struct lacpdu lacpdu; - struct sockaddr_ll ll_from; int err; - +- bool admin_state; +- - err = teamd_recvfrom(lacp_port->sock, &lacpdu, sizeof(lacpdu), 0, - (struct sockaddr *) &ll_from, sizeof(ll_from)); - if (err <= 0) - return err; - +- admin_state = team_get_ifinfo_admin_state(lacp_port->ctx->ifinfo); +- if (!admin_state) +- return 0; + + if (!teamd_port_present(lacp_port->ctx, lacp_port->tdport)) + return 0; + - if (!lacpdu_check(&lacpdu)) { + if (!lacpdu_check(lacpdu)) { teamd_log_warn("malformed LACP PDU came."); @@ -328,16 +352,16 @@ index 81324de..9e88ce0 100644 err = lacp_port_partner_update(lacp_port); if (err) return err; -@@ -1118,7 +1152,7 @@ static int lacpdu_recv(struct lacp_port *lacp_port) +@@ -1138,7 +1167,7 @@ static int lacpdu_recv(struct lacp_port *lacp_port) + lacp_port_actor_update(lacp_port); /* Check if the other side has correct info about us */ - if (!lacp_port->periodic_on && -- memcmp(&lacpdu.partner, &lacp_port->actor, -+ memcmp(&lacpdu->partner, &lacp_port->actor, +- if (memcmp(&lacpdu.partner, &lacp_port->actor, ++ if (memcmp(&lacpdu->partner, &lacp_port->actor, sizeof(struct lacpdu_info))) { err = lacpdu_send(lacp_port); if (err) -@@ -1133,6 +1167,65 @@ static int lacpdu_recv(struct lacp_port *lacp_port) +@@ -1153,6 +1182,70 @@ static int lacpdu_recv(struct lacp_port *lacp_port) return 0; } @@ -346,12 +370,17 @@ index 81324de..9e88ce0 100644 + struct lacpdu lacpdu; + struct sockaddr_ll ll_from; + int err; ++ bool admin_state; + + err = teamd_recvfrom(lacp_port->sock, &lacpdu, sizeof(lacpdu), 0, + (struct sockaddr *) &ll_from, sizeof(ll_from)); + if (err <= 0) + return err; + ++ admin_state = team_get_ifinfo_admin_state(lacp_port->ctx->ifinfo); ++ if (!admin_state) ++ return 0; ++ + return lacpdu_process(lacp_port, &lacpdu); +} + @@ -403,7 +432,7 @@ index 81324de..9e88ce0 100644 static int lacp_callback_timeout(struct teamd_context *ctx, int events, void *priv) { -@@ -1284,6 +1377,13 @@ static int lacp_port_added(struct teamd_context *ctx, +@@ -1304,6 +1397,13 @@ static int lacp_port_added(struct teamd_context *ctx, goto periodic_callback_del; } @@ -417,7 +446,7 @@ index 81324de..9e88ce0 100644 /* Newly added ports are disabled */ err = team_set_port_enabled(ctx->th, tdport->ifindex, false); if (err) { -@@ -1299,6 +1399,13 @@ static int lacp_port_added(struct teamd_context *ctx, +@@ -1319,6 +1419,13 @@ static int lacp_port_added(struct teamd_context *ctx, lacp_port_actor_init(lacp_port); lacp_port_link_update(lacp_port); @@ -431,7 +460,7 @@ index 81324de..9e88ce0 100644 teamd_loop_callback_enable(ctx, LACP_SOCKET_CB_NAME, lacp_port); return 0; -@@ -1321,7 +1428,11 @@ static void lacp_port_removed(struct teamd_context *ctx, +@@ -1341,7 +1448,11 @@ static void lacp_port_removed(struct teamd_context *ctx, { struct lacp_port *lacp_port = priv; @@ -444,7 +473,7 @@ index 81324de..9e88ce0 100644 teamd_loop_callback_del(ctx, LACP_TIMEOUT_CB_NAME, lacp_port); teamd_loop_callback_del(ctx, LACP_PERIODIC_CB_NAME, lacp_port); teamd_loop_callback_del(ctx, LACP_SOCKET_CB_NAME, lacp_port); -@@ -1413,6 +1524,31 @@ static void lacp_event_watch_refresh(struct teamd_context *ctx, struct teamd_por +@@ -1459,6 +1570,31 @@ static void lacp_event_watch_refresh(struct teamd_context *ctx, (void) lacpdu_send(lacp_port); } @@ -475,8 +504,8 @@ index 81324de..9e88ce0 100644 + static const struct teamd_event_watch_ops lacp_event_watch_ops = { .hwaddr_changed = lacp_event_watch_hwaddr_changed, - .port_added = lacp_event_watch_port_added, -@@ -1420,21 +1556,38 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { + .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, +@@ -1467,21 +1603,38 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { .port_changed = lacp_event_watch_port_changed, .admin_state_changed = lacp_event_watch_admin_state_changed, .refresh = lacp_event_watch_refresh, @@ -522,7 +551,7 @@ index 81324de..9e88ce0 100644 return 0; } -@@ -1946,7 +2099,7 @@ static void lacp_fini(struct teamd_context *ctx, void *priv) +@@ -1993,7 +2146,7 @@ static void lacp_fini(struct teamd_context *ctx, void *priv) teamd_state_val_unregister(ctx, &lacp_state_vg, lacp); teamd_balancer_fini(lacp->tb); teamd_event_watch_unregister(ctx, &lacp_event_watch_ops, lacp); @@ -531,3 +560,6 @@ index 81324de..9e88ce0 100644 } const struct teamd_runner teamd_runner_lacp = { +-- +2.7.4 + diff --git a/src/libteam/patch/series b/src/libteam/patch/series new file mode 100644 index 0000000000..5a81efd228 --- /dev/null +++ b/src/libteam/patch/series @@ -0,0 +1,8 @@ +0001-libteam-Temporarily-remove-redundant-debug-messages.patch +0002-teamd-lacp-runner-will-send-lacp-update-right-after-.patch +0003-libteam-Add-fallback-support-for-single-member-port-.patch +0004-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch +0005-Increase-default-buffer-size-from-98304-to-983040.patch +0006-teamd-Administratively-shutdown-port-channel-has-mem.patch +0007-Send-LACP-PDU-immediately-if-our-state-changed.patch +0008-libteam-Add-warm_reboot-mode.patch diff --git a/src/libteam/series b/src/libteam/series deleted file mode 100644 index 76e5e8177c..0000000000 --- a/src/libteam/series +++ /dev/null @@ -1,10 +0,0 @@ -0001-libteam-Add-team_get_port_enabled-function.patch -0002-libteam-Temporarily-remove-redundant-debug-mes.patch -0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch -0004-libteam-Add-lacp-fallback-support-for-single-member-.patch -0005-libteam-Add-warm_reboot-mode.patch -0007-Skip-setting-the-same-hwaddr-to-lag-port-to-avoid-di.patch -0010-teamd-lacp-update-port-state-according-to-partners-sy.patch -0011-libteam-resynchronize-ifinfo-after-lost-RTNLGRP_LINK-.patch -0012-teamd-do-not-process-lacpdu-before-the-port-ifinfo-i.patch -0013-teamd-lacp-port-admin-down-recv-not-processing.patch diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index d4be412ed5..8d08b399b4 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -402,8 +402,9 @@ def parse_deviceinfo(meta, hwsku): for device_info in meta.findall(str(QName(ns, "DeviceInfo"))): dev_sku = device_info.find(str(QName(ns, "HwSku"))).text if dev_sku == hwsku: - interfaces = device_info.find(str(QName(ns, "EthernetInterfaces"))) - for interface in interfaces.findall(str(QName(ns1, "EthernetInterface"))): + interfaces = device_info.find(str(QName(ns, "EthernetInterfaces"))).findall(str(QName(ns1, "EthernetInterface"))) + interfaces = interfaces + device_info.find(str(QName(ns, "ManagementInterfaces"))).findall(str(QName(ns1, "ManagementInterface"))) + for interface in interfaces: alias = interface.find(str(QName(ns, "InterfaceName"))).text speed = interface.find(str(QName(ns, "Speed"))).text desc = interface.find(str(QName(ns, "Description"))) @@ -432,7 +433,7 @@ def parse_xml(filename, platform=None, port_config_file=None): neighbors = None devices = None hostname = None - docker_routing_config_mode = "unified" + docker_routing_config_mode = "separated" port_speeds_default = {} port_speed_png = {} port_descriptions = {} @@ -501,6 +502,8 @@ def parse_xml(filename, platform=None, port_config_file=None): mgmt_intf_count += 1 mgmt_alias_reverse_mapping[alias] = name results['MGMT_PORT'][name] = {'alias': alias, 'admin_status': 'up'} + if alias in port_speeds_default: + results['MGMT_PORT'][name]['speed'] = port_speeds_default[alias] results['MGMT_INTERFACE'][(name, key[1])] = mgmt_intf[key] results['LOOPBACK_INTERFACE'] = lo_intfs @@ -512,12 +515,16 @@ def parse_xml(filename, platform=None, port_config_file=None): for intf in intfs: if intf[0][0:4] == 'Vlan': vlan_intfs[intf] = {} + vlan_intfs[intf[0]] = {} elif vlan_invert_mapping.has_key(intf[0]): vlan_intfs[(vlan_invert_mapping[intf[0]], intf[1])] = {} + vlan_intfs[vlan_invert_mapping[intf[0]]] = {} elif intf[0][0:11] == 'PortChannel': pc_intfs[intf] = {} + pc_intfs[intf[0]] = {} else: phyport_intfs[intf] = {} + phyport_intfs[intf[0]] = {} results['INTERFACE'] = phyport_intfs results['VLAN_INTERFACE'] = vlan_intfs @@ -598,9 +605,10 @@ def parse_xml(filename, platform=None, port_config_file=None): for pc_intf in pc_intfs.keys(): # remove portchannels not in PORTCHANNEL dictionary - if pc_intf[0] not in pcs: + if isinstance(pc_intf, tuple) and pc_intf[0] not in pcs: print >> sys.stderr, "Warning: ignore '%s' interface '%s' as '%s' is not in the valid PortChannel list" % (pc_intf[0], pc_intf[1], pc_intf[0]) del pc_intfs[pc_intf] + pc_intfs.pop(pc_intf[0], None) results['PORTCHANNEL_INTERFACE'] = pc_intfs diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 3f7951248c..e0bd07ff8c 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -86,6 +86,18 @@ def unique_name(l): new_list.append(item) return new_list +def pfx_filter(value): + """INTERFACE Table can have keys in one of the two formats: + string or tuple - This filter skips the string keys and only + take into account the tuple. + For eg - VLAN_INTERFACE|Vlan1000 vs VLAN_INTERFACE|Vlan1000|192.168.0.1/21 + """ + table = OrderedDict() + for key,val in value.items(): + if not isinstance(key, tuple): + continue + table[key] = val + return table class FormatConverter: """Convert config DB based schema to legacy minigraph based schema for backward capability. @@ -234,6 +246,7 @@ def main(): env.filters['ipv4'] = is_ipv4 env.filters['ipv6'] = is_ipv6 env.filters['unique_name'] = unique_name + env.filters['pfx_filter'] = pfx_filter for attr in ['ip', 'network', 'prefixlen', 'netmask']: env.filters[attr] = partial(prefix_attr, attr) template = env.get_template(template_file) diff --git a/src/sonic-config-engine/tests/sample_output/docker-dhcp-relay.supervisord.conf b/src/sonic-config-engine/tests/sample_output/docker-dhcp-relay.supervisord.conf index ed14f2ca0f..d285fbfc78 100644 --- a/src/sonic-config-engine/tests/sample_output/docker-dhcp-relay.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/docker-dhcp-relay.supervisord.conf @@ -23,7 +23,7 @@ stderr_logfile=syslog programs=isc-dhcp-relay-Vlan1000 [program:isc-dhcp-relay-Vlan1000] -command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -i Vlan1000 -i PortChannel01 -i PortChannel02 -i PortChannel03 -i PortChannel04 192.0.0.1 192.0.0.2 +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2 priority=3 autostart=false autorestart=false diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index 5a77609901..35d8f83437 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -325,6 +325,19 @@ true 0 Force10-S6000 + + + DeviceInterface + + true + true + 1 + eth0 + false + eth0 + 1000 + + switch-T0 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml index 28044f1c87..1b1da1ff17 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -310,6 +310,19 @@ true 0 Force10-S6000 + + + DeviceInterface + + true + true + 1 + Management1 + false + mgmt1 + 1000 + + switch-t0 diff --git a/src/sonic-config-engine/tests/simple-sample-graph.xml b/src/sonic-config-engine/tests/simple-sample-graph.xml index f5054bb084..e04f692729 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph.xml @@ -342,6 +342,18 @@ true 0 Force10-S6000 + + + DeviceInterface + + true + 1 + Management1 + false + mgmt1 + 1000 + + switch-t0 diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 5a6c0f62ce..f267651ff6 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -107,7 +107,7 @@ class TestCfgGen(TestCase): def test_minigraph_interfaces(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "INTERFACE.keys()"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[('Ethernet0', '10.0.0.58/31'), ('Ethernet0', 'FC00::75/126')]") + self.assertEqual(output.strip(), "[('Ethernet0', '10.0.0.58/31'), 'Ethernet0', ('Ethernet0', 'FC00::75/126')]") def test_minigraph_vlans(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN' @@ -122,7 +122,7 @@ class TestCfgGen(TestCase): def test_minigraph_vlan_interfaces(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27')]") + self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27'), 'Vlan1000']") def test_minigraph_portchannels(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v PORTCHANNEL' @@ -142,7 +142,7 @@ class TestCfgGen(TestCase): def test_minigraph_portchannel_interfaces(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORTCHANNEL_INTERFACE.keys()"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[('PortChannel01', 'FC00::71/126'), ('PortChannel01', '10.0.0.56/31')]") + self.assertEqual(output.strip(), "['PortChannel01', ('PortChannel01', '10.0.0.56/31'), ('PortChannel01', 'FC00::71/126')]") def test_minigraph_neighbors(self): argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "DEVICE_NEIGHBOR[\'Ethernet124\']"' diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index b58d8e05e1..d363acdca0 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -67,7 +67,7 @@ class TestCfgGenCaseInsensitive(TestCase): def test_minigraph_interfaces(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v \'INTERFACE.keys()\'' output = self.run_script(argument) - self.assertEqual(output.strip(), "[('Ethernet0', '10.0.0.58/31'), ('Ethernet0', 'FC00::75/126')]") + self.assertEqual(output.strip(), "[('Ethernet0', '10.0.0.58/31'), 'Ethernet0', ('Ethernet0', 'FC00::75/126')]") def test_minigraph_vlans(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v VLAN' @@ -82,7 +82,7 @@ class TestCfgGenCaseInsensitive(TestCase): def test_minigraph_vlan_interfaces(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()"' output = self.run_script(argument) - self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27')]") + self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27'), 'Vlan1000']") def test_minigraph_portchannels(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v PORTCHANNEL' @@ -114,8 +114,12 @@ class TestCfgGenCaseInsensitive(TestCase): output = self.run_script(argument) self.assertEqual(output.strip(), "{'10.0.10.7': {'priority': '1', 'tcp_port': '49'}, '10.0.10.8': {'priority': '1', 'tcp_port': '49'}}") + def test_minigraph_mgmt_port(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "MGMT_PORT"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "{'eth0': {'alias': 'eth0', 'admin_status': 'up', 'speed': '1000'}}") + def test_metadata_ntp(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "NTP_SERVER"' output = self.run_script(argument) self.assertEqual(output.strip(), "{'10.0.10.1': {}, '10.0.10.2': {}}") - diff --git a/src/sonic-device-data/src/Makefile b/src/sonic-device-data/src/Makefile index 9c0037fd50..aca0cbea2a 100644 --- a/src/sonic-device-data/src/Makefile +++ b/src/sonic-device-data/src/Makefile @@ -8,4 +8,7 @@ test: for f in $$(find ../../../device -name "*.config.bcm"); do ./config_checker $$f done + for f in $$(find ../../../device -name media_settings.json); do + ./media_checker $$f + done popd diff --git a/src/sonic-device-data/tests/media_checker b/src/sonic-device-data/tests/media_checker new file mode 100755 index 0000000000..6b4139585a --- /dev/null +++ b/src/sonic-device-data/tests/media_checker @@ -0,0 +1,159 @@ +#!/usr/bin/env python +import re +import sys +import glob +import json + +level1_keys = ["GLOBAL_MEDIA_SETTINGS","PORT_MEDIA_SETTINGS"] +setting_keys = ["preemphasis","idriver","ipredriver"] +lane_prefix = "lane" +comma_separator = "," +range_separator = "-" + +def check_lane_and_value(lane_name, lane_value): + if lane_prefix in lane_name: + try: + lane_num = int(lane_name.strip()[len(lane_prefix):]) + lane_val = int(lane_value.strip(), 16) + return True + + except ValueError: + print "Invalid lane values " + lane_name + " " + lane_value + return False + + else: + return False + +def usage(): + print "Usage: " + sys.argv[0] + " " + sys.exit(1) + +def check_media_dict(vendor_dict): + if len(vendor_dict) == 0: + print "Expecting values for media type " + keys + return False + + for vendor_key in vendor_dict: + value_dict = vendor_dict[vendor_key] + if len(value_dict) == 0: + print "Expecting settings for vendor type " + vendor_key + return False + + for value_key in value_dict: + if value_key not in setting_keys: + print "Unknown media setting " + value_key + return False + + lane_dict = value_dict[value_key] + for lanes in lane_dict: + if not check_lane_and_value(lanes, lane_dict[lanes]): + return False + return True + +def check_valid_port(port_name): + try: + val = int(port_name.strip()) + return True + except ValueError: + return False + +def check_port_keys(port_media_dict): + for port in port_media_dict: + + if not check_valid_port(port): + print "Invalid port name " + port + return False + + if not check_media_dict(port_media_dict[port]): + return False + return True + +def check_global_keys(global_media_dict): + for keys in global_media_dict: + if comma_separator in keys: + port_list = keys.split(comma_separator) + for port in port_list: + if range_separator in port: + range_list = port.split(range_separator) + for port_val in range_list: + if not check_valid_port(port_val): + print "Error: Unrecognized port number " + port_val + print "Invalid range " + port + return False + else: + if not check_valid_port(port): + print "Error: Unrecognized portname " + port + return False + elif range_separator in keys: + range_list = keys.split(range_separator) + for port_val in range_list: + if not check_valid_port(port_val): + print "Error: Unrecognized portname " + port_val + print "Invalid range " + keys + return False + else: + print "Invalid range " + keys + return False + + if not check_media_dict(global_media_dict[keys]): + return False + + return True + + +def check_file(media_settings_file): + try: + media_file = open(media_settings_file,"r") + media_settings = media_file.read() + media_dict = json.loads(media_settings) + #Validate keys at level1 + + for key_l1 in media_dict: + if key_l1 not in level1_keys: + print "Error: Unknown key " + key_l1 + " at top level" + return False + if "GLOBAL_MEDIA_SETTINGS" in media_dict: + if not check_global_keys(media_dict["GLOBAL_MEDIA_SETTINGS"]): + return False + if "PORT_MEDIA_SETTINGS" in media_dict: + if not check_port_keys(media_dict["PORT_MEDIA_SETTINGS"]): + return False + + + except IOError: + print "Error: Cannot open file " + media_settings_file + return False + except ValueError,e: + print "Error in parsing json file " + media_settings_file + " " + print str(e) + return False + + return True + + +def main(argv): + + if len(argv) > 0 and argv[0] == "-h": + usage() + + # Load target file + if len(argv) == 0: + files = glob.glob('*.json') + else: + files = argv + + all_good = True + for f in files: + good = check_file(f) + if good: + print "File " + f + " passed validity check" + else: + print "File " + f + " failed validity check" + + all_good = all_good and good + + if not all_good: + sys.exit(-1) + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/src/sonic-device-data/tests/permitted_list b/src/sonic-device-data/tests/permitted_list index ba07b29c0c..33ea08c64b 100644 --- a/src/sonic-device-data/tests/permitted_list +++ b/src/sonic-device-data/tests/permitted_list @@ -19,6 +19,7 @@ dport_map_enable dport_map_indexed dport_map_port dpp_clock_ratio +dpr_clock_frequency ext_sram_freq ext_tcam_freq force_core_pll diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 92b54b1984..7f95a2a6f0 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 92b54b1984db0b71196e4fe68cc5a09796fd185c +Subproject commit 7f95a2a6f09b4dbaec9101fc9545bda95f541bea diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index c8931f30a0..366ac0e3dd 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit c8931f30a0068e5f6c432ce5c428dbe0c8976c23 +Subproject commit 366ac0e3dd92be276217be2432f3170312cf50da diff --git a/src/sonic-quagga b/src/sonic-quagga index 2e192c06b8..6397c2c9b5 160000 --- a/src/sonic-quagga +++ b/src/sonic-quagga @@ -1 +1 @@ -Subproject commit 2e192c06b8f526cab6fce710ab5da0223b0ba2b1 +Subproject commit 6397c2c9b588a2271aaf3f4d7383111db16d090a diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 8bf43a630f..dcab09f288 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 8bf43a630f8c7a6d028fa1c322685d1ee2d11fb1 +Subproject commit dcab09f2881a0b45a2c03c091e641ff66dfada8c diff --git a/src/sonic-swss b/src/sonic-swss index f437f9fa17..d6167643c0 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit f437f9fa173738f9ccf1b59313cc44c3da0a0c99 +Subproject commit d6167643c0ce4778ce1ec5be2530f48ef94ccc29