[devices]: support Silverstone platform (#3474)
* [device/celestica] Add silverstone device plugins and configs * add port led fireware of PAM4! * [platform/broadcom] Add Celestica silverstone platform module. * Add switch configuration Silverstone! * Add 128x100 configuration! * Delete serdes copper parameter! * [device/celestica] Fix incorrect index in Silverstone 128x100G port cfg * [platform/broadcom] Remove unrelated platform other than Silverstone * [device/celestica] Silverstone remove minigraphs * [device/celestica] Silverstone update sai.profile to use hwsku path * [device/celestica] Silverstone format sfputil codes * [device/celestica] Add speed column to Silverstone 32x400G port conf * [device/celestica] Silverstone disable 10G ports prevent orchagent crash *These ports will be added later after BRCM SAI support SFP. * Remove LED redundancy configuration and add comments! * [plugins/sfputil] update Silverstone ports to QSFP-DD type * [plugins/sfputil] Silverstone fix return NotImplementedError with raise
This commit is contained in:
parent
1b5c65fcf1
commit
368c4fa9fe
@ -0,0 +1,129 @@
|
||||
# name lanes alias index speed
|
||||
Ethernet0 33,34 QSFP1/1 1 100000
|
||||
Ethernet1 35,36 QSFP1/2 1 100000
|
||||
Ethernet2 37,38 QSFP1/3 1 100000
|
||||
Ethernet3 39,40 QSFP1/4 1 100000
|
||||
Ethernet4 41,42 QSFP2/1 2 100000
|
||||
Ethernet5 43,44 QSFP2/2 2 100000
|
||||
Ethernet6 45,46 QSFP2/3 2 100000
|
||||
Ethernet7 47,48 QSFP2/4 2 100000
|
||||
Ethernet8 49,50 QSFP3/1 3 100000
|
||||
Ethernet9 51,52 QSFP3/2 3 100000
|
||||
Ethernet10 53,54 QSFP3/3 3 100000
|
||||
Ethernet11 55,56 QSFP3/4 3 100000
|
||||
Ethernet12 57,58 QSFP4/1 4 100000
|
||||
Ethernet13 59,60 QSFP4/2 4 100000
|
||||
Ethernet14 61,62 QSFP4/3 4 100000
|
||||
Ethernet15 63,64 QSFP4/4 4 100000
|
||||
Ethernet16 65,66 QSFP5/1 5 100000
|
||||
Ethernet17 67,68 QSFP5/2 5 100000
|
||||
Ethernet18 69,70 QSFP5/3 5 100000
|
||||
Ethernet19 71,72 QSFP5/4 5 100000
|
||||
Ethernet20 73,74 QSFP6/1 6 100000
|
||||
Ethernet21 75,76 QSFP6/2 6 100000
|
||||
Ethernet22 77,78 QSFP6/3 6 100000
|
||||
Ethernet23 79,80 QSFP6/4 6 100000
|
||||
Ethernet24 81,82 QSFP7/1 7 100000
|
||||
Ethernet25 83,84 QSFP7/2 7 100000
|
||||
Ethernet26 85,86 QSFP7/3 7 100000
|
||||
Ethernet27 87,88 QSFP7/4 7 100000
|
||||
Ethernet28 89,90 QSFP8/1 8 100000
|
||||
Ethernet29 91,92 QSFP8/2 8 100000
|
||||
Ethernet30 93,94 QSFP8/3 8 100000
|
||||
Ethernet31 95,96 QSFP8/4 8 100000
|
||||
Ethernet32 1,2 QSFP9/1 9 100000
|
||||
Ethernet33 3,4 QSFP9/2 9 100000
|
||||
Ethernet34 5,6 QSFP9/3 9 100000
|
||||
Ethernet35 7,8 QSFP9/4 9 100000
|
||||
Ethernet36 9,10 QSFP10/1 10 100000
|
||||
Ethernet37 11,12 QSFP10/2 10 100000
|
||||
Ethernet38 13,14 QSFP10/3 10 100000
|
||||
Ethernet39 15,16 QSFP10/4 10 100000
|
||||
Ethernet40 17,18 QSFP11/1 11 100000
|
||||
Ethernet41 19,20 QSFP11/2 11 100000
|
||||
Ethernet42 21,22 QSFP11/3 11 100000
|
||||
Ethernet43 23,24 QSFP11/4 11 100000
|
||||
Ethernet44 25,26 QSFP12/1 12 100000
|
||||
Ethernet45 27,28 QSFP12/2 12 100000
|
||||
Ethernet46 29,30 QSFP12/3 12 100000
|
||||
Ethernet47 31,32 QSFP12/4 12 100000
|
||||
Ethernet48 97,98 QSFP13/1 13 100000
|
||||
Ethernet49 99,100 QSFP13/2 13 100000
|
||||
Ethernet50 101,102 QSFP13/3 13 100000
|
||||
Ethernet51 103,104 QSFP13/4 13 100000
|
||||
Ethernet52 105,106 QSFP14/1 14 100000
|
||||
Ethernet53 107,108 QSFP14/2 14 100000
|
||||
Ethernet54 109,110 QSFP14/3 14 100000
|
||||
Ethernet55 111,112 QSFP14/4 14 100000
|
||||
Ethernet56 113,114 QSFP15/1 15 100000
|
||||
Ethernet57 115,116 QSFP15/2 15 100000
|
||||
Ethernet58 117,118 QSFP15/3 15 100000
|
||||
Ethernet59 119,120 QSFP15/4 15 100000
|
||||
Ethernet60 121,122 QSFP16/1 16 100000
|
||||
Ethernet61 123,124 QSFP16/2 16 100000
|
||||
Ethernet62 125,126 QSFP16/3 16 100000
|
||||
Ethernet63 127,128 QSFP16/4 16 100000
|
||||
Ethernet64 129,130 QSFP17/1 17 100000
|
||||
Ethernet65 131,132 QSFP17/2 17 100000
|
||||
Ethernet66 133,134 QSFP17/3 17 100000
|
||||
Ethernet67 135,136 QSFP17/4 17 100000
|
||||
Ethernet68 137,138 QSFP18/1 18 100000
|
||||
Ethernet69 139,140 QSFP18/2 18 100000
|
||||
Ethernet70 141,142 QSFP18/3 18 100000
|
||||
Ethernet71 143,144 QSFP18/4 18 100000
|
||||
Ethernet72 145,146 QSFP19/1 19 100000
|
||||
Ethernet73 147,148 QSFP19/2 19 100000
|
||||
Ethernet74 149,150 QSFP19/3 19 100000
|
||||
Ethernet75 151,152 QSFP19/4 19 100000
|
||||
Ethernet76 153,154 QSFP20/1 20 100000
|
||||
Ethernet77 155,156 QSFP20/2 20 100000
|
||||
Ethernet78 157,158 QSFP20/3 20 100000
|
||||
Ethernet79 159,160 QSFP20/4 20 100000
|
||||
Ethernet80 225,226 QSFP21/1 21 100000
|
||||
Ethernet81 227,228 QSFP21/2 21 100000
|
||||
Ethernet82 229,230 QSFP21/3 21 100000
|
||||
Ethernet83 231,232 QSFP21/4 21 100000
|
||||
Ethernet84 233,234 QSFP22/1 22 100000
|
||||
Ethernet85 235,236 QSFP22/2 22 100000
|
||||
Ethernet86 237,238 QSFP22/3 22 100000
|
||||
Ethernet87 239,240 QSFP22/4 22 100000
|
||||
Ethernet88 241,242 QSFP23/1 23 100000
|
||||
Ethernet89 243,244 QSFP23/2 23 100000
|
||||
Ethernet90 245,246 QSFP23/3 23 100000
|
||||
Ethernet91 247,248 QSFP23/4 23 100000
|
||||
Ethernet92 249,250 QSFP24/1 24 100000
|
||||
Ethernet93 251,252 QSFP24/2 24 100000
|
||||
Ethernet94 253,254 QSFP24/3 24 100000
|
||||
Ethernet95 255,256 QSFP24/4 24 100000
|
||||
Ethernet96 161,162 QSFP25/1 25 100000
|
||||
Ethernet97 163,164 QSFP25/2 25 100000
|
||||
Ethernet98 165,166 QSFP25/3 25 100000
|
||||
Ethernet99 167,168 QSFP25/4 25 100000
|
||||
Ethernet100 169,170 QSFP26/1 26 100000
|
||||
Ethernet101 171,172 QSFP26/2 26 100000
|
||||
Ethernet102 173,174 QSFP26/3 26 100000
|
||||
Ethernet103 175,176 QSFP26/4 26 100000
|
||||
Ethernet104 177,178 QSFP27/1 27 100000
|
||||
Ethernet105 179,180 QSFP27/2 27 100000
|
||||
Ethernet106 181,182 QSFP27/3 27 100000
|
||||
Ethernet107 183,184 QSFP27/4 27 100000
|
||||
Ethernet108 185,186 QSFP28/1 28 100000
|
||||
Ethernet109 187,188 QSFP28/2 28 100000
|
||||
Ethernet110 189,190 QSFP28/3 28 100000
|
||||
Ethernet111 191,192 QSFP28/4 28 100000
|
||||
Ethernet112 193,194 QSFP29/1 29 100000
|
||||
Ethernet113 195,196 QSFP29/2 29 100000
|
||||
Ethernet114 197,198 QSFP29/3 29 100000
|
||||
Ethernet115 199,200 QSFP29/4 29 100000
|
||||
Ethernet116 201,202 QSFP30/1 30 100000
|
||||
Ethernet117 203,204 QSFP30/2 30 100000
|
||||
Ethernet118 205,206 QSFP30/3 30 100000
|
||||
Ethernet119 207,208 QSFP30/4 30 100000
|
||||
Ethernet120 209,210 QSFP31/1 31 100000
|
||||
Ethernet121 211,212 QSFP31/2 31 100000
|
||||
Ethernet122 213,214 QSFP31/3 31 100000
|
||||
Ethernet123 215,216 QSFP31/4 31 100000
|
||||
Ethernet124 217,218 QSFP32/1 32 100000
|
||||
Ethernet125 219,220 QSFP32/2 32 100000
|
||||
Ethernet126 221,222 QSFP32/3 32 100000
|
||||
Ethernet127 223,224 QSFP32/4 32 100000
|
@ -0,0 +1 @@
|
||||
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th3-128x100G.config.bcm
|
@ -0,0 +1,441 @@
|
||||
pbmp_xport_xe.0=0x8ffff8ffffcffff8ffff8ffff8ffffcffff9fffe
|
||||
ccm_dma_enable=0
|
||||
ccmdma_intr_enable=0
|
||||
ctr_evict_enable=0
|
||||
mem_cache_enable=0
|
||||
parity_correction=0
|
||||
parity_enable=0
|
||||
phy_enable=0
|
||||
phy_null=1
|
||||
pll_bypass=1
|
||||
|
||||
init_all_modules=0
|
||||
|
||||
portmap_20=33:100:2
|
||||
portmap_21=35:100:2
|
||||
portmap_22=37:100:2
|
||||
portmap_23=39:100:2
|
||||
|
||||
portmap_24=41:100:2
|
||||
portmap_25=43:100:2
|
||||
portmap_26=45:100:2
|
||||
portmap_27=47:100:2
|
||||
|
||||
portmap_28=49:100:2
|
||||
portmap_29=51:100:2
|
||||
portmap_30=53:100:2
|
||||
portmap_31=55:100:2
|
||||
|
||||
portmap_32=57:100:2
|
||||
portmap_33=59:100:2
|
||||
portmap_34=61:100:2
|
||||
portmap_35=63:100:2
|
||||
|
||||
portmap_40=65:100:2
|
||||
portmap_41=67:100:2
|
||||
portmap_42=69:100:2
|
||||
portmap_43=71:100:2
|
||||
|
||||
portmap_44=73:100:2
|
||||
portmap_45=75:100:2
|
||||
portmap_46=77:100:2
|
||||
portmap_47=79:100:2
|
||||
|
||||
portmap_48=81:100:2
|
||||
portmap_49=83:100:2
|
||||
portmap_50=85:100:2
|
||||
portmap_51=87:100:2
|
||||
|
||||
portmap_52=89:100:2
|
||||
portmap_53=91:100:2
|
||||
portmap_54=93:100:2
|
||||
portmap_55=95:100:2
|
||||
|
||||
portmap_1=1:100:2
|
||||
portmap_2=3:100:2
|
||||
portmap_3=5:100:2
|
||||
portmap_4=7:100:2
|
||||
|
||||
portmap_5=9:100:2
|
||||
portmap_6=11:100:2
|
||||
portmap_7=13:100:2
|
||||
portmap_8=15:100:2
|
||||
|
||||
portmap_9=17:100:2
|
||||
portmap_10=19:100:2
|
||||
portmap_11=21:100:2
|
||||
portmap_12=23:100:2
|
||||
|
||||
portmap_13=25:100:2
|
||||
portmap_14=27:100:2
|
||||
portmap_15=29:100:2
|
||||
portmap_16=31:100:2
|
||||
|
||||
portmap_60=97:100:2
|
||||
portmap_61=99:100:2
|
||||
portmap_62=101:100:2
|
||||
portmap_63=103:100:2
|
||||
|
||||
portmap_64=105:100:2
|
||||
portmap_65=107:100:2
|
||||
portmap_66=109:100:2
|
||||
portmap_67=111:100:2
|
||||
|
||||
portmap_68=113:100:2
|
||||
portmap_69=115:100:2
|
||||
portmap_70=117:100:2
|
||||
portmap_71=119:100:2
|
||||
|
||||
portmap_72=121:100:2
|
||||
portmap_73=123:100:2
|
||||
portmap_74=125:100:2
|
||||
portmap_75=127:100:2
|
||||
|
||||
portmap_80=129:100:2
|
||||
portmap_81=131:100:2
|
||||
portmap_82=133:100:2
|
||||
portmap_83=135:100:2
|
||||
|
||||
portmap_84=137:100:2
|
||||
portmap_85=139:100:2
|
||||
portmap_86=141:100:2
|
||||
portmap_87=143:100:2
|
||||
|
||||
portmap_88=145:100:2
|
||||
portmap_89=147:100:2
|
||||
portmap_90=149:100:2
|
||||
portmap_91=151:100:2
|
||||
|
||||
portmap_92=153:100:2
|
||||
portmap_93=155:100:2
|
||||
portmap_94=157:100:2
|
||||
portmap_95=159:100:2
|
||||
|
||||
portmap_140=225:100:2
|
||||
portmap_141=227:100:2
|
||||
portmap_142=229:100:2
|
||||
portmap_143=231:100:2
|
||||
|
||||
portmap_144=233:100:2
|
||||
portmap_145=235:100:2
|
||||
portmap_146=237:100:2
|
||||
portmap_147=239:100:2
|
||||
|
||||
portmap_148=241:100:2
|
||||
portmap_149=243:100:2
|
||||
portmap_150=245:100:2
|
||||
portmap_151=247:100:2
|
||||
|
||||
portmap_152=249:100:2
|
||||
portmap_153=251:100:2
|
||||
portmap_154=253:100:2
|
||||
portmap_155=255:100:2
|
||||
|
||||
portmap_100=161:100:2
|
||||
portmap_101=163:100:2
|
||||
portmap_102=165:100:2
|
||||
portmap_103=167:100:2
|
||||
|
||||
portmap_104=169:100:2
|
||||
portmap_105=171:100:2
|
||||
portmap_106=173:100:2
|
||||
portmap_107=175:100:2
|
||||
|
||||
portmap_108=177:100:2
|
||||
portmap_109=179:100:2
|
||||
portmap_110=181:100:2
|
||||
portmap_111=183:100:2
|
||||
|
||||
portmap_112=185:100:2
|
||||
portmap_113=187:100:2
|
||||
portmap_114=189:100:2
|
||||
portmap_115=191:100:2
|
||||
|
||||
portmap_120=193:100:2
|
||||
portmap_121=195:100:2
|
||||
portmap_122=197:100:2
|
||||
portmap_123=199:100:2
|
||||
|
||||
portmap_124=201:100:2
|
||||
portmap_125=203:100:2
|
||||
portmap_126=205:100:2
|
||||
portmap_127=207:100:2
|
||||
|
||||
portmap_128=209:100:2
|
||||
portmap_129=211:100:2
|
||||
portmap_130=213:100:2
|
||||
portmap_131=215:100:2
|
||||
|
||||
portmap_132=217:100:2
|
||||
portmap_133=219:100:2
|
||||
portmap_134=221:100:2
|
||||
portmap_135=223:100:2
|
||||
|
||||
phy_chain_rx_lane_map_physical{33.0}=0x65732041
|
||||
phy_chain_tx_lane_map_physical{33.0}=0x47206531
|
||||
phy_chain_rx_lane_map_physical{41.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{41.0}=0x36207514
|
||||
phy_chain_rx_lane_map_physical{49.0}=0x54632071
|
||||
phy_chain_tx_lane_map_physical{49.0}=0x06241735
|
||||
phy_chain_rx_lane_map_physical{57.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{57.0}=0x35207614
|
||||
phy_chain_rx_lane_map_physical{65.0}=0x45623170
|
||||
phy_chain_tx_lane_map_physical{65.0}=0x51260734
|
||||
phy_chain_rx_lane_map_physical{73.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{73.0}=0x37245610
|
||||
phy_chain_rx_lane_map_physical{81.0}=0x45632071
|
||||
phy_chain_tx_lane_map_physical{81.0}=0x51260734
|
||||
phy_chain_rx_lane_map_physical{89.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{89.0}=0x26437510
|
||||
phy_chain_rx_lane_map_physical{1.0}=0x30176524
|
||||
phy_chain_tx_lane_map_physical{1.0}=0x20615374
|
||||
phy_chain_rx_lane_map_physical{9.0}=0x37562041
|
||||
phy_chain_tx_lane_map_physical{9.0}=0x05176432
|
||||
phy_chain_rx_lane_map_physical{17.0}=0x43607251
|
||||
phy_chain_tx_lane_map_physical{17.0}=0x70261435
|
||||
phy_chain_rx_lane_map_physical{25.0}=0x60347125
|
||||
phy_chain_tx_lane_map_physical{25.0}=0x46357120
|
||||
phy_chain_rx_lane_map_physical{97.0}=0x47601352
|
||||
phy_chain_tx_lane_map_physical{97.0}=0x04265137
|
||||
phy_chain_rx_lane_map_physical{105.0}=0x73206415
|
||||
phy_chain_tx_lane_map_physical{105.0}=0x26374150
|
||||
phy_chain_rx_lane_map_physical{113.0}=0x47632051
|
||||
phy_chain_tx_lane_map_physical{113.0}=0x03254617
|
||||
phy_chain_rx_lane_map_physical{121.0}=0x63027415
|
||||
phy_chain_tx_lane_map_physical{121.0}=0x63721045
|
||||
phy_chain_rx_lane_map_physical{129.0}=0x30154627
|
||||
phy_chain_tx_lane_map_physical{129.0}=0x04735261
|
||||
phy_chain_rx_lane_map_physical{137.0}=0x24753061
|
||||
phy_chain_tx_lane_map_physical{137.0}=0x37614520
|
||||
phy_chain_rx_lane_map_physical{145.0}=0x47601352
|
||||
phy_chain_tx_lane_map_physical{145.0}=0x63274510
|
||||
phy_chain_rx_lane_map_physical{153.0}=0x07361524
|
||||
phy_chain_tx_lane_map_physical{153.0}=0x36527104
|
||||
phy_chain_rx_lane_map_physical{225.0}=0x56410273
|
||||
phy_chain_tx_lane_map_physical{225.0}=0x10274635
|
||||
phy_chain_rx_lane_map_physical{233.0}=0x15740263
|
||||
phy_chain_tx_lane_map_physical{233.0}=0x24351607
|
||||
phy_chain_rx_lane_map_physical{241.0}=0x74015263
|
||||
phy_chain_tx_lane_map_physical{241.0}=0x04152637
|
||||
phy_chain_rx_lane_map_physical{249.0}=0x62037514
|
||||
phy_chain_tx_lane_map_physical{249.0}=0x72453160
|
||||
phy_chain_rx_lane_map_physical{161.0}=0x46510273
|
||||
phy_chain_tx_lane_map_physical{161.0}=0x01653724
|
||||
phy_chain_rx_lane_map_physical{169.0}=0x25743160
|
||||
phy_chain_tx_lane_map_physical{169.0}=0x07216435
|
||||
phy_chain_rx_lane_map_physical{177.0}=0x46510273
|
||||
phy_chain_tx_lane_map_physical{177.0}=0x01652734
|
||||
phy_chain_rx_lane_map_physical{185.0}=0x25743160
|
||||
phy_chain_tx_lane_map_physical{185.0}=0x37016425
|
||||
phy_chain_rx_lane_map_physical{193.0}=0x46510372
|
||||
phy_chain_tx_lane_map_physical{193.0}=0x06153724
|
||||
phy_chain_rx_lane_map_physical{201.0}=0x25743160
|
||||
phy_chain_tx_lane_map_physical{201.0}=0x36017524
|
||||
phy_chain_rx_lane_map_physical{209.0}=0x47601352
|
||||
phy_chain_tx_lane_map_physical{209.0}=0x04152736
|
||||
phy_chain_rx_lane_map_physical{217.0}=0x26453170
|
||||
phy_chain_tx_lane_map_physical{217.0}=0x36027415
|
||||
|
||||
serdes_core_rx_polarity_flip_physical{33}=0x29
|
||||
serdes_core_tx_polarity_flip_physical{33}=0xfe
|
||||
serdes_core_rx_polarity_flip_physical{41}=0xb1
|
||||
serdes_core_tx_polarity_flip_physical{41}=0xe8
|
||||
serdes_core_rx_polarity_flip_physical{49}=0xca
|
||||
serdes_core_tx_polarity_flip_physical{49}=0xb6
|
||||
serdes_core_rx_polarity_flip_physical{57}=0x9b
|
||||
serdes_core_tx_polarity_flip_physical{57}=0xdc
|
||||
serdes_core_rx_polarity_flip_physical{65}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{65}=0x86
|
||||
serdes_core_rx_polarity_flip_physical{73}=0x9b
|
||||
serdes_core_tx_polarity_flip_physical{73}=0x55
|
||||
serdes_core_rx_polarity_flip_physical{81}=0xa
|
||||
serdes_core_tx_polarity_flip_physical{81}=0x6
|
||||
serdes_core_rx_polarity_flip_physical{89}=0x9b
|
||||
serdes_core_tx_polarity_flip_physical{89}=0x48
|
||||
serdes_core_rx_polarity_flip_physical{1}=0xec
|
||||
serdes_core_tx_polarity_flip_physical{1}=0x56
|
||||
serdes_core_rx_polarity_flip_physical{9}=0x13
|
||||
serdes_core_tx_polarity_flip_physical{9}=0xa6
|
||||
serdes_core_rx_polarity_flip_physical{17}=0x5a
|
||||
serdes_core_tx_polarity_flip_physical{17}=0xc6
|
||||
serdes_core_rx_polarity_flip_physical{25}=0xf
|
||||
serdes_core_tx_polarity_flip_physical{25}=0x4e
|
||||
serdes_core_rx_polarity_flip_physical{97}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{97}=0x2e
|
||||
serdes_core_rx_polarity_flip_physical{105}=0xce
|
||||
serdes_core_tx_polarity_flip_physical{105}=0x7c
|
||||
serdes_core_rx_polarity_flip_physical{113}=0xa
|
||||
serdes_core_tx_polarity_flip_physical{113}=0x35
|
||||
|
||||
serdes_core_rx_polarity_flip_physical{121}=0xb9
|
||||
serdes_core_tx_polarity_flip_physical{121}=0xef
|
||||
serdes_core_rx_polarity_flip_physical{129}=0xe8
|
||||
serdes_core_tx_polarity_flip_physical{129}=0xac
|
||||
serdes_core_rx_polarity_flip_physical{137}=0xcb
|
||||
serdes_core_tx_polarity_flip_physical{137}=0x9c
|
||||
serdes_core_rx_polarity_flip_physical{145}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{145}=0x32
|
||||
serdes_core_rx_polarity_flip_physical{153}=0xb9
|
||||
serdes_core_tx_polarity_flip_physical{153}=0xaf
|
||||
serdes_core_rx_polarity_flip_physical{225}=0xaa
|
||||
serdes_core_tx_polarity_flip_physical{225}=0x7
|
||||
serdes_core_rx_polarity_flip_physical{233}=0x31
|
||||
serdes_core_tx_polarity_flip_physical{233}=0x47
|
||||
serdes_core_rx_polarity_flip_physical{241}=0xe8
|
||||
serdes_core_tx_polarity_flip_physical{241}=0x9e
|
||||
serdes_core_rx_polarity_flip_physical{249}=0xec
|
||||
serdes_core_tx_polarity_flip_physical{249}=0x1f
|
||||
serdes_core_rx_polarity_flip_physical{161}=0x6a
|
||||
serdes_core_tx_polarity_flip_physical{161}=0xd4
|
||||
serdes_core_rx_polarity_flip_physical{169}=0x9e
|
||||
serdes_core_tx_polarity_flip_physical{169}=0x7b
|
||||
serdes_core_rx_polarity_flip_physical{177}=0x6a
|
||||
serdes_core_tx_polarity_flip_physical{177}=0xcc
|
||||
serdes_core_rx_polarity_flip_physical{185}=0x9e
|
||||
serdes_core_tx_polarity_flip_physical{185}=0x58
|
||||
serdes_core_rx_polarity_flip_physical{193}=0x6f
|
||||
serdes_core_tx_polarity_flip_physical{193}=0x24
|
||||
serdes_core_rx_polarity_flip_physical{201}=0x9e
|
||||
serdes_core_tx_polarity_flip_physical{201}=0xdf
|
||||
serdes_core_rx_polarity_flip_physical{209}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{209}=0xe9
|
||||
serdes_core_rx_polarity_flip_physical{217}=0xec
|
||||
serdes_core_tx_polarity_flip_physical{217}=0x68
|
||||
|
||||
|
||||
dport_map_port_20=1
|
||||
dport_map_port_21=2
|
||||
dport_map_port_22=3
|
||||
dport_map_port_23=4
|
||||
dport_map_port_24=5
|
||||
dport_map_port_25=6
|
||||
dport_map_port_26=7
|
||||
dport_map_port_27=8
|
||||
dport_map_port_28=9
|
||||
dport_map_port_29=10
|
||||
dport_map_port_30=11
|
||||
dport_map_port_31=12
|
||||
dport_map_port_32=13
|
||||
dport_map_port_33=14
|
||||
dport_map_port_34=15
|
||||
dport_map_port_35=16
|
||||
dport_map_port_40=17
|
||||
dport_map_port_41=18
|
||||
dport_map_port_42=19
|
||||
dport_map_port_43=20
|
||||
dport_map_port_44=21
|
||||
dport_map_port_45=22
|
||||
dport_map_port_46=23
|
||||
dport_map_port_47=24
|
||||
dport_map_port_48=25
|
||||
dport_map_port_49=26
|
||||
dport_map_port_50=27
|
||||
dport_map_port_51=28
|
||||
dport_map_port_52=29
|
||||
dport_map_port_53=30
|
||||
dport_map_port_54=31
|
||||
dport_map_port_55=32
|
||||
dport_map_port_1=33
|
||||
dport_map_port_2=34
|
||||
dport_map_port_3=35
|
||||
dport_map_port_4=36
|
||||
dport_map_port_5=37
|
||||
dport_map_port_6=38
|
||||
dport_map_port_7=39
|
||||
dport_map_port_8=40
|
||||
dport_map_port_9=41
|
||||
dport_map_port_10=42
|
||||
dport_map_port_11=43
|
||||
dport_map_port_12=44
|
||||
dport_map_port_13=45
|
||||
dport_map_port_14=46
|
||||
dport_map_port_15=47
|
||||
dport_map_port_16=48
|
||||
dport_map_port_60=49
|
||||
dport_map_port_61=50
|
||||
dport_map_port_62=51
|
||||
dport_map_port_63=52
|
||||
dport_map_port_64=53
|
||||
dport_map_port_65=54
|
||||
dport_map_port_66=55
|
||||
dport_map_port_67=56
|
||||
dport_map_port_68=57
|
||||
dport_map_port_69=58
|
||||
dport_map_port_70=59
|
||||
dport_map_port_71=60
|
||||
dport_map_port_72=61
|
||||
dport_map_port_73=62
|
||||
dport_map_port_74=63
|
||||
dport_map_port_75=64
|
||||
dport_map_port_80=65
|
||||
dport_map_port_81=66
|
||||
dport_map_port_82=67
|
||||
dport_map_port_83=68
|
||||
dport_map_port_84=69
|
||||
dport_map_port_85=70
|
||||
dport_map_port_86=71
|
||||
dport_map_port_87=72
|
||||
dport_map_port_88=73
|
||||
dport_map_port_89=74
|
||||
dport_map_port_90=75
|
||||
dport_map_port_91=76
|
||||
dport_map_port_92=77
|
||||
dport_map_port_93=78
|
||||
dport_map_port_94=79
|
||||
dport_map_port_95=80
|
||||
dport_map_port_140=81
|
||||
dport_map_port_141=82
|
||||
dport_map_port_142=83
|
||||
dport_map_port_143=84
|
||||
dport_map_port_144=85
|
||||
dport_map_port_145=86
|
||||
dport_map_port_146=87
|
||||
dport_map_port_147=88
|
||||
dport_map_port_148=89
|
||||
dport_map_port_149=90
|
||||
dport_map_port_150=91
|
||||
dport_map_port_151=92
|
||||
dport_map_port_152=93
|
||||
dport_map_port_153=94
|
||||
dport_map_port_154=95
|
||||
dport_map_port_155=96
|
||||
dport_map_port_100=97
|
||||
dport_map_port_101=98
|
||||
dport_map_port_102=99
|
||||
dport_map_port_103=100
|
||||
dport_map_port_104=101
|
||||
dport_map_port_105=102
|
||||
dport_map_port_106=103
|
||||
dport_map_port_107=104
|
||||
dport_map_port_108=105
|
||||
dport_map_port_109=106
|
||||
dport_map_port_110=107
|
||||
dport_map_port_111=108
|
||||
dport_map_port_112=109
|
||||
dport_map_port_113=110
|
||||
dport_map_port_114=111
|
||||
dport_map_port_115=112
|
||||
dport_map_port_120=113
|
||||
dport_map_port_121=114
|
||||
dport_map_port_122=115
|
||||
dport_map_port_123=116
|
||||
dport_map_port_124=117
|
||||
dport_map_port_125=118
|
||||
dport_map_port_126=119
|
||||
dport_map_port_127=120
|
||||
dport_map_port_128=121
|
||||
dport_map_port_129=122
|
||||
dport_map_port_130=123
|
||||
dport_map_port_131=124
|
||||
dport_map_port_132=125
|
||||
dport_map_port_133=126
|
||||
dport_map_port_134=127
|
||||
dport_map_port_135=128
|
||||
|
||||
core_clock_frequency=1325
|
||||
dpr_clock_frequency=1000
|
||||
device_clock_frequency=1325
|
||||
port_flex_enable=1
|
||||
|
||||
#firmware load method, use fast load
|
||||
load_firmware=0x2
|
@ -0,0 +1,33 @@
|
||||
# name lanes alias index speed
|
||||
Ethernet0 33,34,35,36,37,38,39,40 QSFPDD1 1 400000
|
||||
Ethernet4 41,42,43,44,45,46,47,48 QSFPDD2 2 400000
|
||||
Ethernet8 49,50,51,52,53,54,55,56 QSFPDD3 3 400000
|
||||
Ethernet12 57,58,59,60,61,62,63,64 QSFPDD4 4 400000
|
||||
Ethernet16 65,66,67,68,69,70,71,72 QSFPDD5 5 400000
|
||||
Ethernet20 73,74,75,76,77,78,79,80 QSFPDD6 6 400000
|
||||
Ethernet24 81,82,83,84,85,86,87,88 QSFPDD7 7 400000
|
||||
Ethernet28 89,90,91,92,93,94,95,96 QSFPDD8 8 400000
|
||||
Ethernet32 1,2,3,4,5,6,7,8 QSFPDD9 9 400000
|
||||
Ethernet36 9,10,11,12,13,14,15,16 QSFPDD10 10 400000
|
||||
Ethernet40 17,18,19,20,21,22,23,24 QSFPDD11 11 400000
|
||||
Ethernet44 25,26,27,28,29,30,31,32 QSFPDD12 12 400000
|
||||
Ethernet48 97,98,99,100,101,102,103,104 QSFPDD13 13 400000
|
||||
Ethernet52 105,106,107,108,109,110,111,112 QSFPDD14 14 400000
|
||||
Ethernet56 113,114,115,116,117,118,119,120 QSFPDD15 15 400000
|
||||
Ethernet60 121,122,123,124,125,126,127,128 QSFPDD16 16 400000
|
||||
Ethernet64 129,130,131,132,133,134,135,136 QSFPDD17 17 400000
|
||||
Ethernet68 137,138,139,140,141,142,143,144 QSFPDD18 18 400000
|
||||
Ethernet72 145,146,147,148,149,150,151,152 QSFPDD19 19 400000
|
||||
Ethernet76 153,154,155,156,157,158,159,160 QSFPDD20 20 400000
|
||||
Ethernet80 225,226,227,228,229,230,231,232 QSFPDD21 21 400000
|
||||
Ethernet84 233,234,235,236,237,238,239,240 QSFPDD22 22 400000
|
||||
Ethernet88 241,242,243,244,245,246,247,248 QSFPDD23 23 400000
|
||||
Ethernet92 249,250,251,252,253,254,255,256 QSFPDD24 24 400000
|
||||
Ethernet96 161,162,163,164,165,166,167,168 QSFPDD25 25 400000
|
||||
Ethernet100 169,170,171,172,173,174,175,176 QSFPDD26 26 400000
|
||||
Ethernet104 177,178,179,180,181,182,183,184 QSFPDD27 27 400000
|
||||
Ethernet108 185,186,187,188,189,190,191,192 QSFPDD28 28 400000
|
||||
Ethernet112 193,194,195,196,197,198,199,200 QSFPDD29 29 400000
|
||||
Ethernet116 201,202,203,204,205,206,207,208 QSFPDD30 30 400000
|
||||
Ethernet120 209,210,211,212,213,214,215,216 QSFPDD31 31 400000
|
||||
Ethernet124 217,218,219,220,221,222,223,224 QSFPDD32 32 400000
|
@ -0,0 +1 @@
|
||||
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th3-32x400G.config.bcm
|
@ -0,0 +1,231 @@
|
||||
|
||||
pbmp_xport_xe.0=0x8111181111c1111811118111181111c111182222
|
||||
ccm_dma_enable=0
|
||||
ccmdma_intr_enable=0
|
||||
ctr_evict_enable=0
|
||||
mem_cache_enable=0
|
||||
parity_correction=0
|
||||
parity_enable=0
|
||||
phy_enable=0
|
||||
phy_null=1
|
||||
pll_bypass=1
|
||||
|
||||
init_all_modules=0
|
||||
|
||||
|
||||
|
||||
#portmap_38=257:10
|
||||
#portmap_118=258:10
|
||||
|
||||
|
||||
portmap_20=33:400
|
||||
portmap_24=41:400
|
||||
portmap_28=49:400
|
||||
portmap_32=57:400
|
||||
portmap_40=65:400
|
||||
portmap_44=73:400
|
||||
portmap_48=81:400
|
||||
portmap_52=89:400
|
||||
portmap_1=1:400
|
||||
portmap_5=9:400
|
||||
portmap_9=17:400
|
||||
portmap_13=25:400
|
||||
portmap_60=97:400
|
||||
portmap_64=105:400
|
||||
portmap_68=113:400
|
||||
portmap_72=121:400
|
||||
portmap_80=129:400
|
||||
portmap_84=137:400
|
||||
portmap_88=145:400
|
||||
portmap_92=153:400
|
||||
portmap_140=225:400
|
||||
portmap_144=233:400
|
||||
portmap_148=241:400
|
||||
portmap_152=249:400
|
||||
portmap_100=161:400
|
||||
portmap_104=169:400
|
||||
portmap_108=177:400
|
||||
portmap_112=185:400
|
||||
portmap_120=193:400
|
||||
portmap_124=201:400
|
||||
portmap_128=209:400
|
||||
portmap_132=217:400
|
||||
|
||||
phy_chain_rx_lane_map_physical{33.0}=0x65732041
|
||||
phy_chain_tx_lane_map_physical{33.0}=0x47206531
|
||||
phy_chain_rx_lane_map_physical{41.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{41.0}=0x36207514
|
||||
phy_chain_rx_lane_map_physical{49.0}=0x54632071
|
||||
phy_chain_tx_lane_map_physical{49.0}=0x06241735
|
||||
phy_chain_rx_lane_map_physical{57.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{57.0}=0x35207614
|
||||
phy_chain_rx_lane_map_physical{65.0}=0x45623170
|
||||
phy_chain_tx_lane_map_physical{65.0}=0x51260734
|
||||
phy_chain_rx_lane_map_physical{73.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{73.0}=0x37245610
|
||||
phy_chain_rx_lane_map_physical{81.0}=0x45632071
|
||||
phy_chain_tx_lane_map_physical{81.0}=0x51260734
|
||||
phy_chain_rx_lane_map_physical{89.0}=0x07561243
|
||||
phy_chain_tx_lane_map_physical{89.0}=0x26437510
|
||||
phy_chain_rx_lane_map_physical{1.0}=0x30176524
|
||||
phy_chain_tx_lane_map_physical{1.0}=0x20615374
|
||||
phy_chain_rx_lane_map_physical{9.0}=0x37562041
|
||||
phy_chain_tx_lane_map_physical{9.0}=0x05176432
|
||||
phy_chain_rx_lane_map_physical{17.0}=0x43607251
|
||||
phy_chain_tx_lane_map_physical{17.0}=0x70261435
|
||||
phy_chain_rx_lane_map_physical{25.0}=0x60347125
|
||||
phy_chain_tx_lane_map_physical{25.0}=0x46357120
|
||||
phy_chain_rx_lane_map_physical{97.0}=0x47601352
|
||||
phy_chain_tx_lane_map_physical{97.0}=0x04265137
|
||||
phy_chain_rx_lane_map_physical{105.0}=0x73206415
|
||||
phy_chain_tx_lane_map_physical{105.0}=0x26374150
|
||||
phy_chain_rx_lane_map_physical{113.0}=0x47632051
|
||||
phy_chain_tx_lane_map_physical{113.0}=0x03254617
|
||||
phy_chain_rx_lane_map_physical{121.0}=0x63027415
|
||||
phy_chain_tx_lane_map_physical{121.0}=0x63721045
|
||||
phy_chain_rx_lane_map_physical{129.0}=0x30154627
|
||||
phy_chain_tx_lane_map_physical{129.0}=0x04735261
|
||||
phy_chain_rx_lane_map_physical{137.0}=0x24753061
|
||||
phy_chain_tx_lane_map_physical{137.0}=0x37614520
|
||||
phy_chain_rx_lane_map_physical{145.0}=0x47601352
|
||||
phy_chain_tx_lane_map_physical{145.0}=0x63274510
|
||||
phy_chain_rx_lane_map_physical{153.0}=0x07361524
|
||||
phy_chain_tx_lane_map_physical{153.0}=0x36527104
|
||||
phy_chain_rx_lane_map_physical{225.0}=0x56410273
|
||||
phy_chain_tx_lane_map_physical{225.0}=0x10274635
|
||||
phy_chain_rx_lane_map_physical{233.0}=0x15740263
|
||||
phy_chain_tx_lane_map_physical{233.0}=0x24351607
|
||||
phy_chain_rx_lane_map_physical{241.0}=0x74015263
|
||||
phy_chain_tx_lane_map_physical{241.0}=0x04152637
|
||||
phy_chain_rx_lane_map_physical{249.0}=0x62037514
|
||||
phy_chain_tx_lane_map_physical{249.0}=0x72453160
|
||||
phy_chain_rx_lane_map_physical{161.0}=0x46510273
|
||||
phy_chain_tx_lane_map_physical{161.0}=0x01653724
|
||||
phy_chain_rx_lane_map_physical{169.0}=0x25743160
|
||||
phy_chain_tx_lane_map_physical{169.0}=0x07216435
|
||||
phy_chain_rx_lane_map_physical{177.0}=0x46510273
|
||||
phy_chain_tx_lane_map_physical{177.0}=0x01652734
|
||||
phy_chain_rx_lane_map_physical{185.0}=0x25743160
|
||||
phy_chain_tx_lane_map_physical{185.0}=0x37016425
|
||||
phy_chain_rx_lane_map_physical{193.0}=0x46510372
|
||||
phy_chain_tx_lane_map_physical{193.0}=0x06153724
|
||||
phy_chain_rx_lane_map_physical{201.0}=0x25743160
|
||||
phy_chain_tx_lane_map_physical{201.0}=0x36017524
|
||||
phy_chain_rx_lane_map_physical{209.0}=0x47601352
|
||||
phy_chain_tx_lane_map_physical{209.0}=0x04152736
|
||||
phy_chain_rx_lane_map_physical{217.0}=0x26453170
|
||||
phy_chain_tx_lane_map_physical{217.0}=0x36027415
|
||||
|
||||
serdes_core_rx_polarity_flip_physical{33}=0x29
|
||||
serdes_core_tx_polarity_flip_physical{33}=0xfe
|
||||
serdes_core_rx_polarity_flip_physical{41}=0xb1
|
||||
serdes_core_tx_polarity_flip_physical{41}=0xe8
|
||||
serdes_core_rx_polarity_flip_physical{49}=0xca
|
||||
serdes_core_tx_polarity_flip_physical{49}=0xb6
|
||||
serdes_core_rx_polarity_flip_physical{57}=0x9b
|
||||
serdes_core_tx_polarity_flip_physical{57}=0xdc
|
||||
serdes_core_rx_polarity_flip_physical{65}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{65}=0x86
|
||||
serdes_core_rx_polarity_flip_physical{73}=0x9b
|
||||
serdes_core_tx_polarity_flip_physical{73}=0x55
|
||||
serdes_core_rx_polarity_flip_physical{81}=0xa
|
||||
serdes_core_tx_polarity_flip_physical{81}=0x6
|
||||
serdes_core_rx_polarity_flip_physical{89}=0x9b
|
||||
serdes_core_tx_polarity_flip_physical{89}=0x48
|
||||
serdes_core_rx_polarity_flip_physical{1}=0xec
|
||||
serdes_core_tx_polarity_flip_physical{1}=0x56
|
||||
serdes_core_rx_polarity_flip_physical{9}=0x13
|
||||
serdes_core_tx_polarity_flip_physical{9}=0xa6
|
||||
serdes_core_rx_polarity_flip_physical{17}=0x5a
|
||||
serdes_core_tx_polarity_flip_physical{17}=0xc6
|
||||
serdes_core_rx_polarity_flip_physical{25}=0xf
|
||||
serdes_core_tx_polarity_flip_physical{25}=0x4e
|
||||
serdes_core_rx_polarity_flip_physical{97}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{97}=0x2e
|
||||
serdes_core_rx_polarity_flip_physical{105}=0xce
|
||||
serdes_core_tx_polarity_flip_physical{105}=0x7c
|
||||
serdes_core_rx_polarity_flip_physical{113}=0xa
|
||||
serdes_core_tx_polarity_flip_physical{113}=0x35
|
||||
|
||||
serdes_core_rx_polarity_flip_physical{121}=0xb9
|
||||
serdes_core_tx_polarity_flip_physical{121}=0xef
|
||||
serdes_core_rx_polarity_flip_physical{129}=0xe8
|
||||
serdes_core_tx_polarity_flip_physical{129}=0xac
|
||||
serdes_core_rx_polarity_flip_physical{137}=0xcb
|
||||
serdes_core_tx_polarity_flip_physical{137}=0x9c
|
||||
serdes_core_rx_polarity_flip_physical{145}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{145}=0x32
|
||||
serdes_core_rx_polarity_flip_physical{153}=0xb9
|
||||
serdes_core_tx_polarity_flip_physical{153}=0xaf
|
||||
serdes_core_rx_polarity_flip_physical{225}=0xaa
|
||||
serdes_core_tx_polarity_flip_physical{225}=0x7
|
||||
serdes_core_rx_polarity_flip_physical{233}=0x31
|
||||
serdes_core_tx_polarity_flip_physical{233}=0x47
|
||||
serdes_core_rx_polarity_flip_physical{241}=0xe8
|
||||
serdes_core_tx_polarity_flip_physical{241}=0x9e
|
||||
serdes_core_rx_polarity_flip_physical{249}=0xec
|
||||
serdes_core_tx_polarity_flip_physical{249}=0x1f
|
||||
serdes_core_rx_polarity_flip_physical{161}=0x6a
|
||||
serdes_core_tx_polarity_flip_physical{161}=0xd4
|
||||
serdes_core_rx_polarity_flip_physical{169}=0x9e
|
||||
serdes_core_tx_polarity_flip_physical{169}=0x7b
|
||||
serdes_core_rx_polarity_flip_physical{177}=0x6a
|
||||
serdes_core_tx_polarity_flip_physical{177}=0xcc
|
||||
serdes_core_rx_polarity_flip_physical{185}=0x9e
|
||||
serdes_core_tx_polarity_flip_physical{185}=0x58
|
||||
serdes_core_rx_polarity_flip_physical{193}=0x6f
|
||||
serdes_core_tx_polarity_flip_physical{193}=0x24
|
||||
serdes_core_rx_polarity_flip_physical{201}=0x9e
|
||||
serdes_core_tx_polarity_flip_physical{201}=0xdf
|
||||
serdes_core_rx_polarity_flip_physical{209}=0x17
|
||||
serdes_core_tx_polarity_flip_physical{209}=0xe9
|
||||
serdes_core_rx_polarity_flip_physical{217}=0xec
|
||||
serdes_core_tx_polarity_flip_physical{217}=0x68
|
||||
|
||||
dport_map_port_20=1
|
||||
dport_map_port_24=2
|
||||
dport_map_port_28=3
|
||||
dport_map_port_32=4
|
||||
dport_map_port_40=5
|
||||
dport_map_port_44=6
|
||||
dport_map_port_48=7
|
||||
dport_map_port_52=8
|
||||
dport_map_port_1=9
|
||||
dport_map_port_5=10
|
||||
dport_map_port_9=11
|
||||
dport_map_port_13=12
|
||||
dport_map_port_60=13
|
||||
dport_map_port_64=14
|
||||
dport_map_port_68=15
|
||||
dport_map_port_72=16
|
||||
dport_map_port_80=17
|
||||
dport_map_port_84=18
|
||||
dport_map_port_88=19
|
||||
dport_map_port_92=20
|
||||
dport_map_port_140=21
|
||||
dport_map_port_144=22
|
||||
dport_map_port_148=23
|
||||
dport_map_port_152=24
|
||||
dport_map_port_100=25
|
||||
dport_map_port_104=26
|
||||
dport_map_port_108=27
|
||||
dport_map_port_112=28
|
||||
dport_map_port_120=29
|
||||
dport_map_port_124=30
|
||||
dport_map_port_128=31
|
||||
dport_map_port_132=32
|
||||
|
||||
#dport_map_port_38=33
|
||||
#dport_map_port_118=34
|
||||
|
||||
|
||||
|
||||
core_clock_frequency=1325
|
||||
dpr_clock_frequency=1000
|
||||
device_clock_frequency=1325
|
||||
port_flex_enable=1
|
||||
|
||||
#firmware load method, use fast load
|
||||
load_firmware=0x2
|
||||
|
||||
|
BIN
device/celestica/x86_64-cel_silverstone-r0/custom.bin
Normal file
BIN
device/celestica/x86_64-cel_silverstone-r0/custom.bin
Normal file
Binary file not shown.
1
device/celestica/x86_64-cel_silverstone-r0/default_sku
Normal file
1
device/celestica/x86_64-cel_silverstone-r0/default_sku
Normal file
@ -0,0 +1 @@
|
||||
Silverstone t1
|
@ -0,0 +1 @@
|
||||
CONSOLE_SPEED=115200
|
@ -0,0 +1,2 @@
|
||||
#The Port LED of Silverstone SONIC can't work well, after the issue is fixed by SAI, The led will start.
|
||||
#led auto on; led start
|
BIN
device/celestica/x86_64-cel_silverstone-r0/linkscan_fw.bin
Normal file
BIN
device/celestica/x86_64-cel_silverstone-r0/linkscan_fw.bin
Normal file
Binary file not shown.
23
device/celestica/x86_64-cel_silverstone-r0/plugins/eeprom.py
Normal file
23
device/celestica/x86_64-cel_silverstone-r0/plugins/eeprom.py
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
#############################################################################
|
||||
# Celestica Silverstone
|
||||
#
|
||||
# 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
|
||||
#############################################################################
|
||||
|
||||
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 = "/sys/class/i2c-adapter/i2c-0/0-0056/eeprom"
|
||||
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
||||
|
@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os.path
|
||||
import subprocess
|
||||
import sys
|
||||
import re
|
||||
|
||||
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):
|
||||
self.ipmi_raw = "docker exec -ti pmon ipmitool raw 0x4 0x2d"
|
||||
self.psu1_id = "0x2f"
|
||||
self.psu2_id = "0x39"
|
||||
PsuBase.__init__(self)
|
||||
|
||||
def run_command(self, command):
|
||||
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
|
||||
(out, err) = proc.communicate()
|
||||
|
||||
if proc.returncode != 0:
|
||||
sys.exit(proc.returncode)
|
||||
|
||||
return out
|
||||
|
||||
def find_value(self, in_string):
|
||||
result = re.search("^.+ ([0-9a-f]{2}) .+$", in_string)
|
||||
if result:
|
||||
return result.group(1)
|
||||
else:
|
||||
return result
|
||||
|
||||
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 2
|
||||
|
||||
def get_psu_status(self, index):
|
||||
"""
|
||||
Retrieves the oprational status of power supply unit (PSU) defined
|
||||
by 1-based index <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
|
||||
"""
|
||||
if index is None:
|
||||
return False
|
||||
|
||||
psu_id = self.psu1_id if index == 1 else self.psu2_id
|
||||
res_string = self.run_command(self.ipmi_raw + ' ' + psu_id)
|
||||
status_byte = self.find_value(res_string)
|
||||
|
||||
if status_byte is None:
|
||||
return False
|
||||
|
||||
failure_detected = (int(status_byte, 16) >> 1) & 1
|
||||
input_lost = (int(status_byte, 16) >> 3) & 1
|
||||
if failure_detected or input_lost:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def get_psu_presence(self, index):
|
||||
"""
|
||||
Retrieves the presence status of power supply unit (PSU) defined
|
||||
by 1-based index <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
|
||||
"""
|
||||
if index is None:
|
||||
return False
|
||||
|
||||
psu_id = self.psu1_id if index == 1 else self.psu2_id
|
||||
res_string = self.run_command(self.ipmi_raw + ' ' + psu_id)
|
||||
status_byte = self.find_value(res_string)
|
||||
|
||||
if status_byte is None:
|
||||
return False
|
||||
|
||||
presence = ( int(status_byte, 16) >> 0 ) & 1
|
||||
if presence:
|
||||
return True
|
||||
else:
|
||||
return False
|
186
device/celestica/x86_64-cel_silverstone-r0/plugins/sfputil.py
Executable file
186
device/celestica/x86_64-cel_silverstone-r0/plugins/sfputil.py
Executable file
@ -0,0 +1,186 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
# This plugin supports QSFP-DD, QSFP and SFP.
|
||||
|
||||
try:
|
||||
import time
|
||||
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 = 34
|
||||
OSFP_PORT_START = 1
|
||||
OSFP_PORT_END = 32
|
||||
SFP_PORT_START = 33
|
||||
SFP_PORT_END = 34
|
||||
|
||||
EEPROM_OFFSET = 9
|
||||
PORT_INFO_PATH = '/sys/class/silverstone_fpga'
|
||||
|
||||
_port_name = ""
|
||||
_port_to_eeprom_mapping = {}
|
||||
_port_to_i2cbus_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 osfp_ports(self):
|
||||
return range(self.OSFP_PORT_START, self.OSFP_PORT_END + 1)
|
||||
|
||||
@property
|
||||
def port_to_eeprom_mapping(self):
|
||||
return self._port_to_eeprom_mapping
|
||||
|
||||
@property
|
||||
def port_to_i2cbus_mapping(self):
|
||||
return self._port_to_i2cbus_mapping
|
||||
|
||||
def get_port_name(self, port_num):
|
||||
if port_num in self.osfp_ports:
|
||||
self._port_name = "QSFP" + str(port_num - self.OSFP_PORT_START + 1)
|
||||
else:
|
||||
self._port_name = "SFP" + str(port_num - self.SFP_PORT_START + 1)
|
||||
return self._port_name
|
||||
|
||||
def get_eeprom_dom_raw(self, port_num):
|
||||
if port_num in self.osfp_ports:
|
||||
# QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw
|
||||
return None
|
||||
else:
|
||||
# Read dom eeprom at addr 0x51
|
||||
return self._read_eeprom_devid(port_num, self.DOM_EEPROM_ADDR, 256)
|
||||
|
||||
def __init__(self):
|
||||
# Override port_to_eeprom_mapping for class initialization
|
||||
eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom'
|
||||
|
||||
for x in range(self.PORT_START, self.PORT_END+1):
|
||||
self.port_to_i2cbus_mapping[x] = (x + self.EEPROM_OFFSET)
|
||||
self.port_to_eeprom_mapping[x] = eeprom_path.format(
|
||||
x + self.EEPROM_OFFSET)
|
||||
SfpUtilBase.__init__(self)
|
||||
|
||||
def get_presence(self, port_num):
|
||||
# Check for invalid port_num
|
||||
if port_num not in range(self.port_start, self.port_end + 1):
|
||||
return False
|
||||
|
||||
# Get path for access port presence status
|
||||
port_name = self.get_port_name(port_num)
|
||||
sysfs_filename = "qsfp_modprs" if port_num in self.osfp_ports else "sfp_modabs"
|
||||
reg_path = "/".join([self.PORT_INFO_PATH, port_name, sysfs_filename])
|
||||
|
||||
# Read status
|
||||
try:
|
||||
reg_file = open(reg_path)
|
||||
content = reg_file.readline().rstrip()
|
||||
reg_value = int(content)
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
# Module present is active low
|
||||
if reg_value == 0:
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def get_low_power_mode(self, port_num):
|
||||
# Check for invalid QSFP port_num
|
||||
if port_num not in self.osfp_ports:
|
||||
return False
|
||||
|
||||
try:
|
||||
port_name = self.get_port_name(port_num)
|
||||
reg_file = open("/".join([self.PORT_INFO_PATH,
|
||||
port_name, "qsfp_lpmode"]))
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
# Read status
|
||||
content = reg_file.readline().rstrip()
|
||||
reg_value = int(content)
|
||||
# low power mode is active high
|
||||
if reg_value == 0:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def set_low_power_mode(self, port_num, lpmode):
|
||||
# Check for invalid QSFP port_num
|
||||
if port_num not in self.osfp_ports:
|
||||
return False
|
||||
|
||||
try:
|
||||
port_name = self.get_port_name(port_num)
|
||||
reg_file = open("/".join([self.PORT_INFO_PATH,
|
||||
port_name, "qsfp_lpmode"]), "r+")
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
content = hex(lpmode)
|
||||
|
||||
reg_file.seek(0)
|
||||
reg_file.write(content)
|
||||
reg_file.close()
|
||||
|
||||
return True
|
||||
|
||||
def reset(self, port_num):
|
||||
# Check for invalid QSFP port_num
|
||||
if port_num not in self.osfp_ports:
|
||||
return False
|
||||
|
||||
try:
|
||||
port_name = self.get_port_name(port_num)
|
||||
reg_file = open("/".join([self.PORT_INFO_PATH,
|
||||
port_name, "qsfp_reset"]), "w")
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
# Convert our register value back to a hex string and write back
|
||||
reg_file.seek(0)
|
||||
reg_file.write(hex(0))
|
||||
reg_file.close()
|
||||
|
||||
# Sleep 1 second to allow it to settle
|
||||
time.sleep(1)
|
||||
|
||||
# Flip the bit back high and write back to the register to take port out of reset
|
||||
try:
|
||||
reg_file = open(
|
||||
"/".join([self.PORT_INFO_PATH, port_name, "qsfp_reset"]), "w")
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
reg_file.seek(0)
|
||||
reg_file.write(hex(1))
|
||||
reg_file.close()
|
||||
|
||||
return True
|
||||
|
||||
def get_transceiver_change_event(self, timeout=0):
|
||||
"""
|
||||
TBD
|
||||
"""
|
||||
raise NotImplementedError
|
@ -53,7 +53,8 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
|
||||
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE) \
|
||||
$(BRCM_XLR_GTS_PLATFORM_MODULE) \
|
||||
$(DELTA_AG9032V2A_PLATFORM_MODULE) \
|
||||
$(JUNIPER_QFX5210_PLATFORM_MODULE)
|
||||
$(JUNIPER_QFX5210_PLATFORM_MODULE) \
|
||||
$(CEL_SILVERSTONE_PLATFORM_MODULE)
|
||||
ifeq ($(INSTALL_DEBUG_TOOLS),y)
|
||||
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
|
||||
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
CEL_DX010_PLATFORM_MODULE_VERSION = 0.9
|
||||
CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.9
|
||||
CEL_SILVERSTONE_PLATFORM_MODULE_VERSION = 0.9
|
||||
|
||||
export CEL_DX010_PLATFORM_MODULE_VERSION
|
||||
export CEL_HALIBURTON_PLATFORM_MODULE_VERSION
|
||||
export CEL_SILVERSTONE_PLATFORM_MODULE_VERSION
|
||||
|
||||
CEL_DX010_PLATFORM_MODULE = platform-modules-dx010_$(CEL_DX010_PLATFORM_MODULE_VERSION)_amd64.deb
|
||||
$(CEL_DX010_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-cel
|
||||
@ -16,4 +18,8 @@ CEL_HALIBURTON_PLATFORM_MODULE = platform-modules-haliburton_$(CEL_HALIBURTON_PL
|
||||
$(CEL_HALIBURTON_PLATFORM_MODULE)_PLATFORM = x86_64-cel_e1031-r0
|
||||
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_HALIBURTON_PLATFORM_MODULE)))
|
||||
|
||||
CEL_SILVERSTONE_PLATFORM_MODULE = platform-modules-silverstone_$(CEL_SILVERSTONE_PLATFORM_MODULE_VERSION)_amd64.deb
|
||||
$(CEL_SILVERSTONE_PLATFORM_MODULE)_PLATFORM = x86_64-cel_silverstone-r0
|
||||
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_SILVERSTONE_PLATFORM_MODULE)))
|
||||
|
||||
SONIC_STRETCH_DEBS += $(CEL_DX010_PLATFORM_MODULE)
|
||||
|
@ -15,3 +15,8 @@ Package: platform-modules-haliburton
|
||||
Architecture: amd64
|
||||
Depends: linux-image-4.9.0-9-2-amd64
|
||||
Description: kernel modules for platform devices such as fan, led, sfp
|
||||
|
||||
Package: platform-modules-silverstone
|
||||
Architecture: amd64
|
||||
Depends: linux-image-4.9.0-9-2-amd64
|
||||
Description: kernel modules for platform devices such as led, sfp.
|
||||
|
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start: $portmap
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup SilverStone board.
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
modprobe i2c-dev
|
||||
modprobe baseboard-lpc
|
||||
modprobe switchboard
|
||||
modprobe mc24lc64t
|
||||
modprobe ipmi_devintf
|
||||
|
||||
# Instantiate TLV EEPROM device on I801 bus
|
||||
devname=`cat /sys/bus/i2c/devices/i2c-0/name`
|
||||
if [[ $devname == 'SMBus I801 adapter at '* ]]; then
|
||||
echo 24lc64t 0x56 > /sys/bus/i2c/devices/i2c-0/new_device
|
||||
fi
|
||||
decode-syseeprom --init 2> /dev/null &
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/platform-modules-silverstone.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -0,0 +1,2 @@
|
||||
silverstone/cfg/silverstone-modules.conf etc/modules-load.d
|
||||
silverstone/systemd/platform-modules-silverstone.service lib/systemd/system
|
@ -0,0 +1,3 @@
|
||||
depmod -a
|
||||
systemctl enable platform-modules-silverstone.service
|
||||
systemctl start platform-modules-silverstone.service
|
@ -5,7 +5,7 @@ export INSTALL_MOD_DIR:=extra
|
||||
KVERSION ?= $(shell uname -r)
|
||||
KERNEL_SRC := /lib/modules/$(KVERSION)
|
||||
MOD_SRC_DIR:= $(shell pwd)
|
||||
MODULE_DIRS:= dx010 haliburton
|
||||
MODULE_DIRS:= dx010 haliburton silverstone
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
@ -0,0 +1,15 @@
|
||||
# /etc/modules: kernel modules to load at boot time.
|
||||
#
|
||||
# This file contains the names of kernel modules that should be loaded
|
||||
# at boot time, one per line. Lines beginning with "#" are ignored.
|
||||
|
||||
i2c-i801
|
||||
i2c-isch
|
||||
i2c-ismt
|
||||
i2c-dev
|
||||
i2c-mux
|
||||
i2c-smbus
|
||||
|
||||
i2c-mux-pca954x
|
||||
ipmi_devintf
|
||||
ipmi_si
|
@ -0,0 +1 @@
|
||||
obj-m := baseboard-lpc.o mc24lc64t.o switchboard.o
|
@ -0,0 +1,433 @@
|
||||
/*
|
||||
* baseboard-lpc.c - The CPLD driver for the Base Board of Silverstone
|
||||
* The driver implement sysfs to access CPLD register on the baseboard of Silverstone via LPC bus.
|
||||
* Copyright (C) 2018 Celestica Corp.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/types.h>
|
||||
#include <uapi/linux/stat.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#define DRIVER_NAME "baseboard-lpc"
|
||||
/**
|
||||
* CPLD register address for read and write.
|
||||
*/
|
||||
#define VERSION_ADDR 0xA100
|
||||
#define SCRATCH_ADDR 0xA101
|
||||
#define BLT_MONTH_ADDR 0xA102
|
||||
#define BLT_DATE_ADDR 0xA103
|
||||
#define REBOOT_CAUSE 0xA106
|
||||
#define SYS_LED_ADDR 0xA162
|
||||
#define CPLD_REGISTER_SIZE 0x93
|
||||
|
||||
/* System reboot cause recorded in CPLD */
|
||||
static const struct {
|
||||
const char *reason;
|
||||
u8 reset_code;
|
||||
} reboot_causes[] = {
|
||||
{"POR", 0x11},
|
||||
{"soft-warm-rst", 0x22},
|
||||
{"soft-cold-rst", 0x33},
|
||||
{"warm-rst", 0x44},
|
||||
{"cold-rst", 0x55},
|
||||
{"wdt-rst", 0x66},
|
||||
{"power-cycle", 0x77}
|
||||
};
|
||||
|
||||
struct cpld_b_data {
|
||||
struct mutex cpld_lock;
|
||||
uint16_t read_addr;
|
||||
};
|
||||
|
||||
struct cpld_b_data *cpld_data;
|
||||
|
||||
static ssize_t scratch_show(struct device *dev, struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
unsigned char data = 0;
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
data = inb(SCRATCH_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return sprintf(buf,"0x%2.2x\n", data);
|
||||
}
|
||||
|
||||
static ssize_t scratch_store(struct device *dev, struct device_attribute *devattr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
unsigned long data;
|
||||
char *last;
|
||||
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
data = (uint16_t)strtoul(buf,&last,16);
|
||||
if(data == 0 && buf == last){
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
outb(data, SCRATCH_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR_RW(scratch);
|
||||
|
||||
|
||||
/* CPLD version attributes */
|
||||
static ssize_t version_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
u8 version;
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
version = inb(VERSION_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return sprintf(buf, "%d.%d\n", version >> 4, version & 0x0F);
|
||||
}
|
||||
static DEVICE_ATTR_RO(version);
|
||||
|
||||
/* CPLD version attributes */
|
||||
static ssize_t build_date_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
u8 month, day_of_month;
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
day_of_month = inb(BLT_DATE_ADDR);
|
||||
month = inb(BLT_MONTH_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return sprintf(buf, "%x/%x\n", day_of_month, month);
|
||||
}
|
||||
static DEVICE_ATTR_RO(build_date);
|
||||
|
||||
|
||||
static ssize_t getreg_store(struct device *dev, struct device_attribute *devattr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
uint16_t addr;
|
||||
char *last;
|
||||
|
||||
addr = (uint16_t)strtoul(buf,&last,16);
|
||||
if(addr == 0 && buf == last){
|
||||
return -EINVAL;
|
||||
}
|
||||
cpld_data->read_addr = addr;
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t getreg_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
len = sprintf(buf, "0x%2.2x\n",inb(cpld_data->read_addr));
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return len;
|
||||
}
|
||||
static DEVICE_ATTR_RW(getreg);
|
||||
|
||||
static ssize_t setreg_store(struct device *dev, struct device_attribute *devattr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
uint16_t addr;
|
||||
uint8_t value;
|
||||
char *tok;
|
||||
char clone[count];
|
||||
char *pclone = clone;
|
||||
char *last;
|
||||
|
||||
strcpy(clone, buf);
|
||||
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
tok = strsep((char**)&pclone, " ");
|
||||
if(tok == NULL){
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
addr = (uint16_t)strtoul(tok,&last,16);
|
||||
if(addr == 0 && tok == last){
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
tok = strsep((char**)&pclone, " ");
|
||||
if(tok == NULL){
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
value = (uint8_t)strtoul(tok,&last,16);
|
||||
if(value == 0 && tok == last){
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
outb(value,addr);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR_WO(setreg);
|
||||
|
||||
/**
|
||||
* Read all CPLD register in binary mode.
|
||||
*/
|
||||
static ssize_t dump_read(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *attr, char *buf,
|
||||
loff_t off, size_t count)
|
||||
{
|
||||
unsigned long i=0;
|
||||
ssize_t status;
|
||||
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
begin:
|
||||
if(i < count){
|
||||
buf[i++] = inb(VERSION_ADDR + off);
|
||||
off++;
|
||||
msleep(1);
|
||||
goto begin;
|
||||
}
|
||||
status = count;
|
||||
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return status;
|
||||
}
|
||||
static BIN_ATTR_RO(dump, CPLD_REGISTER_SIZE);
|
||||
|
||||
/**
|
||||
* Show system led status - on/off/1hz/4hz
|
||||
* @return Hex string read from scratch register.
|
||||
*/
|
||||
static ssize_t sys_led_show(struct device *dev, struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
unsigned char data = 0;
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
data = inb(SYS_LED_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
data = data & 0x3;
|
||||
return sprintf(buf, "%s\n",
|
||||
data == 0x03 ? "off" : data == 0x02 ? "4hz" : data ==0x01 ? "1hz": "on");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the status of system led - on/off/1hz/4hz
|
||||
*/
|
||||
static ssize_t sys_led_store(struct device *dev, struct device_attribute *devattr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
unsigned char led_status,data;
|
||||
if(sysfs_streq(buf, "off")){
|
||||
led_status = 0x03;
|
||||
}else if(sysfs_streq(buf, "4hz")){
|
||||
led_status = 0x02;
|
||||
}else if(sysfs_streq(buf, "1hz")){
|
||||
led_status = 0x01;
|
||||
}else if(sysfs_streq(buf, "on")){
|
||||
led_status = 0x00;
|
||||
}else{
|
||||
count = -EINVAL;
|
||||
return count;
|
||||
}
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
data = inb(SYS_LED_ADDR);
|
||||
data = data & ~(0x3);
|
||||
data = data | led_status;
|
||||
outb(data, SYS_LED_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR_RW(sys_led);
|
||||
|
||||
/**
|
||||
* Show system led color - both/green/yellow/none
|
||||
* @return Current led color.
|
||||
*/
|
||||
static ssize_t sys_led_color_show(struct device *dev, struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
unsigned char data = 0;
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
data = inb(SYS_LED_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
data = (data >> 4) & 0x3;
|
||||
return sprintf(buf, "%s\n",
|
||||
data == 0x03 ? "off" : data == 0x02 ? "yellow" : data ==0x01 ? "green": "both");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the color of system led - both/green/yellow/none
|
||||
*/
|
||||
static ssize_t sys_led_color_store(struct device *dev, struct device_attribute *devattr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
unsigned char led_status,data;
|
||||
if(sysfs_streq(buf, "off")){
|
||||
led_status = 0x03;
|
||||
}else if(sysfs_streq(buf, "yellow")){
|
||||
led_status = 0x02;
|
||||
}else if(sysfs_streq(buf, "green")){
|
||||
led_status = 0x01;
|
||||
}else if(sysfs_streq(buf, "both")){
|
||||
led_status = 0x00;
|
||||
}else{
|
||||
count = -EINVAL;
|
||||
return count;
|
||||
}
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
data = inb(SYS_LED_ADDR);
|
||||
data = data & ~( 0x3 << 4);
|
||||
data = data | (led_status << 4);
|
||||
outb(data, SYS_LED_ADDR);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR_RW(sys_led_color);
|
||||
|
||||
static ssize_t reboot_cause_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
ssize_t status;
|
||||
u8 reg;
|
||||
int i;
|
||||
|
||||
mutex_lock(&cpld_data->cpld_lock);
|
||||
reg = inb(REBOOT_CAUSE);
|
||||
mutex_unlock(&cpld_data->cpld_lock);
|
||||
|
||||
status = 0;
|
||||
dev_dbg(dev,"reboot: 0x%x\n", (u8)reg);
|
||||
for(i = 0; i < ARRAY_SIZE(reboot_causes); i++){
|
||||
if((u8)reg == reboot_causes[i].reset_code){
|
||||
status = sprintf(buf, "%s\n",
|
||||
reboot_causes[i].reason);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
DEVICE_ATTR_RO(reboot_cause);
|
||||
|
||||
static struct attribute *cpld_b_attrs[] = {
|
||||
&dev_attr_version.attr,
|
||||
&dev_attr_build_date.attr,
|
||||
&dev_attr_scratch.attr,
|
||||
&dev_attr_getreg.attr,
|
||||
&dev_attr_setreg.attr,
|
||||
&dev_attr_sys_led.attr,
|
||||
&dev_attr_sys_led_color.attr,
|
||||
&dev_attr_reboot_cause.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct bin_attribute *cpld_b_bin_attrs[] = {
|
||||
&bin_attr_dump,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct attribute_group cpld_b_attrs_grp = {
|
||||
.attrs = cpld_b_attrs,
|
||||
.bin_attrs = cpld_b_bin_attrs,
|
||||
};
|
||||
|
||||
static struct resource cpld_b_resources[] = {
|
||||
{
|
||||
.start = 0xA100,
|
||||
.end = 0xA192,
|
||||
.flags = IORESOURCE_IO,
|
||||
},
|
||||
};
|
||||
|
||||
static void cpld_b_dev_release( struct device * dev)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static struct platform_device cpld_b_dev = {
|
||||
.name = DRIVER_NAME,
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(cpld_b_resources),
|
||||
.resource = cpld_b_resources,
|
||||
.dev = {
|
||||
.release = cpld_b_dev_release,
|
||||
}
|
||||
};
|
||||
|
||||
static int cpld_b_drv_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
int err = 0;
|
||||
|
||||
cpld_data = devm_kzalloc(&pdev->dev, sizeof(struct cpld_b_data),
|
||||
GFP_KERNEL);
|
||||
if (!cpld_data)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_init(&cpld_data->cpld_lock);
|
||||
|
||||
cpld_data->read_addr = VERSION_ADDR;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
if (unlikely(!res)) {
|
||||
printk(KERN_ERR "Specified Resource Not Available...\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
err = sysfs_create_group(&pdev->dev.kobj, &cpld_b_attrs_grp);
|
||||
if (err) {
|
||||
printk(KERN_ERR "Cannot create sysfs for baseboard CPLD\n");
|
||||
return err;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpld_b_drv_remove(struct platform_device *pdev)
|
||||
{
|
||||
sysfs_remove_group(&pdev->dev.kobj, &cpld_b_attrs_grp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver cpld_b_drv = {
|
||||
.probe = cpld_b_drv_probe,
|
||||
.remove = __exit_p(cpld_b_drv_remove),
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
},
|
||||
};
|
||||
|
||||
int cpld_b_init(void)
|
||||
{
|
||||
// Register platform device and platform driver
|
||||
platform_device_register(&cpld_b_dev);
|
||||
platform_driver_register(&cpld_b_drv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cpld_b_exit(void)
|
||||
{
|
||||
// Unregister platform device and platform driver
|
||||
platform_driver_unregister(&cpld_b_drv);
|
||||
platform_device_unregister(&cpld_b_dev);
|
||||
}
|
||||
|
||||
module_init(cpld_b_init);
|
||||
module_exit(cpld_b_exit);
|
||||
|
||||
|
||||
MODULE_AUTHOR("Celestica Inc.");
|
||||
MODULE_DESCRIPTION("Celestica Silverstone CPLD baseboard driver");
|
||||
MODULE_VERSION("0.2.0");
|
||||
MODULE_LICENSE("GPL");
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
* mc24lc64t.c - driver for Microchip 24LC64T
|
||||
*
|
||||
* Copyright (C) 2017 Celestica Corp.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
||||
#define EEPROM_SIZE 8192 //mc24lt64t eeprom size in bytes.
|
||||
|
||||
struct mc24lc64t_data {
|
||||
struct mutex update_lock;
|
||||
};
|
||||
|
||||
static ssize_t mc24lc64t_read(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count)
|
||||
{
|
||||
struct i2c_client *client = kobj_to_i2c_client(kobj);
|
||||
struct mc24lc64t_data *drvdata = i2c_get_clientdata(client);
|
||||
unsigned long timeout, read_time, i = 0;
|
||||
int status;
|
||||
|
||||
mutex_lock(&drvdata->update_lock);
|
||||
|
||||
if (i2c_smbus_write_byte_data(client, off>>8, off))
|
||||
{
|
||||
status = -EIO;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
msleep(1);
|
||||
|
||||
begin:
|
||||
|
||||
if (i < count)
|
||||
{
|
||||
timeout = jiffies + msecs_to_jiffies(25); /* 25 mS timeout*/
|
||||
do {
|
||||
read_time = jiffies;
|
||||
|
||||
status = i2c_smbus_read_byte(client);
|
||||
if (status >= 0)
|
||||
{
|
||||
buf[i++] = status;
|
||||
goto begin;
|
||||
}
|
||||
} while (time_before(read_time, timeout));
|
||||
|
||||
status = -ETIMEDOUT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
status = count;
|
||||
|
||||
exit:
|
||||
mutex_unlock(&drvdata->update_lock);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
static ssize_t mc24lc64t_write (struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count){
|
||||
|
||||
struct i2c_client *client = kobj_to_i2c_client(kobj);
|
||||
struct mc24lc64t_data *drvdata = i2c_get_clientdata(client);
|
||||
unsigned long timeout, write_time, i = 0;
|
||||
int status;
|
||||
u16 value;
|
||||
|
||||
mutex_lock(&drvdata->update_lock);
|
||||
|
||||
begin:
|
||||
if (i < count){
|
||||
timeout = jiffies + msecs_to_jiffies(25); /* 25 mS timeout*/
|
||||
value = (buf[i] << 8 | ( off &0xff));
|
||||
do {
|
||||
write_time = jiffies;
|
||||
status = i2c_smbus_write_word_data(client, off>>8, value);
|
||||
if (status >= 0)
|
||||
{
|
||||
// increase offset
|
||||
off++;
|
||||
// increase buffer index
|
||||
i++;
|
||||
goto begin;
|
||||
}
|
||||
} while (time_before(write_time, timeout));
|
||||
status = -ETIMEDOUT;
|
||||
goto exit;
|
||||
}
|
||||
status = count;
|
||||
|
||||
exit:
|
||||
mutex_unlock(&drvdata->update_lock);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
static struct bin_attribute mc24lc64t_bit_attr = {
|
||||
.attr = {
|
||||
.name = "eeprom",
|
||||
.mode = S_IRUGO | S_IWUGO,
|
||||
},
|
||||
.size = EEPROM_SIZE,
|
||||
.read = mc24lc64t_read,
|
||||
.write = mc24lc64t_write,
|
||||
};
|
||||
|
||||
static int mc24lc64t_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct i2c_adapter *adapter = client->adapter;
|
||||
struct mc24lc64t_data *drvdata;
|
||||
int err;
|
||||
|
||||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA
|
||||
| I2C_FUNC_SMBUS_READ_BYTE))
|
||||
return -EPFNOSUPPORT;
|
||||
|
||||
if (!(drvdata = devm_kzalloc(&client->dev,
|
||||
sizeof(struct mc24lc64t_data), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
|
||||
i2c_set_clientdata(client, drvdata);
|
||||
mutex_init(&drvdata->update_lock);
|
||||
|
||||
err = sysfs_create_bin_file(&client->dev.kobj, &mc24lc64t_bit_attr);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mc24lc64t_remove(struct i2c_client *client)
|
||||
{
|
||||
struct mc24lc64t_data *drvdata = i2c_get_clientdata(client);
|
||||
sysfs_remove_bin_file(&client->dev.kobj, &mc24lc64t_bit_attr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id mc24lc64t_id[] = {
|
||||
{ "24lc64t", 0 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, mc24lc64t_id);
|
||||
|
||||
static struct i2c_driver mc24lc64t_driver = {
|
||||
.driver = {
|
||||
.name = "mc24lc64t",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
.probe = mc24lc64t_probe,
|
||||
.remove = mc24lc64t_remove,
|
||||
.id_table = mc24lc64t_id,
|
||||
};
|
||||
|
||||
module_i2c_driver(mc24lc64t_driver);
|
||||
|
||||
MODULE_AUTHOR("Abhisit Sangjan <asang@celestica.com>");
|
||||
MODULE_DESCRIPTION("Microchip 24LC64T Driver");
|
||||
MODULE_LICENSE("GPL");
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Celestica Silverstone platform modules
|
||||
After=local-fs.target
|
||||
Before=pmon.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=-/etc/init.d/platform-modules-silverstone start
|
||||
ExecStop=-/etc/init.d/platform-modules-silverstone stop
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user