[platform] update Ingrassy platform to support stretch (#2322)
* remove nephos sonic-platform-modules-ingrasys module * [Ingrasys]Add platform drivers and device to support Debian Stretch * fix gpio init issue
This commit is contained in:
parent
de0238d673
commit
ac2be9d99a
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -53,9 +53,6 @@
|
||||
[submodule "platform/p4/SAI-P4-BM"]
|
||||
path = platform/p4/SAI-P4-BM
|
||||
url = https://github.com/Mellanox/SAI-P4-BM.git
|
||||
[submodule "platform/nephos/sonic-platform-modules-ingrasys"]
|
||||
path = platform/nephos/sonic-platform-modules-ingrasys
|
||||
url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys-nephos.git
|
||||
[submodule "platform/barefoot/sonic-platform-modules-arista"]
|
||||
path = platform/barefoot/sonic-platform-modules-arista
|
||||
url = https://github.com/aristanetworks/sonic
|
||||
|
@ -3,6 +3,8 @@
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
import time
|
||||
from sonic_sfp.sfputilbase import SfpUtilBase
|
||||
@ -23,6 +25,7 @@ class SfpUtil(SfpUtilBase):
|
||||
#INT_GPIO_BASE = 192
|
||||
LP_GPIO_BASE = 160
|
||||
RST_GPIO_BASE = 128
|
||||
GPIO_OFFSET = 0
|
||||
|
||||
BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction"
|
||||
BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value"
|
||||
@ -45,7 +48,32 @@ class SfpUtil(SfpUtilBase):
|
||||
def port_to_eeprom_mapping(self):
|
||||
return self._port_to_eeprom_mapping
|
||||
|
||||
def set_gpio_offset(self):
|
||||
sys_gpio_dir = "/sys/class/gpio"
|
||||
self.GPIO_OFFSET = 0
|
||||
gpiochip_no = 0
|
||||
for d in os.listdir(sys_gpio_dir):
|
||||
if "gpiochip" in d:
|
||||
try:
|
||||
gpiochip_no = int(d[8:],10)
|
||||
except ValueError as e:
|
||||
print "Error: %s" % str(e)
|
||||
if gpiochip_no > 255:
|
||||
self.GPIO_OFFSET=256
|
||||
return True
|
||||
return True
|
||||
|
||||
def update_gpio_base(self):
|
||||
self.ABS_GPIO_BASE = 224 + self.GPIO_OFFSET
|
||||
self.LP_GPIO_BASE = 160 + self.GPIO_OFFSET
|
||||
self.RST_GPIO_BASE = 128 + self.GPIO_OFFSET
|
||||
return True
|
||||
|
||||
def __init__(self):
|
||||
# Update abs, lpmode, and reset gpio base
|
||||
self.set_gpio_offset()
|
||||
self.update_gpio_base()
|
||||
|
||||
# Override port_to_eeprom_mapping for class initialization
|
||||
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
#2017/05/31
|
||||
#2018/03/31
|
||||
|
||||
os=unix
|
||||
|
||||
oversubscribe_mode=1
|
||||
pbmp_xport_xe=0x7f00001fff4003ffffc0001fffe
|
||||
|
||||
lpm_scaling_enable=1
|
||||
lpm_ipv6_128b_reserved=0
|
||||
l3_alpm_enable=2
|
||||
ipv6_lpm_128b_enable=1
|
||||
l3_mem_entries=40960
|
||||
l2_mem_entries=40960
|
||||
|
||||
l2xmsg_mode=1
|
||||
mmu_lossless=0
|
||||
|
||||
#Parity
|
||||
parity_correction=1
|
||||
|
@ -3,6 +3,8 @@
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
import time
|
||||
from sonic_sfp.sfputilbase import SfpUtilBase
|
||||
@ -17,6 +19,7 @@ class SfpUtil(SfpUtilBase):
|
||||
PORT_END = 53
|
||||
QSFP_PORT_START = 48
|
||||
PORTS_IN_BLOCK = 54
|
||||
GPIO_OFFSET = 0
|
||||
|
||||
BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction"
|
||||
BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value"
|
||||
@ -79,80 +82,9 @@ class SfpUtil(SfpUtilBase):
|
||||
53: 71
|
||||
}
|
||||
|
||||
abs_to_gpio_mapping = {
|
||||
0: 192,
|
||||
1: 193,
|
||||
2: 194,
|
||||
3: 195,
|
||||
4: 196,
|
||||
5: 197,
|
||||
6: 198,
|
||||
7: 199,
|
||||
8: 200,
|
||||
9: 201,
|
||||
10: 202,
|
||||
11: 203,
|
||||
12: 204,
|
||||
13: 205,
|
||||
14: 206,
|
||||
15: 207,
|
||||
16: 176,
|
||||
17: 177,
|
||||
18: 178,
|
||||
19: 179,
|
||||
20: 180,
|
||||
21: 181,
|
||||
22: 182,
|
||||
23: 183,
|
||||
24: 184,
|
||||
25: 185,
|
||||
26: 186,
|
||||
27: 187,
|
||||
28: 188,
|
||||
29: 189,
|
||||
30: 190,
|
||||
31: 191,
|
||||
32: 160,
|
||||
33: 161,
|
||||
34: 162,
|
||||
35: 163,
|
||||
36: 164,
|
||||
37: 165,
|
||||
38: 166,
|
||||
39: 167,
|
||||
40: 168,
|
||||
41: 169,
|
||||
42: 170,
|
||||
43: 171,
|
||||
44: 172,
|
||||
45: 173,
|
||||
46: 174,
|
||||
47: 175,
|
||||
48: 240,
|
||||
49: 241,
|
||||
50: 242,
|
||||
51: 243,
|
||||
52: 244,
|
||||
53: 245
|
||||
}
|
||||
|
||||
lpmode_to_gpio_mapping = {
|
||||
48: 224,
|
||||
49: 225,
|
||||
50: 226,
|
||||
51: 227,
|
||||
52: 228,
|
||||
53: 229
|
||||
}
|
||||
|
||||
reset_to_gpio_mapping = {
|
||||
48: 208,
|
||||
49: 209,
|
||||
50: 210,
|
||||
51: 211,
|
||||
52: 212,
|
||||
53: 213
|
||||
}
|
||||
abs_to_gpio_mapping = {}
|
||||
lpmode_to_gpio_mapping = {}
|
||||
reset_to_gpio_mapping = {}
|
||||
|
||||
@property
|
||||
def port_start(self):
|
||||
@ -174,7 +106,109 @@ class SfpUtil(SfpUtilBase):
|
||||
def port_to_eeprom_mapping(self):
|
||||
return self._port_to_eeprom_mapping
|
||||
|
||||
def set_gpio_offset(self):
|
||||
sys_gpio_dir = "/sys/class/gpio"
|
||||
self.GPIO_OFFSET = 0
|
||||
gpiochip_no = 0
|
||||
for d in os.listdir(sys_gpio_dir):
|
||||
if "gpiochip" in d:
|
||||
try:
|
||||
gpiochip_no = int(d[8:],10)
|
||||
except ValueError as e:
|
||||
print "Error: %s" % str(e)
|
||||
if gpiochip_no > 255:
|
||||
self.GPIO_OFFSET=256
|
||||
return True
|
||||
return True
|
||||
|
||||
def init_abs_to_gpio_mapping(self):
|
||||
self.abs_to_gpio_mapping = {
|
||||
0: 192+self.GPIO_OFFSET,
|
||||
1: 193+self.GPIO_OFFSET,
|
||||
2: 194+self.GPIO_OFFSET,
|
||||
3: 195+self.GPIO_OFFSET,
|
||||
4: 196+self.GPIO_OFFSET,
|
||||
5: 197+self.GPIO_OFFSET,
|
||||
6: 198+self.GPIO_OFFSET,
|
||||
7: 199+self.GPIO_OFFSET,
|
||||
8: 200+self.GPIO_OFFSET,
|
||||
9: 201+self.GPIO_OFFSET,
|
||||
10: 202+self.GPIO_OFFSET,
|
||||
11: 203+self.GPIO_OFFSET,
|
||||
12: 204+self.GPIO_OFFSET,
|
||||
13: 205+self.GPIO_OFFSET,
|
||||
14: 206+self.GPIO_OFFSET,
|
||||
15: 207+self.GPIO_OFFSET,
|
||||
16: 176+self.GPIO_OFFSET,
|
||||
17: 177+self.GPIO_OFFSET,
|
||||
18: 178+self.GPIO_OFFSET,
|
||||
19: 179+self.GPIO_OFFSET,
|
||||
20: 180+self.GPIO_OFFSET,
|
||||
21: 181+self.GPIO_OFFSET,
|
||||
22: 182+self.GPIO_OFFSET,
|
||||
23: 183+self.GPIO_OFFSET,
|
||||
24: 184+self.GPIO_OFFSET,
|
||||
25: 185+self.GPIO_OFFSET,
|
||||
26: 186+self.GPIO_OFFSET,
|
||||
27: 187+self.GPIO_OFFSET,
|
||||
28: 188+self.GPIO_OFFSET,
|
||||
29: 189+self.GPIO_OFFSET,
|
||||
30: 190+self.GPIO_OFFSET,
|
||||
31: 191+self.GPIO_OFFSET,
|
||||
32: 160+self.GPIO_OFFSET,
|
||||
33: 161+self.GPIO_OFFSET,
|
||||
34: 162+self.GPIO_OFFSET,
|
||||
35: 163+self.GPIO_OFFSET,
|
||||
36: 164+self.GPIO_OFFSET,
|
||||
37: 165+self.GPIO_OFFSET,
|
||||
38: 166+self.GPIO_OFFSET,
|
||||
39: 167+self.GPIO_OFFSET,
|
||||
40: 168+self.GPIO_OFFSET,
|
||||
41: 169+self.GPIO_OFFSET,
|
||||
42: 170+self.GPIO_OFFSET,
|
||||
43: 171+self.GPIO_OFFSET,
|
||||
44: 172+self.GPIO_OFFSET,
|
||||
45: 173+self.GPIO_OFFSET,
|
||||
46: 174+self.GPIO_OFFSET,
|
||||
47: 175+self.GPIO_OFFSET,
|
||||
48: 240+self.GPIO_OFFSET,
|
||||
49: 241+self.GPIO_OFFSET,
|
||||
50: 242+self.GPIO_OFFSET,
|
||||
51: 243+self.GPIO_OFFSET,
|
||||
52: 244+self.GPIO_OFFSET,
|
||||
53: 245+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def init_lpmode_to_gpio_mapping(self):
|
||||
self.lpmode_to_gpio_mapping = {
|
||||
48: 224+self.GPIO_OFFSET,
|
||||
49: 225+self.GPIO_OFFSET,
|
||||
50: 226+self.GPIO_OFFSET,
|
||||
51: 227+self.GPIO_OFFSET,
|
||||
52: 228+self.GPIO_OFFSET,
|
||||
53: 229+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def init_reset_to_gpio_mapping(self):
|
||||
self.reset_to_gpio_mapping = {
|
||||
48: 208+self.GPIO_OFFSET,
|
||||
49: 209+self.GPIO_OFFSET,
|
||||
50: 210+self.GPIO_OFFSET,
|
||||
51: 211+self.GPIO_OFFSET,
|
||||
52: 212+self.GPIO_OFFSET,
|
||||
53: 213+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def __init__(self):
|
||||
# Init abs, lpmode, and reset to gpio mapping
|
||||
self.set_gpio_offset()
|
||||
self.init_abs_to_gpio_mapping()
|
||||
self.init_lpmode_to_gpio_mapping()
|
||||
self.init_reset_to_gpio_mapping()
|
||||
|
||||
# Override port_to_eeprom_mapping for class initialization
|
||||
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
#2017/05/31
|
||||
#2018/03/31
|
||||
|
||||
os=unix
|
||||
|
||||
oversubscribe_mode=1
|
||||
pbmp_xport_xe=0x3d000000ff4003ffffdfffffffe
|
||||
pbmp_xport_xe=0x3c000000ff0003ffffdfffffffe
|
||||
|
||||
lpm_scaling_enable=1
|
||||
lpm_ipv6_128b_reserved=0
|
||||
l3_alpm_enable=2
|
||||
ipv6_lpm_128b_enable=1
|
||||
l3_mem_entries=40960
|
||||
l2_mem_entries=40960
|
||||
|
||||
l2xmsg_mode=1
|
||||
mmu_lossless=0
|
||||
|
||||
#Parity
|
||||
parity_correction=1
|
||||
@ -85,362 +90,359 @@ portmap_104=105:100
|
||||
portmap_105=109:100
|
||||
|
||||
|
||||
portmap_66=129:10
|
||||
portmap_100=131:10
|
||||
|
||||
portmap_33=132:10
|
||||
portmap_67=133:10
|
||||
portmap_101=134:10
|
||||
portmap_135=135:10
|
||||
|
||||
serdes_driver_current_xe0=0x9
|
||||
serdes_preemphasis_xe0=0x304000
|
||||
serdes_driver_current_xe0=0xf
|
||||
serdes_preemphasis_xe0=0x003c14
|
||||
serdes_if_type_xe0=14
|
||||
|
||||
serdes_driver_current_xe1=0x9
|
||||
serdes_preemphasis_xe1=0x304000
|
||||
serdes_driver_current_xe1=0xf
|
||||
serdes_preemphasis_xe1=0x003c1c
|
||||
serdes_if_type_xe1=14
|
||||
|
||||
serdes_driver_current_xe2=0x9
|
||||
serdes_preemphasis_xe2=0x304000
|
||||
serdes_driver_current_xe2=0xf
|
||||
serdes_preemphasis_xe2=0x003c08
|
||||
serdes_if_type_xe2=14
|
||||
|
||||
serdes_driver_current_xe3=0x9
|
||||
serdes_preemphasis_xe3=0x2c4400
|
||||
serdes_driver_current_xe3=0xf
|
||||
serdes_preemphasis_xe3=0x003c08
|
||||
serdes_if_type_xe3=14
|
||||
|
||||
serdes_driver_current_xe4=0x9
|
||||
serdes_preemphasis_xe4=0x304000
|
||||
serdes_driver_current_xe4=0xf
|
||||
serdes_preemphasis_xe4=0x003c08
|
||||
serdes_if_type_xe4=14
|
||||
|
||||
serdes_driver_current_xe5=0x9
|
||||
serdes_preemphasis_xe5=0x304000
|
||||
serdes_driver_current_xe5=0xf
|
||||
serdes_preemphasis_xe5=0x003c10
|
||||
serdes_if_type_xe5=14
|
||||
|
||||
serdes_driver_current_xe6=0x9
|
||||
serdes_preemphasis_xe6=0x2c4400
|
||||
serdes_driver_current_xe6=0xf
|
||||
serdes_preemphasis_xe6=0x083c08
|
||||
serdes_if_type_xe6=14
|
||||
|
||||
serdes_driver_current_xe7=0x9
|
||||
serdes_preemphasis_xe7=0x2C4400
|
||||
serdes_driver_current_xe7=0xf
|
||||
serdes_preemphasis_xe7=0x043c10
|
||||
serdes_if_type_xe7=14
|
||||
|
||||
serdes_driver_current_xe8=0x9
|
||||
serdes_preemphasis_xe8=0x2c4400
|
||||
serdes_preemphasis_xe8=0x003c08
|
||||
serdes_if_type_xe8=14
|
||||
|
||||
serdes_driver_current_xe9=0x9
|
||||
serdes_preemphasis_xe9=0x284800
|
||||
serdes_preemphasis_xe9=0x003c08
|
||||
serdes_if_type_xe9=14
|
||||
|
||||
serdes_driver_current_xe10=0x9
|
||||
serdes_preemphasis_xe10=0x2C4400
|
||||
serdes_preemphasis_xe10=0x003c08
|
||||
serdes_if_type_xe10=14
|
||||
|
||||
serdes_driver_current_xe11=0x9
|
||||
serdes_preemphasis_xe11=0x2c4400
|
||||
serdes_preemphasis_xe11=0x003c08
|
||||
serdes_if_type_xe11=14
|
||||
|
||||
serdes_driver_current_xe12=0x9
|
||||
serdes_preemphasis_xe12=0x2c4400
|
||||
serdes_preemphasis_xe12=0x2c4408
|
||||
serdes_if_type_xe12=14
|
||||
|
||||
serdes_driver_current_xe13=0x9
|
||||
serdes_preemphasis_xe13=0x2c4400
|
||||
serdes_preemphasis_xe13=0x003c08
|
||||
serdes_if_type_xe13=14
|
||||
|
||||
serdes_driver_current_xe14=0x9
|
||||
serdes_preemphasis_xe14=0x2c4400
|
||||
serdes_preemphasis_xe14=0x003c08
|
||||
serdes_if_type_xe14=14
|
||||
|
||||
serdes_driver_current_xe15=0x9
|
||||
serdes_preemphasis_xe15=0x2c4400
|
||||
serdes_preemphasis_xe15=0x003c08
|
||||
serdes_if_type_xe15=14
|
||||
|
||||
serdes_driver_current_xe16=0x9
|
||||
serdes_preemphasis_xe16=0x2c4400
|
||||
serdes_driver_current_xe16=0xb
|
||||
serdes_preemphasis_xe16=0x0c3c08
|
||||
serdes_if_type_xe16=14
|
||||
|
||||
serdes_driver_current_xe17=0xB
|
||||
serdes_preemphasis_xe17=0x304000
|
||||
serdes_driver_current_xe17=0xb
|
||||
serdes_preemphasis_xe17=0x0c3c10
|
||||
serdes_if_type_xe17=14
|
||||
|
||||
serdes_driver_current_xe18=0xA
|
||||
serdes_preemphasis_xe18=0x2C4400
|
||||
serdes_driver_current_xe18=0xa
|
||||
serdes_preemphasis_xe18=0x083c08
|
||||
serdes_if_type_xe18=14
|
||||
|
||||
serdes_driver_current_xe19=0x9
|
||||
serdes_preemphasis_xe19=0x2C4400
|
||||
serdes_preemphasis_xe19=0x0c3c10
|
||||
serdes_if_type_xe19=14
|
||||
|
||||
serdes_driver_current_xe20=0xA
|
||||
serdes_preemphasis_xe20=0x304000
|
||||
serdes_driver_current_xe20=0xc
|
||||
serdes_preemphasis_xe20=0x043c08
|
||||
serdes_if_type_xe20=14
|
||||
|
||||
serdes_driver_current_xe21=0x9
|
||||
serdes_preemphasis_xe21=0x2C4400
|
||||
serdes_preemphasis_xe21=0x083c08
|
||||
serdes_if_type_xe21=14
|
||||
|
||||
serdes_driver_current_xe22=0x9
|
||||
serdes_preemphasis_xe22=0x2C4400
|
||||
serdes_driver_current_xe22=0xc
|
||||
serdes_preemphasis_xe22=0x083c08
|
||||
serdes_if_type_xe22=14
|
||||
|
||||
serdes_driver_current_xe23=0xC
|
||||
serdes_preemphasis_xe23=0x304000
|
||||
serdes_driver_current_xe23=0xa
|
||||
serdes_preemphasis_xe23=0x083c10
|
||||
serdes_if_type_xe23=14
|
||||
|
||||
serdes_driver_current_xe24=0xF
|
||||
serdes_preemphasis_xe24=0x005100
|
||||
serdes_driver_current_xe24=0x9
|
||||
serdes_preemphasis_xe24=0x083c08
|
||||
serdes_if_type_xe24=14
|
||||
|
||||
serdes_driver_current_xe25=0x9
|
||||
serdes_preemphasis_xe25=0x2C4400
|
||||
serdes_preemphasis_xe25=0x043c08
|
||||
serdes_if_type_xe25=14
|
||||
|
||||
serdes_driver_current_xe26=0x9
|
||||
serdes_preemphasis_xe26=0x304000
|
||||
serdes_preemphasis_xe26=0x003c08
|
||||
serdes_if_type_xe26=14
|
||||
|
||||
serdes_driver_current_xe27=0x9
|
||||
serdes_preemphasis_xe27=0x304000
|
||||
serdes_driver_current_xe27=0xc
|
||||
serdes_preemphasis_xe27=0x083c08
|
||||
serdes_if_type_xe27=14
|
||||
|
||||
serdes_driver_current_xe28=0xA
|
||||
serdes_preemphasis_xe28=0x2C4400
|
||||
serdes_driver_current_xe28=0xa
|
||||
serdes_preemphasis_xe28=0x003c10
|
||||
serdes_if_type_xe28=14
|
||||
|
||||
serdes_driver_current_xe29=0x9
|
||||
serdes_preemphasis_xe29=0x284800
|
||||
serdes_preemphasis_xe29=0x043c10
|
||||
serdes_if_type_xe29=14
|
||||
|
||||
serdes_driver_current_xe30=0x9
|
||||
serdes_preemphasis_xe30=0x2C4400
|
||||
serdes_preemphasis_xe30=0x003c14
|
||||
serdes_if_type_xe30=14
|
||||
|
||||
serdes_driver_current_xe31=0xA
|
||||
serdes_preemphasis_xe31=0x2C4400
|
||||
serdes_driver_current_xe31=0xa
|
||||
serdes_preemphasis_xe31=0x003c14
|
||||
serdes_if_type_xe31=14
|
||||
|
||||
serdes_driver_current_xe32=0x9
|
||||
serdes_preemphasis_xe32=0x284800
|
||||
serdes_preemphasis_xe32=0x003c08
|
||||
serdes_if_type_xe32=14
|
||||
|
||||
serdes_driver_current_xe33=0x7
|
||||
serdes_preemphasis_xe33=0x284800
|
||||
serdes_preemphasis_xe33=0x003c08
|
||||
serdes_if_type_xe33=14
|
||||
|
||||
serdes_driver_current_xe34=0x9
|
||||
serdes_preemphasis_xe34=0x284800
|
||||
serdes_preemphasis_xe34=0x003c08
|
||||
serdes_if_type_xe34=14
|
||||
|
||||
serdes_driver_current_xe35=0x9
|
||||
serdes_preemphasis_xe35=0x284800
|
||||
serdes_preemphasis_xe35=0x003c08
|
||||
serdes_if_type_xe35=14
|
||||
|
||||
serdes_driver_current_xe36=0x9
|
||||
serdes_preemphasis_xe36=0x284800
|
||||
serdes_preemphasis_xe36=0x003c08
|
||||
serdes_if_type_xe36=14
|
||||
|
||||
serdes_driver_current_xe37=0x9
|
||||
serdes_preemphasis_xe37=0x284800
|
||||
serdes_preemphasis_xe37=0x003c0c
|
||||
serdes_if_type_xe37=14
|
||||
|
||||
serdes_driver_current_xe38=0x9
|
||||
serdes_preemphasis_xe38=0x2C4400
|
||||
serdes_preemphasis_xe38=0x003c08
|
||||
serdes_if_type_xe38=14
|
||||
|
||||
serdes_driver_current_xe39=0x9
|
||||
serdes_preemphasis_xe39=0x284800
|
||||
serdes_preemphasis_xe39=0x003c08
|
||||
serdes_if_type_xe39=14
|
||||
|
||||
serdes_driver_current_xe40=0xA
|
||||
serdes_preemphasis_xe40=0x284800
|
||||
serdes_driver_current_xe40=0xa
|
||||
serdes_preemphasis_xe40=0x003c10
|
||||
serdes_if_type_xe40=14
|
||||
|
||||
serdes_driver_current_xe41=0x9
|
||||
serdes_preemphasis_xe41=0x2C4400
|
||||
serdes_preemphasis_xe41=0x003c10
|
||||
serdes_if_type_xe41=14
|
||||
|
||||
serdes_driver_current_xe42=0x9
|
||||
serdes_preemphasis_xe42=0x2C4400
|
||||
serdes_driver_current_xe42=0xc
|
||||
serdes_preemphasis_xe42=0x083c08
|
||||
serdes_if_type_xe42=14
|
||||
|
||||
serdes_driver_current_xe43=0xA
|
||||
serdes_preemphasis_xe43=0x2E4200
|
||||
serdes_driver_current_xe43=0xa
|
||||
serdes_preemphasis_xe43=0x003c10
|
||||
serdes_if_type_xe43=14
|
||||
|
||||
serdes_driver_current_xe44=0xA
|
||||
serdes_preemphasis_xe44=0x2E4200
|
||||
serdes_driver_current_xe44=0xa
|
||||
serdes_preemphasis_xe44=0x003c08
|
||||
serdes_if_type_xe44=14
|
||||
|
||||
serdes_driver_current_xe45=0xA
|
||||
serdes_preemphasis_xe45=0x2C4400
|
||||
serdes_driver_current_xe45=0x9
|
||||
serdes_preemphasis_xe45=0x003c10
|
||||
serdes_if_type_xe45=14
|
||||
|
||||
serdes_driver_current_xe46=0x9
|
||||
serdes_preemphasis_xe46=0x2C4400
|
||||
serdes_preemphasis_xe46=0x043c08
|
||||
serdes_if_type_xe46=14
|
||||
|
||||
serdes_driver_current_xe47=0x9
|
||||
serdes_preemphasis_xe47=0x2C4400
|
||||
serdes_driver_current_xe47=0xa
|
||||
serdes_preemphasis_xe47=0x003c08
|
||||
serdes_if_type_xe47=14
|
||||
|
||||
serdes_driver_current_lane0_ce0=0x9
|
||||
serdes_driver_current_lane1_ce0=0xF
|
||||
serdes_driver_current_lane1_ce0=0xf
|
||||
serdes_driver_current_lane2_ce0=0x9
|
||||
serdes_driver_current_lane3_ce0=0x9
|
||||
serdes_preemphasis_lane0_ce0=0x2C4400
|
||||
serdes_preemphasis_lane1_ce0=0x343C00
|
||||
serdes_preemphasis_lane2_ce0=0x2C4400
|
||||
serdes_preemphasis_lane3_ce0=0x2C4400
|
||||
serdes_preemphasis_lane0_ce0=0x003c08
|
||||
serdes_preemphasis_lane1_ce0=0x003c08
|
||||
serdes_preemphasis_lane2_ce0=0x003c08
|
||||
serdes_preemphasis_lane3_ce0=0x003c08
|
||||
serdes_if_type_ce0=14
|
||||
|
||||
serdes_driver_current_lane0_ce1=0x9
|
||||
serdes_driver_current_lane1_ce1=0x9
|
||||
serdes_driver_current_lane2_ce1=0x9
|
||||
serdes_driver_current_lane3_ce1=0xE
|
||||
serdes_preemphasis_lane0_ce1=0x284800
|
||||
serdes_preemphasis_lane1_ce1=0x284800
|
||||
serdes_preemphasis_lane2_ce1=0x2C4400
|
||||
serdes_preemphasis_lane3_ce1=0x2C4400
|
||||
serdes_driver_current_lane3_ce1=0xe
|
||||
serdes_preemphasis_lane0_ce1=0x003c08
|
||||
serdes_preemphasis_lane1_ce1=0x003c08
|
||||
serdes_preemphasis_lane2_ce1=0x003c08
|
||||
serdes_preemphasis_lane3_ce1=0x003c08
|
||||
serdes_if_type_ce1=14
|
||||
|
||||
serdes_driver_current_lane0_ce2=0x9
|
||||
serdes_driver_current_lane1_ce2=0xF
|
||||
serdes_driver_current_lane1_ce2=0xf
|
||||
serdes_driver_current_lane2_ce2=0x9
|
||||
serdes_driver_current_lane3_ce2=0xD
|
||||
serdes_preemphasis_lane0_ce2=0x284800
|
||||
serdes_preemphasis_lane1_ce2=0x343C00
|
||||
serdes_preemphasis_lane2_ce2=0x284800
|
||||
serdes_preemphasis_lane3_ce2=0x304000
|
||||
serdes_driver_current_lane3_ce2=0xd
|
||||
serdes_preemphasis_lane0_ce2=0x003c08
|
||||
serdes_preemphasis_lane1_ce2=0x003c08
|
||||
serdes_preemphasis_lane2_ce2=0x003c08
|
||||
serdes_preemphasis_lane3_ce2=0x003c08
|
||||
serdes_if_type_ce2=14
|
||||
|
||||
serdes_driver_current_lane0_ce3=0x9
|
||||
serdes_driver_current_lane1_ce3=0xD
|
||||
serdes_driver_current_lane1_ce3=0xd
|
||||
serdes_driver_current_lane2_ce3=0x9
|
||||
serdes_driver_current_lane3_ce3=0xD
|
||||
serdes_preemphasis_lane0_ce3=0x2C4400
|
||||
serdes_preemphasis_lane1_ce3=0x304000
|
||||
serdes_preemphasis_lane2_ce3=0x2C4400
|
||||
serdes_preemphasis_lane3_ce3=0x304000
|
||||
serdes_driver_current_lane3_ce3=0xd
|
||||
serdes_preemphasis_lane0_ce3=0x003c08
|
||||
serdes_preemphasis_lane1_ce3=0x003c08
|
||||
serdes_preemphasis_lane2_ce3=0x003c08
|
||||
serdes_preemphasis_lane3_ce3=0x003c08
|
||||
serdes_if_type_ce3=14
|
||||
|
||||
serdes_driver_current_lane0_ce4=0x9
|
||||
serdes_driver_current_lane1_ce4=0x9
|
||||
serdes_driver_current_lane2_ce4=0x9
|
||||
serdes_driver_current_lane3_ce4=0xD
|
||||
serdes_preemphasis_lane0_ce4=0x2C4400
|
||||
serdes_preemphasis_lane1_ce4=0x2C4400
|
||||
serdes_preemphasis_lane2_ce4=0x2C4400
|
||||
serdes_preemphasis_lane3_ce4=0x304000
|
||||
serdes_driver_current_lane3_ce4=0xd
|
||||
serdes_preemphasis_lane0_ce4=0x003c08
|
||||
serdes_preemphasis_lane1_ce4=0x003c08
|
||||
serdes_preemphasis_lane2_ce4=0x003c08
|
||||
serdes_preemphasis_lane3_ce4=0x003c08
|
||||
serdes_if_type_ce4=14
|
||||
|
||||
serdes_driver_current_lane0_ce5=0x9
|
||||
serdes_driver_current_lane1_ce5=0xF
|
||||
serdes_driver_current_lane1_ce5=0xf
|
||||
serdes_driver_current_lane2_ce5=0x9
|
||||
serdes_driver_current_lane3_ce5=0x9
|
||||
serdes_preemphasis_lane0_ce5=0x2C4400
|
||||
serdes_preemphasis_lane1_ce5=0x383800
|
||||
serdes_preemphasis_lane2_ce5=0x2C4400
|
||||
serdes_preemphasis_lane3_ce5=0x2C4400
|
||||
serdes_preemphasis_lane0_ce5=0x003c08
|
||||
serdes_preemphasis_lane1_ce5=0x003c08
|
||||
serdes_preemphasis_lane2_ce5=0x003c08
|
||||
serdes_preemphasis_lane3_ce5=0x003c08
|
||||
serdes_if_type_ce5=14
|
||||
|
||||
serdes_driver_current_lane0_ce6=0x9
|
||||
serdes_driver_current_lane1_ce6=0x9
|
||||
serdes_driver_current_lane2_ce6=0x9
|
||||
serdes_driver_current_lane3_ce6=0xE
|
||||
serdes_preemphasis_lane0_ce6=0x2C4400
|
||||
serdes_preemphasis_lane1_ce6=0x2C4400
|
||||
serdes_preemphasis_lane2_ce6=0x2C4400
|
||||
serdes_preemphasis_lane3_ce6=0x304000
|
||||
serdes_driver_current_lane3_ce6=0xe
|
||||
serdes_preemphasis_lane0_ce6=0x003c08
|
||||
serdes_preemphasis_lane1_ce6=0x003c08
|
||||
serdes_preemphasis_lane2_ce6=0x003c08
|
||||
serdes_preemphasis_lane3_ce6=0x003c08
|
||||
serdes_if_type_ce6=14
|
||||
|
||||
serdes_driver_current_lane0_ce7=0x9
|
||||
serdes_driver_current_lane1_ce7=0xA
|
||||
serdes_driver_current_lane1_ce7=0xa
|
||||
serdes_driver_current_lane2_ce7=0x9
|
||||
serdes_driver_current_lane3_ce7=0XE
|
||||
serdes_preemphasis_lane0_ce7=0x284800
|
||||
serdes_preemphasis_lane1_ce7=0x304000
|
||||
serdes_preemphasis_lane2_ce7=0x2C4400
|
||||
serdes_preemphasis_lane3_ce7=0x343C00
|
||||
serdes_driver_current_lane3_ce7=0Xe
|
||||
serdes_preemphasis_lane0_ce7=0x003c08
|
||||
serdes_preemphasis_lane1_ce7=0x003c08
|
||||
serdes_preemphasis_lane2_ce7=0x003c08
|
||||
serdes_preemphasis_lane3_ce7=0x003c08
|
||||
serdes_if_type_ce7=14
|
||||
|
||||
serdes_driver_current_lane0_ce8=0x9
|
||||
serdes_driver_current_lane1_ce8=0xE
|
||||
serdes_driver_current_lane2_ce8=0xF
|
||||
serdes_driver_current_lane3_ce8=0xE
|
||||
serdes_preemphasis_lane0_ce8=0x2C4400
|
||||
serdes_preemphasis_lane1_ce8=0x304000
|
||||
serdes_preemphasis_lane2_ce8=0x343C00
|
||||
serdes_preemphasis_lane3_ce8=0x304000
|
||||
serdes_driver_current_lane0_ce8=0xf
|
||||
serdes_driver_current_lane1_ce8=0xf
|
||||
serdes_driver_current_lane2_ce8=0xf
|
||||
serdes_driver_current_lane3_ce8=0xf
|
||||
serdes_preemphasis_lane0_ce8=0x043c08
|
||||
serdes_preemphasis_lane1_ce8=0x003c08
|
||||
serdes_preemphasis_lane2_ce8=0x043c08
|
||||
serdes_preemphasis_lane3_ce8=0x003c08
|
||||
serdes_if_type_ce8=14
|
||||
|
||||
serdes_driver_current_lane0_ce9=0x9
|
||||
serdes_driver_current_lane1_ce9=0xD
|
||||
serdes_driver_current_lane2_ce9=0xD
|
||||
serdes_driver_current_lane3_ce9=0xF
|
||||
serdes_preemphasis_lane0_ce9=0x2C4400
|
||||
serdes_preemphasis_lane1_ce9=0x343C00
|
||||
serdes_preemphasis_lane2_ce9=0x343C00
|
||||
serdes_preemphasis_lane3_ce9=0x343C00
|
||||
serdes_driver_current_lane0_ce9=0xf
|
||||
serdes_driver_current_lane1_ce9=0xf
|
||||
serdes_driver_current_lane2_ce9=0xf
|
||||
serdes_driver_current_lane3_ce9=0xf
|
||||
serdes_preemphasis_lane0_ce9=0x043c08
|
||||
serdes_preemphasis_lane1_ce9=0x043c08
|
||||
serdes_preemphasis_lane2_ce9=0x043c08
|
||||
serdes_preemphasis_lane3_ce9=0x043c08
|
||||
serdes_if_type_ce9=14
|
||||
|
||||
serdes_driver_current_lane0_ce10=0xD
|
||||
serdes_driver_current_lane1_ce10=0xE
|
||||
serdes_driver_current_lane2_ce10=0xD
|
||||
serdes_driver_current_lane3_ce10=0xD
|
||||
serdes_preemphasis_lane0_ce10=0x343C00
|
||||
serdes_preemphasis_lane1_ce10=0x343C00
|
||||
serdes_preemphasis_lane2_ce10=0x343C00
|
||||
serdes_preemphasis_lane3_ce10=0x343C00
|
||||
serdes_driver_current_lane0_ce10=0xf
|
||||
serdes_driver_current_lane1_ce10=0xf
|
||||
serdes_driver_current_lane2_ce10=0xf
|
||||
serdes_driver_current_lane3_ce10=0xf
|
||||
serdes_preemphasis_lane0_ce10=0x043c08
|
||||
serdes_preemphasis_lane1_ce10=0x083c10
|
||||
serdes_preemphasis_lane2_ce10=0x043c08
|
||||
serdes_preemphasis_lane3_ce10=0x043c08
|
||||
serdes_if_type_ce10=14
|
||||
|
||||
serdes_driver_current_lane0_ce11=0xE
|
||||
serdes_driver_current_lane1_ce11=0xD
|
||||
serdes_driver_current_lane2_ce11=0xD
|
||||
serdes_driver_current_lane3_ce11=0xD
|
||||
serdes_preemphasis_lane0_ce11=0x343C00
|
||||
serdes_preemphasis_lane1_ce11=0x343C00
|
||||
serdes_preemphasis_lane2_ce11=0X343C00
|
||||
serdes_preemphasis_lane3_ce11=0X343C00
|
||||
serdes_driver_current_lane0_ce11=0xf
|
||||
serdes_driver_current_lane1_ce11=0xf
|
||||
serdes_driver_current_lane2_ce11=0xf
|
||||
serdes_driver_current_lane3_ce11=0xf
|
||||
serdes_preemphasis_lane0_ce11=0x083c08
|
||||
serdes_preemphasis_lane1_ce11=0x043c08
|
||||
serdes_preemphasis_lane2_ce11=0X043c08
|
||||
serdes_preemphasis_lane3_ce11=0X043c08
|
||||
serdes_if_type_ce11=14
|
||||
|
||||
serdes_driver_current_lane0_ce12=0xD
|
||||
serdes_driver_current_lane1_ce12=0xD
|
||||
serdes_driver_current_lane2_ce12=0xD
|
||||
serdes_driver_current_lane3_ce12=0xD
|
||||
serdes_preemphasis_lane0_ce12=0x343C00
|
||||
serdes_preemphasis_lane1_ce12=0x343C00
|
||||
serdes_preemphasis_lane2_ce12=0x343C00
|
||||
serdes_preemphasis_lane3_ce12=0x343C00
|
||||
serdes_driver_current_lane0_ce12=0xf
|
||||
serdes_driver_current_lane1_ce12=0xf
|
||||
serdes_driver_current_lane2_ce12=0xf
|
||||
serdes_driver_current_lane3_ce12=0xf
|
||||
serdes_preemphasis_lane0_ce12=0x0c3c08
|
||||
serdes_preemphasis_lane1_ce12=0x083c08
|
||||
serdes_preemphasis_lane2_ce12=0x0c3c08
|
||||
serdes_preemphasis_lane3_ce12=0x083c08
|
||||
serdes_if_type_ce12=14
|
||||
|
||||
serdes_driver_current_lane0_ce13=0xD
|
||||
serdes_driver_current_lane1_ce13=0xD
|
||||
serdes_driver_current_lane2_ce13=0xD
|
||||
serdes_driver_current_lane3_ce13=0xF
|
||||
serdes_preemphasis_lane0_ce13=0x343C00
|
||||
serdes_preemphasis_lane1_ce13=0x343C00
|
||||
serdes_preemphasis_lane2_ce13=0x343C00
|
||||
serdes_preemphasis_lane3_ce13=0x005800
|
||||
serdes_driver_current_lane0_ce13=0xf
|
||||
serdes_driver_current_lane1_ce13=0xf
|
||||
serdes_driver_current_lane2_ce13=0xf
|
||||
serdes_driver_current_lane3_ce13=0xf
|
||||
serdes_preemphasis_lane0_ce13=0x083c08
|
||||
serdes_preemphasis_lane1_ce13=0x0c3c08
|
||||
serdes_preemphasis_lane2_ce13=0x083c08
|
||||
serdes_preemphasis_lane3_ce13=0x0c3c08
|
||||
serdes_if_type_ce13=14
|
||||
|
||||
serdes_driver_current_lane0_ce14=0xE
|
||||
serdes_driver_current_lane1_ce14=0xD
|
||||
serdes_driver_current_lane2_ce14=0xD
|
||||
serdes_driver_current_lane3_ce14=0xE
|
||||
serdes_preemphasis_lane0_ce14=0x383800
|
||||
serdes_preemphasis_lane1_ce14=0x343C00
|
||||
serdes_preemphasis_lane2_ce14=0x343C00
|
||||
serdes_preemphasis_lane3_ce14=0x383800
|
||||
serdes_driver_current_lane0_ce14=0xf
|
||||
serdes_driver_current_lane1_ce14=0xf
|
||||
serdes_driver_current_lane2_ce14=0xf
|
||||
serdes_driver_current_lane3_ce14=0xf
|
||||
serdes_preemphasis_lane0_ce14=0x103c10
|
||||
serdes_preemphasis_lane1_ce14=0x0c3c08
|
||||
serdes_preemphasis_lane2_ce14=0x0c3c08
|
||||
serdes_preemphasis_lane3_ce14=0x0c3c08
|
||||
serdes_if_type_ce14=14
|
||||
|
||||
serdes_driver_current_lane0_ce15=0xD
|
||||
serdes_driver_current_lane1_ce15=0xC
|
||||
serdes_driver_current_lane2_ce15=0xC
|
||||
serdes_driver_current_lane3_ce15=0xF
|
||||
serdes_preemphasis_lane0_ce15=0x343C00
|
||||
serdes_preemphasis_lane1_ce15=0x304000
|
||||
serdes_preemphasis_lane2_ce15=0x304000
|
||||
serdes_preemphasis_lane3_ce15=0x005100
|
||||
serdes_driver_current_lane0_ce15=0xf
|
||||
serdes_driver_current_lane1_ce15=0xf
|
||||
serdes_driver_current_lane2_ce15=0xf
|
||||
serdes_driver_current_lane3_ce15=0xf
|
||||
serdes_preemphasis_lane0_ce15=0x143c08
|
||||
serdes_preemphasis_lane1_ce15=0x103c08
|
||||
serdes_preemphasis_lane2_ce15=0x103c08
|
||||
serdes_preemphasis_lane3_ce15=0x103c08
|
||||
serdes_if_type_ce15=14
|
||||
|
@ -3,6 +3,8 @@
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
import time
|
||||
from sonic_sfp.sfputilbase import SfpUtilBase
|
||||
@ -16,6 +18,7 @@ class SfpUtil(SfpUtilBase):
|
||||
PORT_START = 0
|
||||
PORT_END = 31
|
||||
PORTS_IN_BLOCK = 32
|
||||
GPIO_OFFSET = 0
|
||||
|
||||
BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction"
|
||||
BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value"
|
||||
@ -56,110 +59,9 @@ class SfpUtil(SfpUtilBase):
|
||||
31: 40
|
||||
}
|
||||
|
||||
abs_to_gpio_mapping = {
|
||||
0: 241,
|
||||
1: 240,
|
||||
2: 243,
|
||||
3: 242,
|
||||
4: 245,
|
||||
5: 244,
|
||||
6: 247,
|
||||
7: 246,
|
||||
8: 249,
|
||||
9: 248,
|
||||
10: 251,
|
||||
11: 250,
|
||||
12: 253,
|
||||
13: 252,
|
||||
14: 255,
|
||||
15: 254,
|
||||
16: 225,
|
||||
17: 224,
|
||||
18: 227,
|
||||
19: 226,
|
||||
20: 229,
|
||||
21: 228,
|
||||
22: 231,
|
||||
23: 230,
|
||||
24: 233,
|
||||
25: 232,
|
||||
26: 235,
|
||||
27: 234,
|
||||
28: 237,
|
||||
29: 236,
|
||||
30: 239,
|
||||
31: 238
|
||||
}
|
||||
|
||||
lpmode_to_gpio_mapping = {
|
||||
0: 177,
|
||||
1: 176,
|
||||
2: 179,
|
||||
3: 178,
|
||||
4: 181,
|
||||
5: 180,
|
||||
6: 183,
|
||||
7: 182,
|
||||
8: 185,
|
||||
9: 184,
|
||||
10: 187,
|
||||
11: 186,
|
||||
12: 189,
|
||||
13: 188,
|
||||
14: 191,
|
||||
15: 190,
|
||||
16: 161,
|
||||
17: 160,
|
||||
18: 163,
|
||||
19: 162,
|
||||
20: 165,
|
||||
21: 164,
|
||||
22: 167,
|
||||
23: 166,
|
||||
24: 169,
|
||||
25: 168,
|
||||
26: 171,
|
||||
27: 170,
|
||||
28: 173,
|
||||
29: 172,
|
||||
30: 175,
|
||||
31: 174
|
||||
}
|
||||
|
||||
reset_to_gpio_mapping = {
|
||||
0: 145,
|
||||
1: 144,
|
||||
2: 147,
|
||||
3: 146,
|
||||
4: 149,
|
||||
5: 148,
|
||||
6: 151,
|
||||
7: 150,
|
||||
8: 153,
|
||||
9: 152,
|
||||
10: 155,
|
||||
11: 154,
|
||||
12: 157,
|
||||
13: 156,
|
||||
14: 159,
|
||||
15: 158,
|
||||
16: 129,
|
||||
17: 128,
|
||||
18: 131,
|
||||
19: 130,
|
||||
20: 133,
|
||||
21: 132,
|
||||
22: 135,
|
||||
23: 134,
|
||||
24: 137,
|
||||
25: 136,
|
||||
26: 139,
|
||||
27: 138,
|
||||
28: 141,
|
||||
29: 140,
|
||||
30: 143,
|
||||
31: 142
|
||||
}
|
||||
abs_to_gpio_mapping = {}
|
||||
lpmode_to_gpio_mapping = {}
|
||||
reset_to_gpio_mapping = {}
|
||||
|
||||
@property
|
||||
def port_start(self):
|
||||
@ -177,7 +79,139 @@ class SfpUtil(SfpUtilBase):
|
||||
def port_to_eeprom_mapping(self):
|
||||
return self._port_to_eeprom_mapping
|
||||
|
||||
def set_gpio_offset(self):
|
||||
sys_gpio_dir = "/sys/class/gpio"
|
||||
self.GPIO_OFFSET = 0
|
||||
gpiochip_no = 0
|
||||
for d in os.listdir(sys_gpio_dir):
|
||||
if "gpiochip" in d:
|
||||
try:
|
||||
gpiochip_no = int(d[8:],10)
|
||||
except ValueError as e:
|
||||
print "Error: %s" % str(e)
|
||||
if gpiochip_no > 255:
|
||||
self.GPIO_OFFSET=256
|
||||
return True
|
||||
return True
|
||||
|
||||
def init_abs_to_gpio_mapping(self):
|
||||
self.abs_to_gpio_mapping = {
|
||||
0: 241+self.GPIO_OFFSET,
|
||||
1: 240+self.GPIO_OFFSET,
|
||||
2: 243+self.GPIO_OFFSET,
|
||||
3: 242+self.GPIO_OFFSET,
|
||||
4: 245+self.GPIO_OFFSET,
|
||||
5: 244+self.GPIO_OFFSET,
|
||||
6: 247+self.GPIO_OFFSET,
|
||||
7: 246+self.GPIO_OFFSET,
|
||||
8: 249+self.GPIO_OFFSET,
|
||||
9: 248+self.GPIO_OFFSET,
|
||||
10: 251+self.GPIO_OFFSET,
|
||||
11: 250+self.GPIO_OFFSET,
|
||||
12: 253+self.GPIO_OFFSET,
|
||||
13: 252+self.GPIO_OFFSET,
|
||||
14: 255+self.GPIO_OFFSET,
|
||||
15: 254+self.GPIO_OFFSET,
|
||||
16: 225+self.GPIO_OFFSET,
|
||||
17: 224+self.GPIO_OFFSET,
|
||||
18: 227+self.GPIO_OFFSET,
|
||||
19: 226+self.GPIO_OFFSET,
|
||||
20: 229+self.GPIO_OFFSET,
|
||||
21: 228+self.GPIO_OFFSET,
|
||||
22: 231+self.GPIO_OFFSET,
|
||||
23: 230+self.GPIO_OFFSET,
|
||||
24: 233+self.GPIO_OFFSET,
|
||||
25: 232+self.GPIO_OFFSET,
|
||||
26: 235+self.GPIO_OFFSET,
|
||||
27: 234+self.GPIO_OFFSET,
|
||||
28: 237+self.GPIO_OFFSET,
|
||||
29: 236+self.GPIO_OFFSET,
|
||||
30: 239+self.GPIO_OFFSET,
|
||||
31: 238+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def init_lpmode_to_gpio_mapping(self):
|
||||
self.lpmode_to_gpio_mapping = {
|
||||
0: 177+self.GPIO_OFFSET,
|
||||
1: 176+self.GPIO_OFFSET,
|
||||
2: 179+self.GPIO_OFFSET,
|
||||
3: 178+self.GPIO_OFFSET,
|
||||
4: 181+self.GPIO_OFFSET,
|
||||
5: 180+self.GPIO_OFFSET,
|
||||
6: 183+self.GPIO_OFFSET,
|
||||
7: 182+self.GPIO_OFFSET,
|
||||
8: 185+self.GPIO_OFFSET,
|
||||
9: 184+self.GPIO_OFFSET,
|
||||
10: 187+self.GPIO_OFFSET,
|
||||
11: 186+self.GPIO_OFFSET,
|
||||
12: 189+self.GPIO_OFFSET,
|
||||
13: 188+self.GPIO_OFFSET,
|
||||
14: 191+self.GPIO_OFFSET,
|
||||
15: 190+self.GPIO_OFFSET,
|
||||
16: 161+self.GPIO_OFFSET,
|
||||
17: 160+self.GPIO_OFFSET,
|
||||
18: 163+self.GPIO_OFFSET,
|
||||
19: 162+self.GPIO_OFFSET,
|
||||
20: 165+self.GPIO_OFFSET,
|
||||
21: 164+self.GPIO_OFFSET,
|
||||
22: 167+self.GPIO_OFFSET,
|
||||
23: 166+self.GPIO_OFFSET,
|
||||
24: 169+self.GPIO_OFFSET,
|
||||
25: 168+self.GPIO_OFFSET,
|
||||
26: 171+self.GPIO_OFFSET,
|
||||
27: 170+self.GPIO_OFFSET,
|
||||
28: 173+self.GPIO_OFFSET,
|
||||
29: 172+self.GPIO_OFFSET,
|
||||
30: 175+self.GPIO_OFFSET,
|
||||
31: 174+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def init_reset_to_gpio_mapping(self):
|
||||
self.reset_to_gpio_mapping = {
|
||||
0: 145+self.GPIO_OFFSET,
|
||||
1: 144+self.GPIO_OFFSET,
|
||||
2: 147+self.GPIO_OFFSET,
|
||||
3: 146+self.GPIO_OFFSET,
|
||||
4: 149+self.GPIO_OFFSET,
|
||||
5: 148+self.GPIO_OFFSET,
|
||||
6: 151+self.GPIO_OFFSET,
|
||||
7: 150+self.GPIO_OFFSET,
|
||||
8: 153+self.GPIO_OFFSET,
|
||||
9: 152+self.GPIO_OFFSET,
|
||||
10: 155+self.GPIO_OFFSET,
|
||||
11: 154+self.GPIO_OFFSET,
|
||||
12: 157+self.GPIO_OFFSET,
|
||||
13: 156+self.GPIO_OFFSET,
|
||||
14: 159+self.GPIO_OFFSET,
|
||||
15: 158+self.GPIO_OFFSET,
|
||||
16: 129+self.GPIO_OFFSET,
|
||||
17: 128+self.GPIO_OFFSET,
|
||||
18: 131+self.GPIO_OFFSET,
|
||||
19: 130+self.GPIO_OFFSET,
|
||||
20: 133+self.GPIO_OFFSET,
|
||||
21: 132+self.GPIO_OFFSET,
|
||||
22: 135+self.GPIO_OFFSET,
|
||||
23: 134+self.GPIO_OFFSET,
|
||||
24: 137+self.GPIO_OFFSET,
|
||||
25: 136+self.GPIO_OFFSET,
|
||||
26: 139+self.GPIO_OFFSET,
|
||||
27: 138+self.GPIO_OFFSET,
|
||||
28: 141+self.GPIO_OFFSET,
|
||||
29: 140+self.GPIO_OFFSET,
|
||||
30: 143+self.GPIO_OFFSET,
|
||||
31: 142+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def __init__(self):
|
||||
# Init abs, lpmode, and reset to gpio mapping
|
||||
self.set_gpio_offset()
|
||||
self.init_abs_to_gpio_mapping()
|
||||
self.init_lpmode_to_gpio_mapping()
|
||||
self.init_reset_to_gpio_mapping()
|
||||
|
||||
# Override port_to_eeprom_mapping for class initialization
|
||||
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
import time
|
||||
from sonic_sfp.sfputilbase import SfpUtilBase
|
||||
@ -23,6 +25,7 @@ class SfpUtil(SfpUtilBase):
|
||||
LP_MODE_GPIO_BASE_16_31 = 160
|
||||
RST_GPIO_BASE_0_15 = 144
|
||||
RST_GPIO_BASE_16_31 = 128
|
||||
GPIO_OFFSET = 0
|
||||
|
||||
GPIO_VAL_PATH = "/sys/class/gpio/gpio{0}/value"
|
||||
|
||||
@ -44,8 +47,35 @@ class SfpUtil(SfpUtilBase):
|
||||
def port_to_eeprom_mapping(self):
|
||||
return self._port_to_eeprom_mapping
|
||||
|
||||
def set_gpio_offset(self):
|
||||
sys_gpio_dir = "/sys/class/gpio"
|
||||
self.GPIO_OFFSET = 0
|
||||
gpiochip_no = 0
|
||||
for d in os.listdir(sys_gpio_dir):
|
||||
if "gpiochip" in d:
|
||||
try:
|
||||
gpiochip_no = int(d[8:],10)
|
||||
except ValueError as e:
|
||||
print "Error: %s" % str(e)
|
||||
if gpiochip_no > 255:
|
||||
self.GPIO_OFFSET=256
|
||||
return True
|
||||
return True
|
||||
|
||||
def update_gpio_base(self):
|
||||
self.ABS_GPIO_BASE_0_15 = 240 + self.GPIO_OFFSET
|
||||
self.ABS_GPIO_BASE_16_31 = 224 + self.GPIO_OFFSET
|
||||
self.LP_MODE_GPIO_BASE_0_15 = 176 + self.GPIO_OFFSET
|
||||
self.LP_MODE_GPIO_BASE_16_31 = 160 + self.GPIO_OFFSET
|
||||
self.RST_GPIO_BASE_0_15 = 144 + self.GPIO_OFFSET
|
||||
self.RST_GPIO_BASE_16_31 = 128 + self.GPIO_OFFSET
|
||||
return True
|
||||
|
||||
def __init__(self):
|
||||
# Update abs, lpmode, and reset gpio base
|
||||
self.set_gpio_offset()
|
||||
self.update_gpio_base()
|
||||
|
||||
# Override port_to_eeprom_mapping for class initialization
|
||||
eeprom_path = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'
|
||||
for x in range(self.port_start, self.port_end + 1):
|
||||
|
@ -15,9 +15,26 @@ except ImportError as e:
|
||||
class PsuUtil(PsuBase):
|
||||
"""Platform-specific PSUutil class"""
|
||||
|
||||
GPIO_OFFSET = 0
|
||||
SYS_GPIO_DIR = "/sys/class/gpio/"
|
||||
|
||||
def set_gpio_offset(self):
|
||||
sys_gpio_dir = "/sys/class/gpio"
|
||||
self.GPIO_OFFSET = 0
|
||||
gpiochip_no = 0
|
||||
for d in os.listdir(sys_gpio_dir):
|
||||
if "gpiochip" in d:
|
||||
try:
|
||||
gpiochip_no = int(d[8:],10)
|
||||
except ValueError as e:
|
||||
print "Error: %s" % str(e)
|
||||
if gpiochip_no > 255:
|
||||
self.GPIO_OFFSET=256
|
||||
return True
|
||||
return True
|
||||
|
||||
def __init__(self):
|
||||
self.set_gpio_offset()
|
||||
PsuBase.__init__(self)
|
||||
|
||||
|
||||
@ -54,7 +71,7 @@ class PsuUtil(PsuBase):
|
||||
faulty
|
||||
"""
|
||||
status = 0
|
||||
gpio_path = [ 'gpio99/value', 'gpio96/value' ]
|
||||
gpio_path = [ 'gpio'+str(99+self.GPIO_OFFSET)+'/value', 'gpio'+str(96+self.GPIO_OFFSET)+'/value' ]
|
||||
attr_path = self.SYS_GPIO_DIR + gpio_path[index-1]
|
||||
|
||||
attr_value = self.get_attr_value(attr_path)
|
||||
@ -75,7 +92,7 @@ class PsuUtil(PsuBase):
|
||||
:return: Boolean, True if PSU is plugged, False if not
|
||||
"""
|
||||
status = 0
|
||||
gpio_path = [ 'gpio100/value', 'gpio97/value' ]
|
||||
gpio_path = [ 'gpio'+str(100+self.GPIO_OFFSET)+'/value', 'gpio'+str(97+self.GPIO_OFFSET)+'/value' ]
|
||||
attr_path = self.SYS_GPIO_DIR + gpio_path[index-1]
|
||||
|
||||
attr_value = self.get_attr_value(attr_path)
|
||||
|
@ -3,6 +3,8 @@
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
#
|
||||
|
||||
import os
|
||||
|
||||
try:
|
||||
import time
|
||||
from sonic_sfp.sfputilbase import SfpUtilBase
|
||||
@ -17,6 +19,7 @@ class SfpUtil(SfpUtilBase):
|
||||
PORT_END = 33
|
||||
SFP_PORT_START = 32
|
||||
PORTS_IN_BLOCK = 34
|
||||
GPIO_OFFSET = 0
|
||||
|
||||
BASE_DIR_PATH = "/sys/class/gpio/gpio{0}/direction"
|
||||
BASE_VAL_PATH = "/sys/class/gpio/gpio{0}/value"
|
||||
@ -59,112 +62,9 @@ class SfpUtil(SfpUtilBase):
|
||||
33: 46
|
||||
}
|
||||
|
||||
abs_to_gpio_mapping = {
|
||||
0: 241,
|
||||
1: 240,
|
||||
2: 243,
|
||||
3: 242,
|
||||
4: 245,
|
||||
5: 244,
|
||||
6: 247,
|
||||
7: 246,
|
||||
8: 249,
|
||||
9: 248,
|
||||
10: 251,
|
||||
11: 250,
|
||||
12: 253,
|
||||
13: 252,
|
||||
14: 255,
|
||||
15: 254,
|
||||
16: 225,
|
||||
17: 224,
|
||||
18: 227,
|
||||
19: 226,
|
||||
20: 229,
|
||||
21: 228,
|
||||
22: 231,
|
||||
23: 230,
|
||||
24: 233,
|
||||
25: 232,
|
||||
26: 235,
|
||||
27: 234,
|
||||
28: 237,
|
||||
29: 236,
|
||||
30: 239,
|
||||
31: 238,
|
||||
32: 177,
|
||||
33: 176
|
||||
}
|
||||
|
||||
lpmode_to_gpio_mapping = {
|
||||
0: 161,
|
||||
1: 160,
|
||||
2: 163,
|
||||
3: 162,
|
||||
4: 165,
|
||||
5: 164,
|
||||
6: 167,
|
||||
7: 166,
|
||||
8: 169,
|
||||
9: 168,
|
||||
10: 171,
|
||||
11: 170,
|
||||
12: 173,
|
||||
13: 172,
|
||||
14: 175,
|
||||
15: 174,
|
||||
16: 145,
|
||||
17: 144,
|
||||
18: 147,
|
||||
19: 146,
|
||||
20: 149,
|
||||
21: 148,
|
||||
22: 151,
|
||||
23: 150,
|
||||
24: 153,
|
||||
25: 152,
|
||||
26: 155,
|
||||
27: 154,
|
||||
28: 157,
|
||||
29: 156,
|
||||
30: 159,
|
||||
31: 158
|
||||
}
|
||||
|
||||
reset_to_gpio_mapping = {
|
||||
0: 129,
|
||||
1: 128,
|
||||
2: 131,
|
||||
3: 130,
|
||||
4: 133,
|
||||
5: 132,
|
||||
6: 135,
|
||||
7: 134,
|
||||
8: 137,
|
||||
9: 136,
|
||||
10: 139,
|
||||
11: 138,
|
||||
12: 141,
|
||||
13: 140,
|
||||
14: 143,
|
||||
15: 142,
|
||||
16: 113,
|
||||
17: 112,
|
||||
18: 115,
|
||||
19: 114,
|
||||
20: 117,
|
||||
21: 116,
|
||||
22: 119,
|
||||
23: 118,
|
||||
24: 121,
|
||||
25: 120,
|
||||
26: 123,
|
||||
27: 122,
|
||||
28: 125,
|
||||
29: 124,
|
||||
30: 127,
|
||||
31: 126
|
||||
}
|
||||
abs_to_gpio_mapping = {}
|
||||
lpmode_to_gpio_mapping = {}
|
||||
reset_to_gpio_mapping = {}
|
||||
|
||||
@property
|
||||
def port_start(self):
|
||||
@ -185,7 +85,141 @@ class SfpUtil(SfpUtilBase):
|
||||
def sfp_port_start(self):
|
||||
return self.SFP_PORT_START
|
||||
|
||||
def set_gpio_offset(self):
|
||||
sys_gpio_dir = "/sys/class/gpio"
|
||||
self.GPIO_OFFSET = 0
|
||||
gpiochip_no = 0
|
||||
for d in os.listdir(sys_gpio_dir):
|
||||
if "gpiochip" in d:
|
||||
try:
|
||||
gpiochip_no = int(d[8:],10)
|
||||
except ValueError as e:
|
||||
print "Error: %s" % str(e)
|
||||
if gpiochip_no > 255:
|
||||
self.GPIO_OFFSET=256
|
||||
return True
|
||||
return True
|
||||
|
||||
def init_abs_to_gpio_mapping(self):
|
||||
self.abs_to_gpio_mapping = {
|
||||
0: 241+self.GPIO_OFFSET,
|
||||
1: 240+self.GPIO_OFFSET,
|
||||
2: 243+self.GPIO_OFFSET,
|
||||
3: 242+self.GPIO_OFFSET,
|
||||
4: 245+self.GPIO_OFFSET,
|
||||
5: 244+self.GPIO_OFFSET,
|
||||
6: 247+self.GPIO_OFFSET,
|
||||
7: 246+self.GPIO_OFFSET,
|
||||
8: 249+self.GPIO_OFFSET,
|
||||
9: 248+self.GPIO_OFFSET,
|
||||
10: 251+self.GPIO_OFFSET,
|
||||
11: 250+self.GPIO_OFFSET,
|
||||
12: 253+self.GPIO_OFFSET,
|
||||
13: 252+self.GPIO_OFFSET,
|
||||
14: 255+self.GPIO_OFFSET,
|
||||
15: 254+self.GPIO_OFFSET,
|
||||
16: 225+self.GPIO_OFFSET,
|
||||
17: 224+self.GPIO_OFFSET,
|
||||
18: 227+self.GPIO_OFFSET,
|
||||
19: 226+self.GPIO_OFFSET,
|
||||
20: 229+self.GPIO_OFFSET,
|
||||
21: 228+self.GPIO_OFFSET,
|
||||
22: 231+self.GPIO_OFFSET,
|
||||
23: 230+self.GPIO_OFFSET,
|
||||
24: 233+self.GPIO_OFFSET,
|
||||
25: 232+self.GPIO_OFFSET,
|
||||
26: 235+self.GPIO_OFFSET,
|
||||
27: 234+self.GPIO_OFFSET,
|
||||
28: 237+self.GPIO_OFFSET,
|
||||
29: 236+self.GPIO_OFFSET,
|
||||
30: 239+self.GPIO_OFFSET,
|
||||
31: 238+self.GPIO_OFFSET,
|
||||
32: 177+self.GPIO_OFFSET,
|
||||
33: 176+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def init_lpmode_to_gpio_mapping(self):
|
||||
self.lpmode_to_gpio_mapping = {
|
||||
0: 161+self.GPIO_OFFSET,
|
||||
1: 160+self.GPIO_OFFSET,
|
||||
2: 163+self.GPIO_OFFSET,
|
||||
3: 162+self.GPIO_OFFSET,
|
||||
4: 165+self.GPIO_OFFSET,
|
||||
5: 164+self.GPIO_OFFSET,
|
||||
6: 167+self.GPIO_OFFSET,
|
||||
7: 166+self.GPIO_OFFSET,
|
||||
8: 169+self.GPIO_OFFSET,
|
||||
9: 168+self.GPIO_OFFSET,
|
||||
10: 171+self.GPIO_OFFSET,
|
||||
11: 170+self.GPIO_OFFSET,
|
||||
12: 173+self.GPIO_OFFSET,
|
||||
13: 172+self.GPIO_OFFSET,
|
||||
14: 175+self.GPIO_OFFSET,
|
||||
15: 174+self.GPIO_OFFSET,
|
||||
16: 145+self.GPIO_OFFSET,
|
||||
17: 144+self.GPIO_OFFSET,
|
||||
18: 147+self.GPIO_OFFSET,
|
||||
19: 146+self.GPIO_OFFSET,
|
||||
20: 149+self.GPIO_OFFSET,
|
||||
21: 148+self.GPIO_OFFSET,
|
||||
22: 151+self.GPIO_OFFSET,
|
||||
23: 150+self.GPIO_OFFSET,
|
||||
24: 153+self.GPIO_OFFSET,
|
||||
25: 152+self.GPIO_OFFSET,
|
||||
26: 155+self.GPIO_OFFSET,
|
||||
27: 154+self.GPIO_OFFSET,
|
||||
28: 157+self.GPIO_OFFSET,
|
||||
29: 156+self.GPIO_OFFSET,
|
||||
30: 159+self.GPIO_OFFSET,
|
||||
31: 158+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def init_reset_to_gpio_mapping(self):
|
||||
self.reset_to_gpio_mapping = {
|
||||
0: 129+self.GPIO_OFFSET,
|
||||
1: 128+self.GPIO_OFFSET,
|
||||
2: 131+self.GPIO_OFFSET,
|
||||
3: 130+self.GPIO_OFFSET,
|
||||
4: 133+self.GPIO_OFFSET,
|
||||
5: 132+self.GPIO_OFFSET,
|
||||
6: 135+self.GPIO_OFFSET,
|
||||
7: 134+self.GPIO_OFFSET,
|
||||
8: 137+self.GPIO_OFFSET,
|
||||
9: 136+self.GPIO_OFFSET,
|
||||
10: 139+self.GPIO_OFFSET,
|
||||
11: 138+self.GPIO_OFFSET,
|
||||
12: 141+self.GPIO_OFFSET,
|
||||
13: 140+self.GPIO_OFFSET,
|
||||
14: 143+self.GPIO_OFFSET,
|
||||
15: 142+self.GPIO_OFFSET,
|
||||
16: 113+self.GPIO_OFFSET,
|
||||
17: 112+self.GPIO_OFFSET,
|
||||
18: 115+self.GPIO_OFFSET,
|
||||
19: 114+self.GPIO_OFFSET,
|
||||
20: 117+self.GPIO_OFFSET,
|
||||
21: 116+self.GPIO_OFFSET,
|
||||
22: 119+self.GPIO_OFFSET,
|
||||
23: 118+self.GPIO_OFFSET,
|
||||
24: 121+self.GPIO_OFFSET,
|
||||
25: 120+self.GPIO_OFFSET,
|
||||
26: 123+self.GPIO_OFFSET,
|
||||
27: 122+self.GPIO_OFFSET,
|
||||
28: 125+self.GPIO_OFFSET,
|
||||
29: 124+self.GPIO_OFFSET,
|
||||
30: 127+self.GPIO_OFFSET,
|
||||
31: 126+self.GPIO_OFFSET
|
||||
}
|
||||
return True
|
||||
|
||||
def __init__(self):
|
||||
# Init abs, lpmode, and reset to gpio mapping
|
||||
self.set_gpio_offset()
|
||||
self.init_abs_to_gpio_mapping()
|
||||
self.init_lpmode_to_gpio_mapping()
|
||||
self.init_reset_to_gpio_mapping()
|
||||
|
||||
# Override port_to_eeprom_mapping for class initialization
|
||||
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
# name lanes alias index
|
||||
Ethernet0 1,2,3,4 Ethernet1/1 0
|
||||
Ethernet4 5,6,7,8 Ethernet2/1 1
|
||||
Ethernet8 17,18,19,20 Ethernet3/1 2
|
||||
Ethernet12 21,22,23,24 Ethernet4/1 3
|
||||
Ethernet16 33,34,35,36 Ethernet5/1 4
|
||||
Ethernet20 37,38,39,40 Ethernet6/1 5
|
||||
Ethernet24 49,50,51,52 Ethernet7/1 6
|
||||
Ethernet28 53,54,55,56 Ethernet8/1 7
|
||||
Ethernet32 65,66,67,68 Ethernet9/1 8
|
||||
Ethernet36 69,70,71,72 Ethernet10/1 9
|
||||
Ethernet40 81,82,83,84 Ethernet11/1 10
|
||||
Ethernet44 85,86,87,88 Ethernet12/1 11
|
||||
Ethernet0 49,50,51,52 Ethernet1/1 0
|
||||
Ethernet4 53,54,55,56 Ethernet2/1 1
|
||||
Ethernet8 65,66,67,68 Ethernet3/1 2
|
||||
Ethernet12 69,70,71,72 Ethernet4/1 3
|
||||
Ethernet16 81,82,83,84 Ethernet5/1 4
|
||||
Ethernet20 85,86,87,88 Ethernet6/1 5
|
||||
Ethernet24 1,2,3,4 Ethernet7/1 6
|
||||
Ethernet28 5,6,7,8 Ethernet8/1 7
|
||||
Ethernet32 17,18,19,20 Ethernet9/1 8
|
||||
Ethernet36 21,22,23,24 Ethernet10/1 9
|
||||
Ethernet40 33,34,35,36 Ethernet11/1 10
|
||||
Ethernet44 37,38,39,40 Ethernet12/1 11
|
||||
Ethernet48 97,98,99,100 Ethernet13/1 12
|
||||
Ethernet52 101,102,103,104 Ethernet14/1 13
|
||||
Ethernet56 113,114,115,116 Ethernet15/1 14
|
||||
@ -19,30 +19,30 @@ Ethernet64 129,130,131,132 Ethernet17/1 16
|
||||
Ethernet68 133,134,135,136 Ethernet18/1 17
|
||||
Ethernet72 145,146,147,148 Ethernet19/1 18
|
||||
Ethernet76 149,150,151,152 Ethernet20/1 19
|
||||
Ethernet80 161,162,163,164 Ethernet21/1 20
|
||||
Ethernet84 165,166,167,168 Ethernet22/1 21
|
||||
Ethernet88 177,178,179,180 Ethernet23/1 22
|
||||
Ethernet92 181,182,183,184 Ethernet24/1 23
|
||||
Ethernet96 193,194,195,196 Ethernet25/1 24
|
||||
Ethernet100 197,198,199,200 Ethernet26/1 25
|
||||
Ethernet104 209,210,211,212 Ethernet27/1 26
|
||||
Ethernet108 213,214,215,216 Ethernet28/1 27
|
||||
Ethernet112 225,226,227,228 Ethernet29/1 28
|
||||
Ethernet116 229,230,231,232 Ethernet30/1 29
|
||||
Ethernet120 241,242,243,244 Ethernet31/1 30
|
||||
Ethernet124 245,246,247,248 Ethernet32/1 31
|
||||
Ethernet128 9,10,11,12 Ethernet33/1 32
|
||||
Ethernet132 13,14,15,16 Ethernet34/1 33
|
||||
Ethernet136 25,26,27,28 Ethernet35/1 34
|
||||
Ethernet140 29,30,31,32 Ethernet36/1 35
|
||||
Ethernet144 41,42,43,44 Ethernet37/1 36
|
||||
Ethernet148 45,46,47,48 Ethernet38/1 37
|
||||
Ethernet152 57,58,59,60 Ethernet39/1 38
|
||||
Ethernet156 61,62,63,64 Ethernet40/1 39
|
||||
Ethernet160 73,74,75,76 Ethernet41/1 40
|
||||
Ethernet164 77,78,79,80 Ethernet42/1 41
|
||||
Ethernet168 89,90,91,92 Ethernet43/1 42
|
||||
Ethernet172 93,94,95,96 Ethernet44/1 43
|
||||
Ethernet80 209,210,211,212 Ethernet21/1 20
|
||||
Ethernet84 213,214,215,216 Ethernet22/1 21
|
||||
Ethernet88 225,226,227,228 Ethernet23/1 22
|
||||
Ethernet92 229,230,231,232 Ethernet24/1 23
|
||||
Ethernet96 241,242,243,244 Ethernet25/1 24
|
||||
Ethernet100 245,246,247,248 Ethernet26/1 25
|
||||
Ethernet104 161,162,163,164 Ethernet27/1 26
|
||||
Ethernet108 165,166,167,168 Ethernet28/1 27
|
||||
Ethernet112 177,178,179,180 Ethernet29/1 28
|
||||
Ethernet116 181,182,183,184 Ethernet30/1 29
|
||||
Ethernet120 193,194,195,196 Ethernet31/1 30
|
||||
Ethernet124 197,198,199,200 Ethernet32/1 31
|
||||
Ethernet128 57,58,59,60 Ethernet33/1 32
|
||||
Ethernet132 61,62,63,64 Ethernet34/1 33
|
||||
Ethernet136 73,74,75,76 Ethernet35/1 34
|
||||
Ethernet140 77,78,79,80 Ethernet36/1 35
|
||||
Ethernet144 89,90,91,92 Ethernet37/1 36
|
||||
Ethernet148 93,94,95,96 Ethernet38/1 37
|
||||
Ethernet152 9,10,11,12 Ethernet39/1 38
|
||||
Ethernet156 13,14,15,16 Ethernet40/1 39
|
||||
Ethernet160 25,26,27,28 Ethernet41/1 40
|
||||
Ethernet164 29,30,31,32 Ethernet42/1 41
|
||||
Ethernet168 41,42,43,44 Ethernet43/1 42
|
||||
Ethernet172 45,46,47,48 Ethernet44/1 43
|
||||
Ethernet176 105,106,107,108 Ethernet45/1 44
|
||||
Ethernet180 109,110,111,112 Ethernet46/1 45
|
||||
Ethernet184 121,122,123,124 Ethernet47/1 46
|
||||
@ -51,15 +51,15 @@ Ethernet192 137,138,139,140 Ethernet49/1 48
|
||||
Ethernet196 141,142,143,144 Ethernet50/1 49
|
||||
Ethernet200 153,154,155,156 Ethernet51/1 50
|
||||
Ethernet204 157,158,159,160 Ethernet52/1 51
|
||||
Ethernet208 169,170,171,172 Ethernet53/1 52
|
||||
Ethernet212 173,174,175,176 Ethernet54/1 53
|
||||
Ethernet216 185,186,187,188 Ethernet55/1 54
|
||||
Ethernet220 189,190,191,192 Ethernet56/1 55
|
||||
Ethernet224 201,202,203,204 Ethernet57/1 56
|
||||
Ethernet228 205,206,207,208 Ethernet58/1 57
|
||||
Ethernet232 217,218,219,220 Ethernet59/1 58
|
||||
Ethernet236 221,222,223,224 Ethernet60/1 59
|
||||
Ethernet240 233,234,235,236 Ethernet61/1 60
|
||||
Ethernet244 237,238,239,240 Ethernet62/1 61
|
||||
Ethernet248 249,250,251,252 Ethernet63/1 62
|
||||
Ethernet252 253,254,255,256 Ethernet64/1 63
|
||||
Ethernet208 217,218,219,220 Ethernet53/1 52
|
||||
Ethernet212 221,222,223,224 Ethernet54/1 53
|
||||
Ethernet216 233,234,235,236 Ethernet55/1 54
|
||||
Ethernet220 237,238,239,240 Ethernet56/1 55
|
||||
Ethernet224 249,250,251,252 Ethernet57/1 56
|
||||
Ethernet228 253,254,255,256 Ethernet58/1 57
|
||||
Ethernet232 169,170,171,172 Ethernet59/1 58
|
||||
Ethernet236 173,174,175,176 Ethernet60/1 59
|
||||
Ethernet240 185,186,187,188 Ethernet61/1 60
|
||||
Ethernet244 189,190,191,192 Ethernet62/1 61
|
||||
Ethernet248 201,202,203,204 Ethernet63/1 62
|
||||
Ethernet252 205,206,207,208 Ethernet64/1 63
|
||||
|
@ -1 +1 @@
|
||||
SAI_INIT_CONFIG_FILE=/etc/bcm/th2-s9200-64x100G.config.bcm
|
||||
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-s9200-64x100G.config.bcm
|
||||
|
@ -0,0 +1,873 @@
|
||||
#2018/3/6
|
||||
|
||||
os=unix
|
||||
|
||||
oversubscribe_mode=1
|
||||
pbmp_xport_xe=0x3fffd0000ffff40003fffc0001fffe
|
||||
|
||||
#ALPM enable
|
||||
l3_alpm_enable=2
|
||||
ipv6_lpm_128b_enable=1
|
||||
l3_mem_entries=40960
|
||||
l2_mem_entries=40960
|
||||
|
||||
#Parity
|
||||
parity_correction=1
|
||||
parity_enable=1
|
||||
|
||||
l2xmsg_mode=1
|
||||
mmu_lossless=0
|
||||
|
||||
# core_clock_frequency can be 1125, 850, 765, 672, 645 or 545
|
||||
#core_clock_frequency=1125
|
||||
|
||||
|
||||
#PIPE-0
|
||||
#FC 0
|
||||
portmap_1=1:100
|
||||
phy_chain_tx_polarity_flip_physical{1.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{2.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{3.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{4.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{1.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{2.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{3.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{4.0}=1
|
||||
phy_chain_tx_lane_map_physical{1.0}=0x3210
|
||||
phy_chain_rx_lane_map_physical{1.0}=0x0312
|
||||
|
||||
#FC 1
|
||||
portmap_2=5:100
|
||||
phy_chain_tx_polarity_flip_physical{5.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{6.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{7.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{8.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{5.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{6.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{7.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{8.0}=1
|
||||
phy_chain_tx_lane_map_physical{5.0}=0x1023
|
||||
phy_chain_rx_lane_map_physical{5.0}=0x2103
|
||||
|
||||
#FC 2
|
||||
portmap_3=9:100
|
||||
phy_chain_tx_polarity_flip_physical{9.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{10.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{11.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{12.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{9.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{10.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{11.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{12.0}=1
|
||||
phy_chain_tx_lane_map_physical{9.0}=0x3201
|
||||
phy_chain_rx_lane_map_physical{9.0}=0x1320
|
||||
|
||||
#FC 3
|
||||
portmap_4=13:100
|
||||
phy_chain_tx_polarity_flip_physical{13.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{14.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{15.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{16.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{13.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{14.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{15.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{16.0}=0
|
||||
phy_chain_tx_lane_map_physical{13.0}=0x2013
|
||||
phy_chain_rx_lane_map_physical{13.0}=0x2310
|
||||
|
||||
#FC 4
|
||||
portmap_5=17:100
|
||||
phy_chain_tx_polarity_flip_physical{17.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{18.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{19.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{20.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{17.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{18.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{19.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{20.0}=1
|
||||
phy_chain_tx_lane_map_physical{17.0}=0x0213
|
||||
phy_chain_rx_lane_map_physical{17.0}=0x0132
|
||||
|
||||
#FC 5
|
||||
portmap_6=21:100
|
||||
phy_chain_tx_polarity_flip_physical{21.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{22.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{23.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{24.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{21.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{22.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{23.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{24.0}=1
|
||||
phy_chain_tx_lane_map_physical{21.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{21.0}=0x0312
|
||||
|
||||
#FC 6
|
||||
portmap_7=25:100
|
||||
phy_chain_tx_polarity_flip_physical{25.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{26.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{27.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{28.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{25.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{26.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{27.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{28.0}=0
|
||||
phy_chain_tx_lane_map_physical{25.0}=0x2310
|
||||
phy_chain_rx_lane_map_physical{25.0}=0x1302
|
||||
|
||||
#FC 7
|
||||
portmap_8=29:100
|
||||
phy_chain_tx_polarity_flip_physical{29.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{30.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{31.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{32.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{29.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{30.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{31.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{32.0}=0
|
||||
phy_chain_tx_lane_map_physical{29.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{29.0}=0x2310
|
||||
|
||||
#FC 8
|
||||
portmap_9=33:100
|
||||
phy_chain_tx_polarity_flip_physical{33.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{34.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{35.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{36.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{33.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{34.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{35.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{36.0}=0
|
||||
phy_chain_tx_lane_map_physical{33.0}=0x3120
|
||||
phy_chain_rx_lane_map_physical{33.0}=0x2130
|
||||
|
||||
#FC 9
|
||||
portmap_10=37:100
|
||||
phy_chain_tx_polarity_flip_physical{37.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{38.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{39.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{40.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{37.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{38.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{39.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{40.0}=0
|
||||
phy_chain_tx_lane_map_physical{37.0}=0x0123
|
||||
phy_chain_rx_lane_map_physical{37.0}=0x1230
|
||||
|
||||
#FC 10
|
||||
portmap_11=41:100
|
||||
phy_chain_tx_polarity_flip_physical{41.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{42.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{43.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{44.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{41.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{42.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{43.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{44.0}=0
|
||||
phy_chain_tx_lane_map_physical{41.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{41.0}=0x1230
|
||||
|
||||
#FC 11
|
||||
portmap_12=45:100
|
||||
phy_chain_tx_polarity_flip_physical{45.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{46.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{47.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{48.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{45.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{46.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{47.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{48.0}=1
|
||||
phy_chain_tx_lane_map_physical{45.0}=0x0123
|
||||
phy_chain_rx_lane_map_physical{45.0}=0x0213
|
||||
|
||||
#FC 12
|
||||
portmap_13=49:100
|
||||
phy_chain_tx_polarity_flip_physical{49.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{50.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{51.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{52.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{49.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{50.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{51.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{52.0}=0
|
||||
phy_chain_tx_lane_map_physical{49.0}=0x0213
|
||||
phy_chain_rx_lane_map_physical{49.0}=0x0123
|
||||
|
||||
#FC 13
|
||||
portmap_14=53:100
|
||||
phy_chain_tx_polarity_flip_physical{53.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{54.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{55.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{56.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{53.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{54.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{55.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{56.0}=1
|
||||
phy_chain_tx_lane_map_physical{53.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{53.0}=0x0132
|
||||
|
||||
#FC 14
|
||||
portmap_15=57:100
|
||||
phy_chain_tx_polarity_flip_physical{57.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{58.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{59.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{60.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{57.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{58.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{59.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{60.0}=0
|
||||
phy_chain_tx_lane_map_physical{57.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{57.0}=0x2103
|
||||
|
||||
#FC 15
|
||||
portmap_16=61:100
|
||||
phy_chain_tx_polarity_flip_physical{61.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{62.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{63.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{64.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{61.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{62.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{63.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{64.0}=1
|
||||
phy_chain_tx_lane_map_physical{61.0}=0x0132
|
||||
phy_chain_rx_lane_map_physical{61.0}=0x1320
|
||||
|
||||
#PIPE-1
|
||||
#FC 16
|
||||
portmap_34=65:100
|
||||
phy_chain_tx_polarity_flip_physical{65.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{66.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{67.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{68.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{65.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{66.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{67.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{68.0}=0
|
||||
phy_chain_tx_lane_map_physical{65.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{65.0}=0x2031
|
||||
|
||||
#FC 17
|
||||
portmap_35=69:100
|
||||
phy_chain_tx_polarity_flip_physical{69.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{70.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{71.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{72.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{69.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{70.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{71.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{72.0}=1
|
||||
phy_chain_tx_lane_map_physical{69.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{69.0}=0x3201
|
||||
|
||||
#FC 18
|
||||
portmap_36=73:100
|
||||
phy_chain_tx_polarity_flip_physical{73.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{74.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{75.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{76.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{73.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{74.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{75.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{76.0}=0
|
||||
phy_chain_tx_lane_map_physical{73.0}=0x3120
|
||||
phy_chain_rx_lane_map_physical{73.0}=0x3201
|
||||
|
||||
#FC 19
|
||||
portmap_37=77:100
|
||||
phy_chain_tx_polarity_flip_physical{77.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{78.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{79.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{80.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{77.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{78.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{79.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{80.0}=0
|
||||
phy_chain_tx_lane_map_physical{77.0}=0x0132
|
||||
phy_chain_rx_lane_map_physical{77.0}=0x1032
|
||||
|
||||
#FC 20
|
||||
portmap_38=81:100
|
||||
phy_chain_tx_polarity_flip_physical{81.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{82.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{83.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{84.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{81.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{82.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{83.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{84.0}=1
|
||||
phy_chain_tx_lane_map_physical{81.0}=0x0213
|
||||
phy_chain_rx_lane_map_physical{81.0}=0x1203
|
||||
|
||||
#FC 21
|
||||
portmap_39=85:100
|
||||
phy_chain_tx_polarity_flip_physical{85.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{86.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{87.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{88.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{85.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{86.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{87.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{88.0}=1
|
||||
phy_chain_tx_lane_map_physical{85.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{85.0}=0x1230
|
||||
|
||||
#FC 22
|
||||
portmap_40=89:100
|
||||
phy_chain_tx_polarity_flip_physical{89.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{90.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{91.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{92.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{89.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{90.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{91.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{92.0}=0
|
||||
phy_chain_tx_lane_map_physical{89.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{89.0}=0x3201
|
||||
|
||||
#FC 23
|
||||
portmap_41=93:100
|
||||
phy_chain_tx_polarity_flip_physical{93.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{94.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{95.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{96.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{93.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{94.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{95.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{96.0}=0
|
||||
phy_chain_tx_lane_map_physical{93.0}=0x1023
|
||||
phy_chain_rx_lane_map_physical{93.0}=0x1032
|
||||
|
||||
#FC 24
|
||||
portmap_42=97:100
|
||||
phy_chain_tx_polarity_flip_physical{97.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{98.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{99.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{100.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{97.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{98.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{99.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{100.0}=1
|
||||
phy_chain_tx_lane_map_physical{97.0}=0x0132
|
||||
phy_chain_rx_lane_map_physical{97.0}=0x1320
|
||||
|
||||
#FC 25
|
||||
portmap_43=101:100
|
||||
phy_chain_tx_polarity_flip_physical{101.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{102.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{103.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{104.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{101.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{102.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{103.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{104.0}=1
|
||||
phy_chain_tx_lane_map_physical{101.0}=0x1023
|
||||
phy_chain_rx_lane_map_physical{101.0}=0x3120
|
||||
|
||||
#FC 26
|
||||
portmap_44=105:100
|
||||
phy_chain_tx_polarity_flip_physical{105.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{106.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{107.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{108.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{105.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{106.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{107.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{108.0}=0
|
||||
phy_chain_tx_lane_map_physical{105.0}=0x2103
|
||||
phy_chain_rx_lane_map_physical{105.0}=0x1203
|
||||
|
||||
#FC 27
|
||||
portmap_45=109:100
|
||||
phy_chain_tx_polarity_flip_physical{109.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{110.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{111.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{112.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{109.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{110.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{111.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{112.0}=0
|
||||
phy_chain_tx_lane_map_physical{109.0}=0x3201
|
||||
phy_chain_rx_lane_map_physical{109.0}=0x0123
|
||||
|
||||
#FC 28
|
||||
portmap_46=113:100
|
||||
phy_chain_tx_polarity_flip_physical{113.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{114.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{115.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{116.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{113.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{114.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{115.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{116.0}=1
|
||||
phy_chain_tx_lane_map_physical{113.0}=0x3012
|
||||
phy_chain_rx_lane_map_physical{113.0}=0x1302
|
||||
|
||||
#FC 29
|
||||
portmap_47=117:100
|
||||
phy_chain_tx_polarity_flip_physical{117.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{118.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{119.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{120.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{117.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{118.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{119.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{120.0}=1
|
||||
phy_chain_tx_lane_map_physical{117.0}=0x0312
|
||||
phy_chain_rx_lane_map_physical{117.0}=0x0132
|
||||
|
||||
#FC 30
|
||||
portmap_48=121:100
|
||||
phy_chain_tx_polarity_flip_physical{121.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{122.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{123.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{124.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{121.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{122.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{123.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{124.0}=0
|
||||
phy_chain_tx_lane_map_physical{121.0}=0x1023
|
||||
phy_chain_rx_lane_map_physical{121.0}=0x1203
|
||||
|
||||
#FC 31
|
||||
portmap_49=125:100
|
||||
phy_chain_tx_polarity_flip_physical{125.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{126.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{127.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{128.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{125.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{126.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{127.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{128.0}=0
|
||||
phy_chain_tx_lane_map_physical{125.0}=0x1320
|
||||
phy_chain_rx_lane_map_physical{125.0}=0x2103
|
||||
|
||||
#PIPE-2
|
||||
#FC 32
|
||||
portmap_68=129:100
|
||||
phy_chain_tx_polarity_flip_physical{129.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{130.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{131.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{132.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{129.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{130.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{131.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{132.0}=1
|
||||
phy_chain_tx_lane_map_physical{129.0}=0x0321
|
||||
phy_chain_rx_lane_map_physical{129.0}=0x2310
|
||||
|
||||
#FC 33
|
||||
portmap_69=133:100
|
||||
phy_chain_tx_polarity_flip_physical{133.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{134.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{135.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{136.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{133.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{134.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{135.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{136.0}=1
|
||||
phy_chain_tx_lane_map_physical{133.0}=0x2013
|
||||
phy_chain_rx_lane_map_physical{133.0}=0x1203
|
||||
|
||||
#FC 34
|
||||
portmap_70=137:100
|
||||
phy_chain_tx_polarity_flip_physical{137.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{138.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{139.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{140.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{137.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{138.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{139.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{140.0}=0
|
||||
phy_chain_tx_lane_map_physical{137.0}=0x2301
|
||||
phy_chain_rx_lane_map_physical{137.0}=0x0213
|
||||
|
||||
#FC 35
|
||||
portmap_71=141:100
|
||||
phy_chain_tx_polarity_flip_physical{141.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{142.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{143.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{144.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{141.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{142.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{143.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{144.0}=1
|
||||
phy_chain_tx_lane_map_physical{141.0}=0x2013
|
||||
phy_chain_rx_lane_map_physical{141.0}=0x2310
|
||||
|
||||
#FC 36
|
||||
portmap_72=145:100
|
||||
phy_chain_tx_polarity_flip_physical{145.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{146.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{147.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{148.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{145.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{146.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{147.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{148.0}=1
|
||||
phy_chain_tx_lane_map_physical{145.0}=0x2310
|
||||
phy_chain_rx_lane_map_physical{145.0}=0x0231
|
||||
|
||||
#FC 37
|
||||
portmap_73=149:100
|
||||
phy_chain_tx_polarity_flip_physical{149.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{150.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{151.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{152.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{149.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{150.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{151.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{152.0}=1
|
||||
phy_chain_tx_lane_map_physical{149.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{149.0}=0x1203
|
||||
|
||||
#FC 38
|
||||
portmap_74=153:100
|
||||
phy_chain_tx_polarity_flip_physical{153.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{154.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{155.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{156.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{153.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{154.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{155.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{156.0}=0
|
||||
phy_chain_tx_lane_map_physical{153.0}=0x1230
|
||||
phy_chain_rx_lane_map_physical{153.0}=0x3120
|
||||
|
||||
#FC 39
|
||||
portmap_75=157:100
|
||||
phy_chain_tx_polarity_flip_physical{157.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{158.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{159.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{160.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{157.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{158.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{159.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{160.0}=0
|
||||
phy_chain_tx_lane_map_physical{157.0}=0x3210
|
||||
phy_chain_rx_lane_map_physical{157.0}=0x3210
|
||||
|
||||
#FC 40
|
||||
portmap_76=161:100
|
||||
phy_chain_tx_polarity_flip_physical{161.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{162.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{163.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{164.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{161.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{162.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{163.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{164.0}=1
|
||||
phy_chain_tx_lane_map_physical{161.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{161.0}=0x1032
|
||||
|
||||
#FC 41
|
||||
portmap_77=165:100
|
||||
phy_chain_tx_polarity_flip_physical{165.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{166.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{167.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{168.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{165.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{166.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{167.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{168.0}=1
|
||||
phy_chain_tx_lane_map_physical{165.0}=0x2310
|
||||
phy_chain_rx_lane_map_physical{165.0}=0x1230
|
||||
|
||||
#FC 42
|
||||
portmap_78=169:100
|
||||
phy_chain_tx_polarity_flip_physical{169.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{170.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{171.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{172.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{169.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{170.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{171.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{172.0}=0
|
||||
phy_chain_tx_lane_map_physical{169.0}=0x1302
|
||||
phy_chain_rx_lane_map_physical{169.0}=0x3210
|
||||
|
||||
#FC 43
|
||||
portmap_79=173:100
|
||||
phy_chain_tx_polarity_flip_physical{173.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{174.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{175.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{176.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{173.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{174.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{175.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{176.0}=1
|
||||
phy_chain_tx_lane_map_physical{173.0}=0x0312
|
||||
phy_chain_rx_lane_map_physical{173.0}=0x3210
|
||||
|
||||
#FC 44
|
||||
portmap_80=177:100
|
||||
phy_chain_tx_polarity_flip_physical{177.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{178.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{179.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{180.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{177.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{178.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{179.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{180.0}=1
|
||||
phy_chain_tx_lane_map_physical{177.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{177.0}=0x1302
|
||||
|
||||
#FC 45
|
||||
portmap_81=181:100
|
||||
phy_chain_tx_polarity_flip_physical{181.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{182.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{183.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{184.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{181.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{182.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{183.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{184.0}=1
|
||||
phy_chain_tx_lane_map_physical{181.0}=0x1023
|
||||
phy_chain_rx_lane_map_physical{181.0}=0x2301
|
||||
|
||||
#FC 46
|
||||
portmap_82=185:100
|
||||
phy_chain_tx_polarity_flip_physical{185.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{186.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{187.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{188.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{185.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{186.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{187.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{188.0}=0
|
||||
phy_chain_tx_lane_map_physical{185.0}=0x1320
|
||||
phy_chain_rx_lane_map_physical{185.0}=0x3210
|
||||
|
||||
#FC 47
|
||||
portmap_83=189:100
|
||||
phy_chain_tx_polarity_flip_physical{189.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{190.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{191.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{192.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{189.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{190.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{191.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{192.0}=1
|
||||
phy_chain_tx_lane_map_physical{189.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{189.0}=0x3210
|
||||
|
||||
#PIPE-3
|
||||
#FC 48
|
||||
portmap_102=193:100
|
||||
phy_chain_tx_polarity_flip_physical{193.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{194.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{195.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{196.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{193.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{194.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{195.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{196.0}=1
|
||||
phy_chain_tx_lane_map_physical{193.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{193.0}=0x1302
|
||||
|
||||
#FC 49
|
||||
portmap_103=197:100
|
||||
phy_chain_tx_polarity_flip_physical{197.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{198.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{199.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{200.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{197.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{198.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{199.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{200.0}=1
|
||||
phy_chain_tx_lane_map_physical{197.0}=0x0132
|
||||
phy_chain_rx_lane_map_physical{197.0}=0x2301
|
||||
|
||||
#FC 50
|
||||
portmap_104=201:100
|
||||
phy_chain_tx_polarity_flip_physical{201.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{202.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{203.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{204.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{201.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{202.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{203.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{204.0}=0
|
||||
phy_chain_tx_lane_map_physical{201.0}=0x2301
|
||||
phy_chain_rx_lane_map_physical{201.0}=0x1230
|
||||
|
||||
#FC 51
|
||||
portmap_105=205:100
|
||||
phy_chain_tx_polarity_flip_physical{205.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{206.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{207.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{208.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{205.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{206.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{207.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{208.0}=1
|
||||
phy_chain_tx_lane_map_physical{205.0}=0x3021
|
||||
phy_chain_rx_lane_map_physical{205.0}=0x2130
|
||||
|
||||
#FC 52
|
||||
portmap_106=209:100
|
||||
phy_chain_tx_polarity_flip_physical{209.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{210.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{211.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{212.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{209.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{210.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{211.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{212.0}=1
|
||||
phy_chain_tx_lane_map_physical{209.0}=0x2031
|
||||
phy_chain_rx_lane_map_physical{209.0}=0x3021
|
||||
|
||||
#FC 53
|
||||
portmap_107=213:100
|
||||
phy_chain_tx_polarity_flip_physical{213.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{214.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{215.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{216.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{213.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{214.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{215.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{216.0}=1
|
||||
phy_chain_tx_lane_map_physical{213.0}=0x1302
|
||||
phy_chain_rx_lane_map_physical{213.0}=0x1032
|
||||
|
||||
#FC 54
|
||||
portmap_108=217:100
|
||||
phy_chain_tx_polarity_flip_physical{217.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{218.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{219.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{220.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{217.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{218.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{219.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{220.0}=0
|
||||
phy_chain_tx_lane_map_physical{217.0}=0x2301
|
||||
phy_chain_rx_lane_map_physical{217.0}=0x1230
|
||||
|
||||
#FC 55
|
||||
portmap_109=221:100
|
||||
phy_chain_tx_polarity_flip_physical{221.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{222.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{223.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{224.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{221.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{222.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{223.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{224.0}=1
|
||||
phy_chain_tx_lane_map_physical{221.0}=0x3210
|
||||
phy_chain_rx_lane_map_physical{221.0}=0x2310
|
||||
|
||||
#FC 56
|
||||
portmap_110=225:100
|
||||
phy_chain_tx_polarity_flip_physical{225.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{226.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{227.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{228.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{225.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{226.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{227.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{228.0}=1
|
||||
phy_chain_tx_lane_map_physical{225.0}=0x3120
|
||||
phy_chain_rx_lane_map_physical{225.0}=0x3021
|
||||
|
||||
#FC 57
|
||||
portmap_111=229:100
|
||||
phy_chain_tx_polarity_flip_physical{229.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{230.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{231.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{232.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{229.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{230.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{231.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{232.0}=1
|
||||
phy_chain_tx_lane_map_physical{229.0}=0x0231
|
||||
phy_chain_rx_lane_map_physical{229.0}=0x2031
|
||||
|
||||
#FC 58
|
||||
portmap_112=233:100
|
||||
phy_chain_tx_polarity_flip_physical{233.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{234.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{235.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{236.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{233.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{234.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{235.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{236.0}=1
|
||||
phy_chain_tx_lane_map_physical{233.0}=0x1023
|
||||
phy_chain_rx_lane_map_physical{233.0}=0x1203
|
||||
|
||||
#FC 59
|
||||
portmap_113=237:100
|
||||
phy_chain_tx_polarity_flip_physical{237.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{238.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{239.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{240.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{237.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{238.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{239.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{240.0}=0
|
||||
phy_chain_tx_lane_map_physical{237.0}=0x2013
|
||||
phy_chain_rx_lane_map_physical{237.0}=0x0213
|
||||
|
||||
#FC 60
|
||||
portmap_114=241:100
|
||||
phy_chain_tx_polarity_flip_physical{241.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{242.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{243.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{244.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{241.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{242.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{243.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{244.0}=0
|
||||
phy_chain_tx_lane_map_physical{241.0}=0x1032
|
||||
phy_chain_rx_lane_map_physical{241.0}=0x2310
|
||||
|
||||
#FC 61
|
||||
portmap_115=245:100
|
||||
phy_chain_tx_polarity_flip_physical{245.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{246.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{247.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{248.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{245.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{246.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{247.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{248.0}=1
|
||||
phy_chain_tx_lane_map_physical{245.0}=0x1302
|
||||
phy_chain_rx_lane_map_physical{245.0}=0x1302
|
||||
|
||||
#FC 62
|
||||
portmap_116=249:100
|
||||
phy_chain_tx_polarity_flip_physical{249.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{250.0}=1
|
||||
phy_chain_tx_polarity_flip_physical{251.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{252.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{249.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{250.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{251.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{252.0}=0
|
||||
phy_chain_tx_lane_map_physical{249.0}=0x1032
|
||||
phy_chain_rx_lane_map_physical{249.0}=0x1203
|
||||
|
||||
#FC 63
|
||||
portmap_117=253:100
|
||||
phy_chain_tx_polarity_flip_physical{253.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{254.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{255.0}=0
|
||||
phy_chain_tx_polarity_flip_physical{256.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{253.0}=0
|
||||
phy_chain_rx_polarity_flip_physical{254.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{255.0}=1
|
||||
phy_chain_rx_polarity_flip_physical{256.0}=0
|
||||
phy_chain_tx_lane_map_physical{253.0}=0x3210
|
||||
phy_chain_rx_lane_map_physical{253.0}=0x2103
|
||||
|
||||
|
||||
|
||||
#MGMT
|
||||
portmap_66=257:10
|
||||
portmap_100=259:10
|
||||
#phy_chain_tx_lane_map_physical{257.0}=0x0123
|
||||
#phy_chain_rx_lane_map_physical{257.0}=0x0123
|
||||
|
||||
#LPBK
|
||||
portmap_33=260:10
|
||||
portmap_67=261:10
|
||||
portmap_101=262:10
|
||||
portmap_135=263:10
|
@ -1,7 +1,7 @@
|
||||
INTERVAL=10
|
||||
DEVPATH=hwmon5=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-16/16-002f hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-7/7-004d
|
||||
DEVPATH=hwmon5=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-16/16-002f hwmon2=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-7/7-004d
|
||||
DEVNAME=hwmon5=w83795adg
|
||||
FCTEMPS=hwmon5/device/pwm2=hwmon1/temp1_input
|
||||
FCTEMPS=hwmon5/device/pwm2=hwmon2/temp1_input
|
||||
FCFANS=hwmon5/device/pwm2=hwmon5/device/fan7_input hwmon5/device/pwm2=hwmon5/device/fan5_input hwmon5/device/pwm2=hwmon5/device/fan3_input hwmon5/device/pwm2=hwmon5/device/fan1_input
|
||||
MINTEMP=hwmon5/device/pwm2=20
|
||||
MAXTEMP=hwmon5/device/pwm2=60
|
||||
|
@ -10,8 +10,8 @@ chip "jc42-*"
|
||||
chip "w83795adg-*"
|
||||
ignore in0
|
||||
label in1 "P0V9"
|
||||
set in1_min 0.90 * 0.97
|
||||
set in1_max 0.90 * 1.03
|
||||
set in1_min 0.84 * 0.97
|
||||
set in1_max 0.96 * 1.03
|
||||
ignore in2
|
||||
label in3 "P1V8"
|
||||
set in3_min 1.8 * 0.97
|
||||
@ -20,8 +20,8 @@ chip "w83795adg-*"
|
||||
set in4_min 1.0 * 0.97
|
||||
set in4_max 1.0 * 1.03
|
||||
label in5 "P0V8"
|
||||
set in5_min 0.8 * 0.97
|
||||
set in5_max 0.8 * 1.03
|
||||
set in5_min 0.831 * 0.97
|
||||
set in5_max 0.831 * 1.03
|
||||
ignore in6
|
||||
ignore in7
|
||||
ignore in8
|
||||
|
@ -1,5 +1,5 @@
|
||||
INTERVAL=10
|
||||
DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-16/16-002f hwmon3=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-6/6-004e
|
||||
DEVPATH=hwmon1=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-16/16-002f hwmon3=devices/pci0000:00/0000:00:1f.3/i2c-0/i2c-6/6-004c
|
||||
DEVNAME=hwmon1=w83795adg
|
||||
FCTEMPS=hwmon1/device/pwm2=hwmon3/temp1_input
|
||||
FCFANS=hwmon1/device/pwm2=hwmon1/device/fan7_input hwmon1/device/pwm2=hwmon1/device/fan5_input hwmon1/device/pwm2=hwmon1/device/fan3_input hwmon1/device/pwm2=hwmon1/device/fan1_input
|
||||
|
@ -66,20 +66,20 @@ chip "lm75-i2c-6-4D"
|
||||
set temp1_max 50
|
||||
set temp1_max_hyst 45
|
||||
chip "lm75-i2c-6-4E"
|
||||
label temp1 "Rear MAC Temp"
|
||||
label temp1 "Right Side MB Tetmp"
|
||||
set temp1_max 50
|
||||
set temp1_max_hyst 45
|
||||
chip "lm86-i2c-6-4C"
|
||||
label temp1 "MB Temp"
|
||||
label temp1 "Front Panel Temp"
|
||||
set temp1_max 50
|
||||
label temp2 "MAC Temp"
|
||||
label temp2 "Front MAC Temp"
|
||||
set temp2_max 70
|
||||
bus "i2c-7" "i2c-0-mux (chan_id 6)"
|
||||
chip "lm75-i2c-7-4D"
|
||||
label temp1 "Front Panel Temp"
|
||||
label temp1 "Left Side MB Temp"
|
||||
set temp1_max 50
|
||||
set temp1_max_hyst 45
|
||||
chip "lm75-i2c-7-4E"
|
||||
label temp1 "Front MAC Temp"
|
||||
label temp1 "Left Side MAC Temp"
|
||||
set temp1_max 50
|
||||
set temp1_max_hyst 45
|
||||
|
@ -1,5 +1,5 @@
|
||||
BFN_INGRASYS_PLATFORM = bfnplatform-ingrasys_8.2.0_amd64.deb
|
||||
$(BFN_INGRASYS_PLATFORM)_URL = "https://github.com/Ingrasys-sonic/packages/raw/master/lib/bfnplatform-ingrasys_8.2.0_amd64.deb"
|
||||
$(BFN_INGRASYS_PLATFORM)_URL = "https://github.com/Ingrasys-sonic/packages/raw/master/lib/bfnplatform-ingrasys_8.4.0_8.5.0_amd64.deb"
|
||||
|
||||
SONIC_ONLINE_DEBS += $(BFN_INGRASYS_PLATFORM) # $(BFN_SAI_DEV)
|
||||
$(BFN_SAI_DEV)_DEPENDS += $(BFN_INGRASYS_PLATFORM)
|
||||
|
@ -15,7 +15,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
VERSION="1.0.0"
|
||||
# trun on for more debug output
|
||||
#DEBUG="on"
|
||||
|
||||
VERSION="1.1.0"
|
||||
TRUE=200
|
||||
FALSE=404
|
||||
|
||||
@ -104,10 +107,14 @@ PSU_NOT_EXIST=0
|
||||
rov_val_array=( 0.85 0.82 0.77 0.87 0.74 0.84 0.79 0.89 )
|
||||
rov_reg_array=( 0x24 0x21 0x1c 0x26 0x19 0x23 0x1e 0x28 )
|
||||
|
||||
#GPIO Offset
|
||||
GPIO_OFFSET=0
|
||||
|
||||
# Help usage function
|
||||
function _help {
|
||||
echo "========================================================="
|
||||
echo "# Description: Help Function"
|
||||
echo "# Version : ${VERSION}"
|
||||
echo "========================================================="
|
||||
echo "----------------------------------------------------"
|
||||
echo "EX : ${0} help"
|
||||
@ -130,8 +137,10 @@ function _help {
|
||||
echo " : ${0} i2c_psu_eeprom_init new|delete"
|
||||
echo " : ${0} i2c_qsfp_status_get [1-34]"
|
||||
echo " : ${0} i2c_qsfp_type_get [1-34]"
|
||||
echo " : ${0} i2c_qsfp_ddm_get [1-34]"
|
||||
echo " : ${0} i2c_board_type_get"
|
||||
echo " : ${0} i2c_psu_status"
|
||||
echo " : ${0} i2c_led_psu_status_set"
|
||||
echo " : ${0} i2c_led_fan_status_set"
|
||||
echo " : ${0} i2c_led_fan_tray_status_set"
|
||||
echo " : ${0} i2c_cpld_version"
|
||||
@ -139,6 +148,8 @@ function _help {
|
||||
echo " : ${0} i2c_test_all"
|
||||
echo " : ${0} i2c_sys_led green|amber"
|
||||
echo " : ${0} i2c_fan_led green|amber on|off"
|
||||
echo " : ${0} i2c_psu1_led green|amber"
|
||||
echo " : ${0} i2c_psu2_led green|amber"
|
||||
echo " : ${0} i2c_fan_tray_led green|amber on|off [1-4]"
|
||||
echo "----------------------------------------------------"
|
||||
}
|
||||
@ -229,11 +240,14 @@ function _i2c_init {
|
||||
_i2c_fan_speed_init
|
||||
_i2c_temp_init
|
||||
modprobe jc42
|
||||
rmmod gpio_ich
|
||||
_i2c_gpio_init
|
||||
modprobe gpio_ich
|
||||
_i2c_mb_eeprom_init "new"
|
||||
_i2c_qsfp_eeprom_init "new"
|
||||
_i2c_sfp_eeprom_init "new"
|
||||
_i2c_psu_eeprom_init "new"
|
||||
_i2c_led_psu_status_set
|
||||
_i2c_led_fan_status_set
|
||||
_i2c_led_fan_tray_status_set
|
||||
|
||||
@ -486,12 +500,28 @@ function _i2c_fan_init {
|
||||
echo "Done"
|
||||
}
|
||||
|
||||
# To set the global variable GPIO_OFFSET
|
||||
function _set_gpio_offset {
|
||||
GPIO_OFFSET=0
|
||||
for d in `ls /sys/class/gpio/ | grep gpiochip`
|
||||
do
|
||||
gpiochip_no=${d##gpiochip}
|
||||
if [ $gpiochip_no -gt 255 ]; then
|
||||
GPIO_OFFSET=256
|
||||
break
|
||||
fi
|
||||
done
|
||||
#echo "set GPIO_OFFSET=${GPIO_OFFSET}"
|
||||
}
|
||||
|
||||
#GPIO Init
|
||||
function _i2c_gpio_init {
|
||||
local i=0
|
||||
#ABS Port 0-15
|
||||
echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
for i in {240..255};
|
||||
_set_gpio_offset
|
||||
#for i in {240..255};
|
||||
for((i=${GPIO_OFFSET}+240;i<=${GPIO_OFFSET}+255;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
@ -499,7 +529,8 @@ function _i2c_gpio_init {
|
||||
|
||||
#ABS Port 16-31
|
||||
echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
for i in {224..239};
|
||||
#for i in {224..239};
|
||||
for((i=${GPIO_OFFSET}+224;i<=${GPIO_OFFSET}+239;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
@ -507,7 +538,8 @@ function _i2c_gpio_init {
|
||||
|
||||
#INT Port 0-15
|
||||
echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
for i in {208..223};
|
||||
#for i in {208..223};
|
||||
for((i=${GPIO_OFFSET}+208;i<=${GPIO_OFFSET}+223;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
@ -515,7 +547,8 @@ function _i2c_gpio_init {
|
||||
|
||||
#INT Port 16-31
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
for i in {192..207};
|
||||
#for i in {192..207};
|
||||
for((i=${GPIO_OFFSET}+192;i<=${GPIO_OFFSET}+207;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
@ -523,14 +556,31 @@ function _i2c_gpio_init {
|
||||
|
||||
#SFP+
|
||||
echo "pca9535 0x27" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
for i in {176..191};
|
||||
#for i in {176..191};
|
||||
for((i=${GPIO_OFFSET}+176;i<=${GPIO_OFFSET}+191;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
case ${i} in
|
||||
176|177|178|179|182|183|188|189|190|191)
|
||||
#176|177|178|179|182|183|188|189|190|191)
|
||||
$((${GPIO_OFFSET}+176)) | \
|
||||
$((${GPIO_OFFSET}+177)) | \
|
||||
$((${GPIO_OFFSET}+178)) | \
|
||||
$((${GPIO_OFFSET}+179)) | \
|
||||
$((${GPIO_OFFSET}+182)) | \
|
||||
$((${GPIO_OFFSET}+183)) | \
|
||||
$((${GPIO_OFFSET}+188)) | \
|
||||
$((${GPIO_OFFSET}+189)) | \
|
||||
$((${GPIO_OFFSET}+190)) | \
|
||||
$((${GPIO_OFFSET}+191)) )
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
;;
|
||||
180|181|184|185|186|187)
|
||||
#180|181|184|185|186|187)
|
||||
$((${GPIO_OFFSET}+180)) | \
|
||||
$((${GPIO_OFFSET}+181)) | \
|
||||
$((${GPIO_OFFSET}+184)) | \
|
||||
$((${GPIO_OFFSET}+185)) | \
|
||||
$((${GPIO_OFFSET}+186)) | \
|
||||
$((${GPIO_OFFSET}+187)) )
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
;;
|
||||
esac
|
||||
@ -571,7 +621,8 @@ function _i2c_gpio_init {
|
||||
|
||||
#LP Mode Port 0-15
|
||||
echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
for i in {160..175};
|
||||
#for i in {160..175};
|
||||
for((i=${GPIO_OFFSET}+160;i<=${GPIO_OFFSET}+175;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
@ -579,7 +630,8 @@ function _i2c_gpio_init {
|
||||
|
||||
#LP Mode Port 16-31
|
||||
echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
for i in {144..159};
|
||||
#for i in {144..159};
|
||||
for((i=${GPIO_OFFSET}+144;i<=${GPIO_OFFSET}+159;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
@ -587,34 +639,52 @@ function _i2c_gpio_init {
|
||||
|
||||
#RST Port 0-15
|
||||
echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
for i in {128..143};
|
||||
#for i in {128..143};
|
||||
for((i=${GPIO_OFFSET}+128;i<=${GPIO_OFFSET}+143;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
echo low > /sys/class/gpio/gpio${i}/direction
|
||||
#echo out > /sys/class/gpio/gpio${i}/direction
|
||||
#echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
done
|
||||
|
||||
#RST Port 16-31
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
for i in {112..127};
|
||||
#for i in {112..127};
|
||||
for((i=${GPIO_OFFSET}+112;i<=${GPIO_OFFSET}+127;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
echo low > /sys/class/gpio/gpio${i}/direction
|
||||
#echo out > /sys/class/gpio/gpio${i}/direction
|
||||
#echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
done
|
||||
|
||||
#PSU I/O on Dummy Board 0x25
|
||||
echo "pca9535 0x25" > /sys/bus/i2c/devices/i2c-${NUM_I801_DEVICE}/new_device
|
||||
for i in {96..111};
|
||||
#for i in {96..111};
|
||||
for((i=${GPIO_OFFSET}+96;i<=${GPIO_OFFSET}+111;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
case ${i} in
|
||||
97|98|100|101|102|105|106|108)
|
||||
#97|98|100|101|102|105|106|108)
|
||||
$((${GPIO_OFFSET}+97)) | \
|
||||
$((${GPIO_OFFSET}+98)) | \
|
||||
$((${GPIO_OFFSET}+100)) | \
|
||||
$((${GPIO_OFFSET}+101)) | \
|
||||
$((${GPIO_OFFSET}+102)) | \
|
||||
$((${GPIO_OFFSET}+105)) | \
|
||||
$((${GPIO_OFFSET}+106)) | \
|
||||
$((${GPIO_OFFSET}+108)) )
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
;;
|
||||
98|101|106|107|108)
|
||||
#98|101|106|107|108)
|
||||
$((${GPIO_OFFSET}+98)) | \
|
||||
$((${GPIO_OFFSET}+101)) | \
|
||||
$((${GPIO_OFFSET}+106)) | \
|
||||
$((${GPIO_OFFSET}+107)) | \
|
||||
$((${GPIO_OFFSET}+108)) )
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
;;
|
||||
esac
|
||||
@ -623,6 +693,12 @@ function _i2c_gpio_init {
|
||||
|
||||
#GPIO DeInit
|
||||
function _i2c_gpio_deinit {
|
||||
for((i=${GPIO_OFFSET}+96;i<=${GPIO_OFFSET}+255;i++));
|
||||
do
|
||||
if [ -e "/sys/class/gpio/gpio${i}" ]; then
|
||||
echo ${i} > /sys/class/gpio/unexport
|
||||
fi
|
||||
done
|
||||
echo "0x20" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/delete_device
|
||||
echo "0x21" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/delete_device
|
||||
echo "0x22" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/delete_device
|
||||
@ -814,43 +890,50 @@ function _qsfp_port_i2c_var_set {
|
||||
regAddr=0x20
|
||||
dataAddr=0
|
||||
eeprombusbase=${NUM_MUX3_CHAN0_DEVICE}
|
||||
gpioBase=240
|
||||
gpioBase=$((${GPIO_OFFSET}+240))
|
||||
#gpioBase=240
|
||||
;;
|
||||
9|10|11|12|13|14|15|16)
|
||||
i2cbus=${NUM_MUX1_CHAN4_DEVICE}
|
||||
regAddr=0x20
|
||||
dataAddr=1
|
||||
eeprombusbase=${NUM_MUX4_CHAN0_DEVICE}
|
||||
gpioBase=240
|
||||
gpioBase=$((${GPIO_OFFSET}+240))
|
||||
#gpioBase=240
|
||||
;;
|
||||
17|18|19|20|21|22|23|24)
|
||||
i2cbus=${NUM_MUX1_CHAN4_DEVICE}
|
||||
regAddr=0x21
|
||||
dataAddr=0
|
||||
eeprombusbase=${NUM_MUX5_CHAN0_DEVICE}
|
||||
gpioBase=$((224 - 16))
|
||||
gpioBase=$((${GPIO_OFFSET}+224-16))
|
||||
#gpioBase=$((224 - 16))
|
||||
;;
|
||||
25|26|27|28|29|30|31|32)
|
||||
i2cbus=${NUM_MUX1_CHAN4_DEVICE}
|
||||
regAddr=0x21
|
||||
dataAddr=1
|
||||
eeprombusbase=${NUM_MUX6_CHAN0_DEVICE}
|
||||
gpioBase=$((224 - 16))
|
||||
gpioBase=$((${GPIO_OFFSET}+224-16))
|
||||
#gpioBase=$((224 - 16))
|
||||
;;
|
||||
33)
|
||||
i2cbus=${NUM_MUX1_CHAN7_DEVICE}
|
||||
regAddr=0x27
|
||||
dataAddr=0
|
||||
gpioBase=145
|
||||
gpioBase=$((${GPIO_OFFSET}+145))
|
||||
#gpioBase=145
|
||||
;;
|
||||
34)
|
||||
i2cbus=${NUM_MUX1_CHAN7_DEVICE}
|
||||
regAddr=0x27
|
||||
dataAddr=1
|
||||
gpioBase=143
|
||||
gpioBase=$((${GPIO_OFFSET}+143))
|
||||
#gpioBase=143
|
||||
;;
|
||||
*)
|
||||
echo "Please input 1~34"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -1046,8 +1129,10 @@ function _i2c_sfp_eeprom_init {
|
||||
if [ "${action}" == "new" ] && \
|
||||
! [ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP1_DEVICE}-0050 ] && \
|
||||
! [ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP2_DEVICE}-0050 ]; then
|
||||
echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device
|
||||
echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device
|
||||
#echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device
|
||||
#echo "sff8436 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device
|
||||
echo "optoe1 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP1_DEVICE}/new_device
|
||||
echo "optoe1 0x50" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_SFP2_DEVICE}/new_device
|
||||
elif [ "${action}" == "delete" ] && \
|
||||
[ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP1_DEVICE}-0050 ] && \
|
||||
[ -L ${PATH_SYS_I2C_DEVICES}/${NUM_SFP2_DEVICE}-0050 ]; then
|
||||
@ -1097,7 +1182,10 @@ function _i2c_qsfp_type_get {
|
||||
_qsfp_eeprom_var_set ${QSFP_PORT}
|
||||
|
||||
#Get QSFP EEPROM info
|
||||
qsfp_info=$(base64 ${PATH_SYS_I2C_DEVICES}/$eeprombus-$(printf "%04x" $eepromAddr)/eeprom)
|
||||
local size=255
|
||||
eeprom_path="${PATH_SYS_I2C_DEVICES}/$eeprombus-$(printf "%04x" $eepromAddr)/eeprom"
|
||||
#echo "get ${eeprom_path}"
|
||||
qsfp_info=$(dd if=${eeprom_path} bs=${size} count=1 2>/dev/null | base64)
|
||||
|
||||
identifier=$(echo $qsfp_info | base64 -d -i | hexdump -s 128 -n 1 -e '"%x"')
|
||||
connector=$(echo $qsfp_info | base64 -d -i | hexdump -s 130 -n 1 -e '"%x"')
|
||||
@ -1182,6 +1270,7 @@ function _i2c_port_led_set {
|
||||
;;
|
||||
*)
|
||||
echo "Please input 1~34"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -1251,12 +1340,12 @@ function _i2c_psu_eeprom_get {
|
||||
function _i2c_sys_led {
|
||||
|
||||
if [ "${COLOR_SYS_LED}" == "green" ]; then
|
||||
# set sys_led_g (0.7) = 1
|
||||
# set sys_led_g (0.0) = 1
|
||||
output_reg=2
|
||||
mask=0x01
|
||||
value=0x01
|
||||
elif [ "${COLOR_SYS_LED}" == "amber" ]; then
|
||||
# set sys_led_g (0.7) = 0
|
||||
# set sys_led_g (0.0) = 0
|
||||
output_reg=2
|
||||
mask=0x01
|
||||
value=0x00
|
||||
@ -1353,24 +1442,186 @@ function _i2c_fan_led {
|
||||
echo "done..."
|
||||
}
|
||||
|
||||
#Set PSU1 LED
|
||||
function _i2c_psu1_led {
|
||||
local value=0
|
||||
local mask=8
|
||||
|
||||
if [ "${COLOR_SYS_LED}" == "green" ]; then
|
||||
value=0x00
|
||||
elif [ "${COLOR_SYS_LED}" == "amber" ]; then
|
||||
value=0xFF
|
||||
else
|
||||
echo "Invalid Parameters ${COLOR_SYS_LED}, Exit!!!"
|
||||
_help
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
i2cset -m ${mask} -y -r ${NUM_MAIN_MUX_CHAN1_DEVICE} 0x75 2 ${value}
|
||||
}
|
||||
|
||||
#Set PSU2 LED
|
||||
function _i2c_psu2_led {
|
||||
local value=0
|
||||
local mask=16
|
||||
|
||||
if [ "${COLOR_SYS_LED}" == "green" ]; then
|
||||
value=0x00
|
||||
elif [ "${COLOR_SYS_LED}" == "amber" ]; then
|
||||
value=0xFF
|
||||
else
|
||||
echo "Invalid Parameters ${COLOR_SYS_LED}, Exit!!!"
|
||||
_help
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
i2cset -m ${mask} -y -r ${NUM_MAIN_MUX_CHAN1_DEVICE} 0x75 2 ${value}
|
||||
}
|
||||
|
||||
#Get PSU Status
|
||||
function _i2c_psu_status {
|
||||
psu2PwGood=`cat /sys/class/gpio/gpio96/value` # PSU0_PWROK (0.0)
|
||||
psu2Exist=`cat /sys/class/gpio/gpio97/value` # PSU0_PRSNT_L (0.1)
|
||||
psu1_pwgood_gpio=$((${GPIO_OFFSET}+99))
|
||||
psu1_exist_gpio=$((${GPIO_OFFSET}+100))
|
||||
psu2_pwdgood_gpio=$((${GPIO_OFFSET}+96))
|
||||
psu2_exist_gpio=$((${GPIO_OFFSET}+97))
|
||||
|
||||
psu1PwGood=`cat /sys/class/gpio/gpio99/value` # PSU1_PWROK (0.3)
|
||||
psu1Exist=`cat /sys/class/gpio/gpio100/value` # PSU1_PRSNT_L (0.4)
|
||||
psu2PwGood=`cat /sys/class/gpio/gpio${psu2_pwdgood_gpio}/value` # PSU0_PWROK (0.0)
|
||||
psu2Exist=`cat /sys/class/gpio/gpio${psu2_exist_gpio}/value` # PSU0_PRSNT_L (0.1)
|
||||
|
||||
psu1PwGood=`cat /sys/class/gpio/gpio${psu1_pwgood_gpio}/value` # PSU1_PWROK (0.3)
|
||||
psu1Exist=`cat /sys/class/gpio/gpio${psu1_exist_gpio}/value` # PSU1_PRSNT_L (0.4)
|
||||
printf "PSU1 Exist:%d PSU1 PW Good:%d\n" $psu1Exist $psu1PwGood
|
||||
printf "PSU2 Exist:%d PSU2 PW Good:%d\n" $psu2Exist $psu2PwGood
|
||||
}
|
||||
|
||||
# util function to get logx value
|
||||
function logx {
|
||||
v=$1
|
||||
n=$2
|
||||
logx_res=$(echo "${v} ${n}" | awk '{printf "%f\n",log($1)/log($2)}')
|
||||
}
|
||||
|
||||
#Set PSU LED on LED Board
|
||||
function _i2c_led_psu_status_set {
|
||||
|
||||
echo "========================================================="
|
||||
echo "# Description: PSU LED Status Setup"
|
||||
echo "========================================================="
|
||||
|
||||
#Get PSU Status
|
||||
_i2c_psu_status
|
||||
|
||||
#PSU1 Status
|
||||
echo "------------------------------"
|
||||
if [ "${psu1Exist}" == ${PSU_EXIST} ]; then
|
||||
if [ "${psu1PwGood}" == ${PSU_DC_ON} ]; then
|
||||
COLOR_SYS_LED="green"
|
||||
_i2c_psu1_led
|
||||
else
|
||||
COLOR_SYS_LED="amber"
|
||||
_i2c_psu1_led
|
||||
fi
|
||||
else
|
||||
COLOR_SYS_LED="amber"
|
||||
_i2c_psu1_led
|
||||
fi
|
||||
echo "set [PSU1 LED] = ${COLOR_SYS_LED}"
|
||||
|
||||
#PSU2 Status
|
||||
echo "------------------------------"
|
||||
if [ "${psu2Exist}" == ${PSU_EXIST} ]; then
|
||||
if [ "${psu2PwGood}" == ${PSU_DC_ON} ]; then
|
||||
COLOR_SYS_LED="green"
|
||||
_i2c_psu2_led
|
||||
else
|
||||
COLOR_SYS_LED="amber"
|
||||
#ONOFF_LED="on"
|
||||
_i2c_psu2_led
|
||||
fi
|
||||
else
|
||||
COLOR_SYS_LED="amber"
|
||||
_i2c_psu2_led
|
||||
fi
|
||||
echo "set [PSU2 LED] = ${COLOR_SYS_LED}"
|
||||
}
|
||||
|
||||
# get qsfp ddm data
|
||||
function _i2c_qsfp_ddm_get {
|
||||
|
||||
_qsfp_port_i2c_var_set ${QSFP_PORT}
|
||||
|
||||
# check if port presence
|
||||
#status: 0 -> Down, 1 -> Up
|
||||
status=`cat /sys/class/gpio/gpio$(( $(($gpioBase + (${QSFP_PORT} - 1) ^ 1)) ))/value`
|
||||
if [ "${status}" == "0" ]; then
|
||||
echo "port ${QSFP_PORT} not presence"
|
||||
return
|
||||
fi
|
||||
|
||||
_qsfp_eeprom_var_set ${QSFP_PORT}
|
||||
|
||||
# Get QSFP EEPROM info
|
||||
# only need first 128 bytes (page0) for ddm parsing
|
||||
local size=128
|
||||
eeprom_path="${PATH_SYS_I2C_DEVICES}/$eeprombus-$(printf "%04x" $eepromAddr)/eeprom"
|
||||
#echo "get ${eeprom_path}"
|
||||
qsfp_info=$(dd if=${eeprom_path} bs=${size} count=1 2>/dev/null | base64)
|
||||
|
||||
# temperature
|
||||
temp_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s 22 -n 1 -e '"%d"')
|
||||
temp_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s 23 -n 1 -e '"%d"')
|
||||
temp=$(echo "$temp_val1 $temp_val2" | awk '{printf "%f\n", $1 + $2/256.0}')
|
||||
#temp=$(( ${temp_val1} + ${temp_val2}/256.0 ))
|
||||
echo "temp=$temp"
|
||||
# voltage
|
||||
volt_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s 26 -n 1 -e '"%d"')
|
||||
volt_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s 27 -n 1 -e '"%d"')
|
||||
#volt=$(((($volt_val1 << 8) | volt_val2) / 10000))
|
||||
volt_val3=$(( ($volt_val1 << 8) | $volt_val2 ))
|
||||
volt=$(echo "$volt_val3" | awk '{printf "%f\n", $1/10000.0}')
|
||||
echo "volt=$volt"
|
||||
|
||||
# 4 channels
|
||||
for i in {0..3};
|
||||
do
|
||||
echo "channel $i:"
|
||||
# txBias
|
||||
offset=$(( 42 + $i*2 ))
|
||||
txBias_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
offset=$(( 43 + $i*2 ))
|
||||
txBias_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
txBias_val3=$(( ($txBias_val1 << 8) | $txBias_val2 ))
|
||||
txBias=$(echo "$txBias_val3" | awk '{printf "%f\n", (131.0*$1)/65535}')
|
||||
echo " txBias=$txBias"
|
||||
# txPower
|
||||
offset=$(( 50 + $i*2 ))
|
||||
txPower_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
offset=$(( 51 + $i*2 ))
|
||||
txPower_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
txPower_val3=$(( ($txPower_val1 << 8) | $txPower_val2 ))
|
||||
txPower_val4=$(echo "$txPower_val3" | awk '{printf "%f\n", $1*0.0001}')
|
||||
logx $txPower_val4 10
|
||||
txPower=$(echo "$logx_res" | awk '{printf "%f\n", $1*10}')
|
||||
echo " txPower=$txPower"
|
||||
# rxPower
|
||||
offset=$(( 34 + $i*2 ))
|
||||
rxPower_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
offset=$(( 35 + $i*2 ))
|
||||
rxPower_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
rxPower_val3=$(( ($rxPower_val1 << 8) | $rxPower_val2 ))
|
||||
rxPower_val4=$(echo "$rxPower_val3" | awk '{printf "%f\n", $1*0.0001}')
|
||||
logx $rxPower_val4 10
|
||||
rxPower=$(echo "$logx_res" | awk '{printf "%f\n", $1*10}')
|
||||
echo " rxPower=$rxPower"
|
||||
done
|
||||
}
|
||||
|
||||
#Main Function
|
||||
function _main {
|
||||
start_time_str=`date`
|
||||
start_time_sec=$(date +%s)
|
||||
|
||||
_set_gpio_offset
|
||||
if [ "${EXEC_FUNC}" == "help" ]; then
|
||||
_help
|
||||
elif [ "${EXEC_FUNC}" == "i2c_init" ]; then
|
||||
@ -1411,6 +1662,10 @@ function _main {
|
||||
_i2c_qsfp_status_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_qsfp_type_get" ]; then
|
||||
_i2c_qsfp_type_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_led_psu_status_set" ]; then
|
||||
_i2c_led_psu_status_set
|
||||
elif [ "${EXEC_FUNC}" == "i2c_qsfp_ddm_get" ]; then
|
||||
_i2c_qsfp_ddm_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_led_fan_status_set" ]; then
|
||||
_i2c_led_fan_status_set
|
||||
elif [ "${EXEC_FUNC}" == "i2c_led_fan_tray_status_set" ]; then
|
||||
@ -1421,6 +1676,10 @@ function _main {
|
||||
_i2c_fan_led
|
||||
elif [ "${EXEC_FUNC}" == "i2c_fan_tray_led" ]; then
|
||||
_i2c_fan_tray_led
|
||||
elif [ "${EXEC_FUNC}" == "i2c_psu1_led" ]; then
|
||||
_i2c_psu1_led
|
||||
elif [ "${EXEC_FUNC}" == "i2c_psu2_led" ]; then
|
||||
_i2c_psu2_led
|
||||
elif [ "${EXEC_FUNC}" == "i2c_board_type_get" ]; then
|
||||
_i2c_board_type_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_cpld_version" ]; then
|
||||
@ -1446,6 +1705,8 @@ function _main {
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" == "on" ]; then
|
||||
echo "-----------------------------------------------------"
|
||||
end_time_str=`date`
|
||||
end_time_sec=$(date +%s)
|
||||
diff_time=$[ ${end_time_sec} - ${start_time_sec} ]
|
||||
@ -1454,6 +1715,7 @@ function _main {
|
||||
echo "Total Execution Time: ${diff_time} sec"
|
||||
|
||||
echo "done!!!"
|
||||
fi
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -322,6 +322,7 @@ function _help {
|
||||
echo " : ${0} i2c_sfp_status_get [${MIN_SFP_PORT_NUM}-${MAX_SFP_PORT_NUM}]"
|
||||
echo " : ${0} i2c_qsfp_type_get [${MIN_QSFP_PORT_NUM}-${MAX_QSFP_PORT_NUM}]"
|
||||
echo " : ${0} i2c_sfp_type_get [${MIN_SFP_PORT_NUM}-${MAX_SFP_PORT_NUM}]"
|
||||
echo " : ${0} i2c_qsfp_ddm_get [${MIN_QSFP_PORT_NUM}-${MAX_QSFP_PORT_NUM}]"
|
||||
echo " : ${0} i2c_board_type_get"
|
||||
echo " : ${0} i2c_bmc_board_type_get"
|
||||
echo " : ${0} i2c_cpld_version"
|
||||
@ -945,7 +946,7 @@ function _i2c_led_test {
|
||||
|
||||
#Turn OFF All LED (can't trun off system led)
|
||||
COLOR_LED="off"
|
||||
_i2c_sys_led
|
||||
#_i2c_sys_led
|
||||
_i2c_fan_led
|
||||
_i2c_psu1_led
|
||||
_i2c_psu2_led
|
||||
@ -962,7 +963,6 @@ function _qsfp_cpld_var_set {
|
||||
local reg_port_base
|
||||
local reg_port_shift
|
||||
|
||||
echo "_qsfp_cpld_var_set port=$port"
|
||||
if [[ $1 -le 12 && $1 -ge 1 ]]; then
|
||||
cpld_index=1
|
||||
reg_port_base=0
|
||||
@ -1068,7 +1068,7 @@ function _i2c_qsfp_eeprom_get {
|
||||
local phy_port=0
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check ${QSFP_PORT} ${MIN_QSFP_PORT_NUM} ${MAX_QSFP_PORT_NUM}
|
||||
_util_input_check "${QSFP_PORT}" "${MIN_QSFP_PORT_NUM}" "${MAX_QSFP_PORT_NUM}"
|
||||
|
||||
#get physical port
|
||||
phy_port=$(_port_fp2phy $QSFP_PORT)
|
||||
@ -1112,8 +1112,8 @@ function _i2c_qsfp_eeprom_init {
|
||||
|
||||
if [ "${action}" == "new" ] && \
|
||||
! [ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then
|
||||
echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
#echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
#echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
elif [ "${action}" == "delete" ] && \
|
||||
[ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then
|
||||
echo "$eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/delete_device
|
||||
@ -1126,7 +1126,7 @@ function _i2c_qsfp_eeprom_init {
|
||||
function _i2c_sfp_eeprom_get {
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check ${SFP_PORT} ${MIN_SFP_PORT_NUM} ${MAX_SFP_PORT_NUM}
|
||||
_util_input_check "${SFP_PORT}" "${MIN_SFP_PORT_NUM}" "${MAX_SFP_PORT_NUM}"
|
||||
_util_get_sfp_pres
|
||||
|
||||
if [ $status = 0 ]; then
|
||||
@ -1160,8 +1160,8 @@ function _i2c_sfp_eeprom_init {
|
||||
|
||||
if [ "${action}" == "new" ] && \
|
||||
! [ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then
|
||||
echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
#echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
#echo "sff8436 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
echo "optoe1 $eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/new_device
|
||||
elif [ "${action}" == "delete" ] && \
|
||||
[ -L ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr) ]; then
|
||||
echo "$eepromAddr" > ${PATH_SYS_I2C_DEVICES}/i2c-$eepromBus/delete_device
|
||||
@ -1242,7 +1242,7 @@ function _i2c_psu_deinit {
|
||||
function _i2c_qsfp_status_get {
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check ${QSFP_PORT} ${MIN_QSFP_PORT_NUM} ${MAX_QSFP_PORT_NUM}
|
||||
_util_input_check "${QSFP_PORT}" "${MIN_QSFP_PORT_NUM}" "${MAX_QSFP_PORT_NUM}"
|
||||
|
||||
local stat
|
||||
_util_get_qsfp_abs
|
||||
@ -1256,12 +1256,15 @@ function _i2c_qsfp_type_get {
|
||||
phy_port=$(_port_fp2phy ${QSFP_PORT})
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check ${QSFP_PORT} ${MIN_QSFP_PORT_NUM} ${MAX_QSFP_PORT_NUM}
|
||||
_util_input_check "${QSFP_PORT}" "${MIN_QSFP_PORT_NUM}" "${MAX_QSFP_PORT_NUM}"
|
||||
|
||||
_qsfp_eeprom_var_set ${phy_port}
|
||||
|
||||
#Get QSFP EEPROM info
|
||||
qsfp_info=$(base64 ${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr)/eeprom)
|
||||
local size=255
|
||||
eeprom_path="${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr)/eeprom"
|
||||
#echo "get ${eeprom_path}"
|
||||
qsfp_info=$(dd if=${eeprom_path} bs=${size} count=1 2>/dev/null | base64)
|
||||
|
||||
identifier=$(echo $qsfp_info | base64 -d -i | hexdump -s 128 -n 1 -e '"%x"')
|
||||
connector=$(echo $qsfp_info | base64 -d -i | hexdump -s 130 -n 1 -e '"%x"')
|
||||
@ -1275,7 +1278,7 @@ function _i2c_qsfp_type_get {
|
||||
function _i2c_sfp_status_get {
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check ${SFP_PORT} ${MIN_SFP_PORT_NUM} ${MAX_SFP_PORT_NUM}
|
||||
_util_input_check "${SFP_PORT}" "${MIN_SFP_PORT_NUM}" "${MAX_SFP_PORT_NUM}"
|
||||
|
||||
local stat
|
||||
_util_get_sfp_pres
|
||||
@ -1292,7 +1295,7 @@ function _i2c_sfp_status_get {
|
||||
function _i2c_sfp_type_get {
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check ${SFP_PORT} ${MIN_SFP_PORT_NUM} ${MAX_SFP_PORT_NUM}
|
||||
_util_input_check "${SFP_PORT}" "${MIN_SFP_PORT_NUM}" "${MAX_SFP_PORT_NUM}"
|
||||
|
||||
_sfp_eeprom_var_set ${SFP_PORT}
|
||||
|
||||
@ -1653,8 +1656,6 @@ function _i2c_cpld_reg_read {
|
||||
|
||||
reg_file_path="${PATH_SYS_I2C_DEVICES}/${cpld_i2c_bus}-$(printf "%04x" ${cpld_i2c_addr})/${file_name}"
|
||||
cpld_reg_val=`cat ${reg_file_path}`
|
||||
# TODO: debug
|
||||
echo "cat ${reg_file_path} => ${cpld_reg_val}"
|
||||
}
|
||||
|
||||
#util functions
|
||||
@ -1688,7 +1689,6 @@ function _util_get_qsfp_abs {
|
||||
#get physical port
|
||||
phy_port=$(_port_fp2phy $QSFP_PORT)
|
||||
|
||||
echo "fp port $QSFP_PORT => phy port $phy_port"
|
||||
# read status from cpld
|
||||
_qsfp_cpld_var_set ${phy_port}
|
||||
cpld_reg_file_name="${CPLD_QSFP_STATUS_KEY}_${cpld_port_index}"
|
||||
@ -1743,6 +1743,88 @@ function _config_rmem {
|
||||
echo "109430400" > /proc/sys/net/core/rmem_max
|
||||
}
|
||||
|
||||
# util function to get logx value
|
||||
function logx {
|
||||
v=$1
|
||||
n=$2
|
||||
logx_res=$(echo "${v} ${n}" | awk '{printf "%f\n",log($1)/log($2)}')
|
||||
}
|
||||
|
||||
# get qsfp ddm data
|
||||
function _i2c_qsfp_ddm_get {
|
||||
local phy_port=0
|
||||
|
||||
phy_port=$(_port_fp2phy ${QSFP_PORT})
|
||||
|
||||
# input parameter validation
|
||||
_util_input_check "${QSFP_PORT}" "${MIN_QSFP_PORT_NUM}" "${MAX_QSFP_PORT_NUM}"
|
||||
|
||||
# check if port presence
|
||||
#status: 0 -> Down, 1 -> Up
|
||||
_util_get_qsfp_abs
|
||||
if [ "${status}" == "0" ]; then
|
||||
echo "port ${QSFP_PORT} not presence"
|
||||
return
|
||||
fi
|
||||
|
||||
_qsfp_eeprom_var_set ${phy_port}
|
||||
|
||||
# Get QSFP EEPROM info
|
||||
# only need first 128 bytes (page0) for ddm parsing
|
||||
local size=128
|
||||
eeprom_path="${PATH_SYS_I2C_DEVICES}/$eepromBus-$(printf "%04x" $eepromAddr)/eeprom"
|
||||
#echo "get ${eeprom_path}"
|
||||
qsfp_info=$(dd if=${eeprom_path} bs=${size} count=1 2>/dev/null | base64)
|
||||
|
||||
# temperature
|
||||
temp_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s 22 -n 1 -e '"%d"')
|
||||
temp_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s 23 -n 1 -e '"%d"')
|
||||
temp=$(echo "$temp_val1 $temp_val2" | awk '{printf "%f\n", $1 + $2/256.0}')
|
||||
#temp=$(( ${temp_val1} + ${temp_val2}/256.0 ))
|
||||
echo "temp=$temp"
|
||||
# voltage
|
||||
volt_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s 26 -n 1 -e '"%d"')
|
||||
volt_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s 27 -n 1 -e '"%d"')
|
||||
#volt=$(((($volt_val1 << 8) | volt_val2) / 10000))
|
||||
volt_val3=$(( ($volt_val1 << 8) | $volt_val2 ))
|
||||
volt=$(echo "$volt_val3" | awk '{printf "%f\n", $1/10000.0}')
|
||||
echo "volt=$volt"
|
||||
|
||||
# 4 channels
|
||||
for i in {0..3};
|
||||
do
|
||||
echo "channel $i:"
|
||||
# txBias
|
||||
offset=$(( 42 + $i*2 ))
|
||||
txBias_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
offset=$(( 43 + $i*2 ))
|
||||
txBias_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
txBias_val3=$(( ($txBias_val1 << 8) | $txBias_val2 ))
|
||||
txBias=$(echo "$txBias_val3" | awk '{printf "%f\n", (131.0*$1)/65535}')
|
||||
echo " txBias=$txBias"
|
||||
# txPower
|
||||
offset=$(( 50 + $i*2 ))
|
||||
txPower_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
offset=$(( 51 + $i*2 ))
|
||||
txPower_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
txPower_val3=$(( ($txPower_val1 << 8) | $txPower_val2 ))
|
||||
txPower_val4=$(echo "$txPower_val3" | awk '{printf "%f\n", $1*0.0001}')
|
||||
logx $txPower_val4 10
|
||||
txPower=$(echo "$logx_res" | awk '{printf "%f\n", $1*10}')
|
||||
echo " txPower=$txPower"
|
||||
# rxPower
|
||||
offset=$(( 34 + $i*2 ))
|
||||
rxPower_val1=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
offset=$(( 35 + $i*2 ))
|
||||
rxPower_val2=$(echo $qsfp_info | base64 -d -i | hexdump -s $offset -n 1 -e '"%d"')
|
||||
rxPower_val3=$(( ($rxPower_val1 << 8) | $rxPower_val2 ))
|
||||
rxPower_val4=$(echo "$rxPower_val3" | awk '{printf "%f\n", $1*0.0001}')
|
||||
logx $rxPower_val4 10
|
||||
rxPower=$(echo "$logx_res" | awk '{printf "%f\n", $1*10}')
|
||||
echo " rxPower=$rxPower"
|
||||
done
|
||||
}
|
||||
|
||||
#Main Function
|
||||
function _main {
|
||||
tart_time_str=`date`
|
||||
@ -1788,6 +1870,8 @@ function _main {
|
||||
_i2c_qsfp_type_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_sfp_type_get" ]; then
|
||||
_i2c_sfp_type_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_qsfp_ddm_get" ]; then
|
||||
_i2c_qsfp_ddm_get
|
||||
elif [ "${EXEC_FUNC}" == "i2c_led_psu_status_set" ]; then
|
||||
_i2c_led_psu_status_set
|
||||
elif [ "${EXEC_FUNC}" == "i2c_led_fan_status_set" ]; then
|
||||
|
@ -1,13 +1,4 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
export INSTALL_MOD_DIR:=extra
|
||||
|
||||
@ -24,57 +15,28 @@ CONF_DIR := conf
|
||||
%:
|
||||
dh $@ --with systemd
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean
|
||||
|
||||
build:
|
||||
#make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC)
|
||||
override_dh_auto_build:
|
||||
(for mod in $(MODULE_DIRS); do \
|
||||
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
||||
done)
|
||||
|
||||
binary: binary-arch binary-indep
|
||||
# Nothing to do
|
||||
|
||||
binary-arch:
|
||||
# Nothing to do
|
||||
|
||||
#install: build
|
||||
#dh_testdir
|
||||
#dh_testroot
|
||||
#dh_clean -k
|
||||
#dh_installdirs
|
||||
|
||||
binary-indep:
|
||||
dh_testdir
|
||||
dh_installdirs
|
||||
|
||||
# Custom package commands
|
||||
override_dh_auto_install:
|
||||
(for mod in $(MODULE_DIRS); do \
|
||||
mkdir debian/tmp/usr/sbin -p; \
|
||||
mkdir debian/tmp/lib/systemd/system -p; \
|
||||
mkdir debian/tmp/etc -p; \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/*.sh debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/sbin/; \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} \
|
||||
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko \
|
||||
debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/sbin; \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/*.sh \
|
||||
debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/sbin; \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service \
|
||||
debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system; \
|
||||
done)
|
||||
# Resuming debhelper scripts
|
||||
dh_testroot
|
||||
dh_install
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_systemd_enable
|
||||
dh_installinit
|
||||
dh_systemd_start
|
||||
dh_link
|
||||
dh_fixperms
|
||||
dh_compress
|
||||
dh_strip
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
.PHONY: build binary binary-arch binary-indep clean
|
||||
|
||||
override_dh_clean:
|
||||
dh_clean
|
||||
(for mod in $(MODULE_DIRS); do \
|
||||
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
|
||||
done)
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
usr/sbin
|
||||
lib/systemd/system
|
||||
etc/
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S8810-32Q board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils.sh i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s8810-32q.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
lib/systemd/
|
||||
usr/sbin/
|
||||
etc/
|
@ -1,43 +0,0 @@
|
||||
# Automatically added by dh_systemd_enable
|
||||
# This will only remove masks created by d-s-h on package removal.
|
||||
deb-systemd-helper unmask s8810-32q-monitor.service >/dev/null || true
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null || true
|
||||
# Generate kernel modules.dep and map files for add eeprom_mb.
|
||||
depmod -a || true
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled s8810-32q-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable s8810-32q-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state s8810-32q-monitor.service >/dev/null || true
|
||||
fi
|
||||
if deb-systemd-helper --quiet was-enabled qsfp-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable qsfp-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s8810-32q-monitor" ]; then
|
||||
update-rc.d s8810-32q-monitor defaults >/dev/null
|
||||
invoke-rc.d s8810-32q-monitor start || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
update-rc.d qsfp-monitor defaults >/dev/null
|
||||
invoke-rc.d qsfp-monitor start || exit $?
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
deb-systemd-invoke start s8810-32q-monitor.service >/dev/null || true
|
||||
deb-systemd-invoke start qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
@ -1,38 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ "$1" = "purge" ] ; then
|
||||
update-rc.d s8810-32q-monitor remove >/dev/null
|
||||
update-rc.d qsfp-monitor remove >/dev/null
|
||||
fi
|
||||
|
||||
|
||||
# In case this system is running systemd, we make systemd reload the unit files
|
||||
# to pick up changes.
|
||||
if [ -d /run/systemd/system ] ; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_enable
|
||||
if [ "$1" = "remove" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask s8810-32q-monitor.service >/dev/null
|
||||
deb-systemd-helper mask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge s8810-32q-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask s8810-32q-monitor.service >/dev/null
|
||||
deb-systemd-helper purge qsfp-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
# Generate kernel modules.dep and map files for remove eeprom_mb.
|
||||
depmod -a || true
|
||||
# End automatically added section
|
||||
|
@ -1,17 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-invoke stop s8810-32q-monitor.service >/dev/null
|
||||
deb-systemd-invoke stop qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s8810-32q-monitor" ]; then
|
||||
invoke-rc.d s8810-32q-monitor stop || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
invoke-rc.d qsfp-monitor stop || exit $?
|
||||
fi
|
||||
# Driver deinit
|
||||
/usr/sbin/i2c_utils.sh i2c_deinit
|
||||
# End automatically added section
|
||||
|
@ -1,6 +0,0 @@
|
||||
description "SONiC platform service"
|
||||
|
||||
respawn
|
||||
|
||||
exec /usr/sbin/s8810_32q_monitor.sh
|
||||
exec /usr/sbin/qsfp_monitor.sh
|
@ -1,3 +0,0 @@
|
||||
usr/sbin
|
||||
lib/systemd/system
|
||||
etc/
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S8900-54XC board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils.sh i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s8900-54xc.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
lib/systemd/
|
||||
usr/sbin/
|
||||
etc/
|
@ -1,43 +0,0 @@
|
||||
# Automatically added by dh_systemd_enable
|
||||
# This will only remove masks created by d-s-h on package removal.
|
||||
deb-systemd-helper unmask s8900-54xc-monitor.service >/dev/null || true
|
||||
# Generate kernel modules.dep and map files for add eeprom_mb.
|
||||
depmod -a || true
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled s8900-54xc-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable s8900-54xc-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state s8900-54xc-monitor.service >/dev/null || true
|
||||
fi
|
||||
if deb-systemd-helper --quiet was-enabled qsfp-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable qsfp-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s8900-54xc-monitor" ]; then
|
||||
update-rc.d s8900-54xc-monitor defaults >/dev/null
|
||||
invoke-rc.d s8900-54xc-monitor start || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
update-rc.d qsfp-monitor defaults >/dev/null
|
||||
invoke-rc.d qsfp-monitor start || exit $?
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
deb-systemd-invoke start s8900-54xc-monitor.service >/dev/null || true
|
||||
deb-systemd-invoke start qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
@ -1,38 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ "$1" = "purge" ] ; then
|
||||
update-rc.d s8900-54xc-monitor remove >/dev/null
|
||||
update-rc.d qsfp-monitor remove >/dev/null
|
||||
fi
|
||||
|
||||
|
||||
# In case this system is running systemd, we make systemd reload the unit files
|
||||
# to pick up changes.
|
||||
if [ -d /run/systemd/system ] ; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_enable
|
||||
if [ "$1" = "remove" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask s8900-54xc-monitor.service >/dev/null
|
||||
deb-systemd-helper mask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge s8900-54xc-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask s8900-54xc-monitor.service >/dev/null
|
||||
deb-systemd-helper purge qsfp-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
# Generate kernel modules.dep and map files for remove eeprom_mb.
|
||||
depmod -a || true
|
||||
# End automatically added section
|
||||
|
@ -1,17 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-invoke stop s8900-54xc-monitor.service >/dev/null
|
||||
deb-systemd-invoke stop qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s8900-54xc-monitor" ]; then
|
||||
invoke-rc.d s8900-54xc-monitor stop || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
invoke-rc.d qsfp-monitor stop || exit $?
|
||||
fi
|
||||
# Driver deinit
|
||||
/usr/sbin/i2c_utils.sh i2c_deinit
|
||||
# End automatically added section
|
||||
|
@ -1,6 +0,0 @@
|
||||
description "SONiC platform service"
|
||||
|
||||
respawn
|
||||
|
||||
exec /usr/sbin/s8900_54xc_monitor.sh
|
||||
exec /usr/sbin/qsfp_monitor.sh
|
@ -1,3 +0,0 @@
|
||||
usr/sbin
|
||||
lib/systemd/system
|
||||
etc/
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S8900-64XC board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils.sh i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s8900-64xc.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
lib/systemd/
|
||||
usr/sbin/
|
||||
etc/
|
@ -1,42 +0,0 @@
|
||||
# Automatically added by dh_systemd_enable
|
||||
# This will only remove masks created by d-s-h on package removal.
|
||||
deb-systemd-helper unmask s8900-64xc-monitor.service >/dev/null || true
|
||||
# Generate kernel modules.dep and map files for add eeprom_mb.
|
||||
depmod -a || true
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled s8900-64xc-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable s8900-64xc-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state s8900-64xc-monitor.service >/dev/null || true
|
||||
fi
|
||||
if deb-systemd-helper --quiet was-enabled qsfp-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable qsfp-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s8900-64xc-monitor" ]; then
|
||||
update-rc.d s8900-64xc-monitor defaults >/dev/null
|
||||
invoke-rc.d s8900-64xc-monitor start || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
update-rc.d qsfp-monitor defaults >/dev/null
|
||||
invoke-rc.d qsfp-monitor start || exit $?
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
deb-systemd-invoke start s8900-64xc-monitor.service >/dev/null || true
|
||||
deb-systemd-invoke start qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
@ -1,38 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ "$1" = "purge" ] ; then
|
||||
update-rc.d s8900-64xc-monitor remove >/dev/null
|
||||
update-rc.d qsfp-monitor remove >/dev/null
|
||||
fi
|
||||
|
||||
|
||||
# In case this system is running systemd, we make systemd reload the unit files
|
||||
# to pick up changes.
|
||||
if [ -d /run/systemd/system ] ; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_enable
|
||||
if [ "$1" = "remove" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask s8900-64xc-monitor.service >/dev/null
|
||||
deb-systemd-helper mask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge s8900-64xc-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask s8900-64xc-monitor.service >/dev/null
|
||||
deb-systemd-helper purge qsfp-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
# Generate kernel modules.dep and map files for remove eeprom_mb.
|
||||
depmod -a || true
|
||||
# End automatically added section
|
||||
|
@ -1,15 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-invoke stop s8900-64xc-monitor.service >/dev/null
|
||||
deb-systemd-invoke stop qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s8900-64xc-monitor" ]; then
|
||||
invoke-rc.d s8900-64xc-monitor stop || exit $?
|
||||
invoke-rc.d qsfp-monitor stop || exit $?
|
||||
fi
|
||||
# Driver deinit
|
||||
/usr/sbin/i2c_utils.sh i2c_deinit
|
||||
# End automatically added section
|
||||
|
@ -1,6 +0,0 @@
|
||||
description "SONiC platform service"
|
||||
|
||||
respawn
|
||||
|
||||
exec /usr/sbin/s8900_64xc_monitor.sh
|
||||
exec /usr/sbin/qsfp-monitor.sh
|
@ -1,3 +0,0 @@
|
||||
usr/sbin
|
||||
lib/systemd/system
|
||||
etc/
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S9100 board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils.sh i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s9100.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
lib/systemd/
|
||||
usr/sbin/
|
||||
etc/
|
@ -1,43 +0,0 @@
|
||||
# Automatically added by dh_systemd_enable
|
||||
# This will only remove masks created by d-s-h on package removal.
|
||||
deb-systemd-helper unmask s9100-monitor.service >/dev/null || true
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null || true
|
||||
# Generate kernel modules.dep and map files for add eeprom_mb.
|
||||
depmod -a || true
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled s9100-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable s9100-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state s9100-monitor.service >/dev/null || true
|
||||
fi
|
||||
if deb-systemd-helper --quiet was-enabled qsfp-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable qsfp-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s9100-monitor" ]; then
|
||||
update-rc.d s9100-monitor defaults >/dev/null
|
||||
invoke-rc.d s9100-monitor start || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
update-rc.d qsfp-monitor defaults >/dev/null
|
||||
invoke-rc.d qsfp-monitor start || exit $?
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
deb-systemd-invoke start s9100-monitor.service >/dev/null || true
|
||||
deb-systemd-invoke start qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
@ -1,38 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ "$1" = "purge" ] ; then
|
||||
update-rc.d s9100-monitor remove >/dev/null
|
||||
update-rc.d qsfp-monitor remove >/dev/null
|
||||
fi
|
||||
|
||||
|
||||
# In case this system is running systemd, we make systemd reload the unit files
|
||||
# to pick up changes.
|
||||
if [ -d /run/systemd/system ] ; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_enable
|
||||
if [ "$1" = "remove" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask s9100-monitor.service >/dev/null
|
||||
deb-systemd-helper mask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge s9100-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask s9100-monitor.service >/dev/null
|
||||
deb-systemd-helper purge qsfp-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
# Generate kernel modules.dep and map files for remove eeprom_mb.
|
||||
depmod -a || true
|
||||
# End automatically added section
|
||||
|
@ -1,17 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-invoke stop s9100-monitor.service >/dev/null
|
||||
deb-systemd-invoke stop qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s9100-monitor" ]; then
|
||||
invoke-rc.d s9100-monitor stop || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
invoke-rc.d qsfp-monitor stop || exit $?
|
||||
fi
|
||||
# Driver deinit
|
||||
/usr/sbin/i2c_utils.sh i2c_deinit
|
||||
# End automatically added section
|
||||
|
@ -1,6 +0,0 @@
|
||||
description "SONiC platform service"
|
||||
|
||||
respawn
|
||||
|
||||
exec /usr/sbin/s9100_monitor.sh
|
||||
exec /usr/sbin/qsfp_monitor.sh
|
@ -1,3 +0,0 @@
|
||||
usr/sbin
|
||||
lib/systemd/system
|
||||
etc/
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S9200-64X board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils.sh i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s9200-64x.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,3 +0,0 @@
|
||||
lib/systemd/
|
||||
usr/sbin/
|
||||
etc/
|
@ -1,43 +0,0 @@
|
||||
# Automatically added by dh_systemd_enable
|
||||
# This will only remove masks created by d-s-h on package removal.
|
||||
deb-systemd-helper unmask s9200-64x-monitor.service >/dev/null || true
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null || true
|
||||
# Generate kernel modules.dep and map files for add eeprom_mb.
|
||||
depmod -a || true
|
||||
# was-enabled defaults to true, so new installations run enable.
|
||||
if deb-systemd-helper --quiet was-enabled s9200-64x-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable s9200-64x-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state s9200-64x-monitor.service >/dev/null || true
|
||||
fi
|
||||
if deb-systemd-helper --quiet was-enabled qsfp-monitor.service; then
|
||||
# Enables the unit on first installation, creates new
|
||||
# symlinks on upgrades if the unit file has changed.
|
||||
deb-systemd-helper enable qsfp-monitor.service >/dev/null || true
|
||||
else
|
||||
# Update the statefile to add new symlinks (if any), which need to be
|
||||
# cleaned up on purge. Also remove old symlinks.
|
||||
deb-systemd-helper update-state qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s9200-64x-monitor" ]; then
|
||||
update-rc.d s9200-64x-monitor defaults >/dev/null
|
||||
invoke-rc.d s9200-64x-monitor start || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
update-rc.d qsfp-monitor defaults >/dev/null
|
||||
invoke-rc.d qsfp-monitor start || exit $?
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
deb-systemd-invoke start s9200-64x-monitor.service >/dev/null || true
|
||||
deb-systemd-invoke start qsfp-monitor.service >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
@ -1,38 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ "$1" = "purge" ] ; then
|
||||
update-rc.d s9200-64x-monitor remove >/dev/null
|
||||
update-rc.d qsfp-monitor remove >/dev/null
|
||||
fi
|
||||
|
||||
|
||||
# In case this system is running systemd, we make systemd reload the unit files
|
||||
# to pick up changes.
|
||||
if [ -d /run/systemd/system ] ; then
|
||||
systemctl --system daemon-reload >/dev/null || true
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_systemd_enable
|
||||
if [ "$1" = "remove" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper mask s9200-64x-monitor.service >/dev/null
|
||||
deb-systemd-helper mask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||
deb-systemd-helper purge s9200-64x-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask s9200-64x-monitor.service >/dev/null
|
||||
deb-systemd-helper purge qsfp-monitor.service >/dev/null
|
||||
deb-systemd-helper unmask qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
fi
|
||||
# Generate kernel modules.dep and map files for remove eeprom_mb.
|
||||
depmod -a || true
|
||||
# End automatically added section
|
||||
|
@ -1,17 +0,0 @@
|
||||
# Automatically added by dh_systemd_start
|
||||
if [ -d /run/systemd/system ]; then
|
||||
deb-systemd-invoke stop s9200-64x-monitor.service >/dev/null
|
||||
deb-systemd-invoke stop qsfp-monitor.service >/dev/null
|
||||
fi
|
||||
# End automatically added section
|
||||
# Automatically added by dh_installinit
|
||||
if [ -x "/etc/init.d/s9200-64x-monitor" ]; then
|
||||
invoke-rc.d s9200-64x-monitor stop || exit $?
|
||||
fi
|
||||
if [ -x "/etc/init.d/qsfp-monitor" ]; then
|
||||
invoke-rc.d qsfp-monitor stop || exit $?
|
||||
fi
|
||||
# Driver deinit
|
||||
/usr/sbin/i2c_utils.sh i2c_deinit
|
||||
# End automatically added section
|
||||
|
@ -1,6 +0,0 @@
|
||||
description "SONiC platform service"
|
||||
|
||||
respawn
|
||||
|
||||
exec /usr/sbin/s9200_64x_monitor.sh
|
||||
exec /usr/sbin/qsfp_monitor.sh
|
@ -15,7 +15,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
VERSION="1.0.0"
|
||||
# trun on for more debug output
|
||||
#DEBUG="on"
|
||||
|
||||
VERSION="1.1.0"
|
||||
TRUE=200
|
||||
FALSE=404
|
||||
|
||||
@ -165,11 +168,14 @@ REG_CFG_1=7
|
||||
#Bit Mask
|
||||
BIT_MASK=(1 2 4 8 16 32 64 128)
|
||||
|
||||
#GPIO Offset
|
||||
GPIO_OFFSET=0
|
||||
|
||||
# Help usage function
|
||||
function _help {
|
||||
echo "========================================================="
|
||||
echo "# Description: Help Function"
|
||||
echo "# Version : ${VERSION}"
|
||||
echo "========================================================="
|
||||
echo "----------------------------------------------------"
|
||||
echo "EX : ${0} help"
|
||||
@ -315,7 +321,9 @@ function _i2c_init {
|
||||
modprobe gpio-pca953x
|
||||
_i2c_fan_init
|
||||
_i2c_io_exp_init
|
||||
rmmod gpio_ich
|
||||
_i2c_gpio_init
|
||||
modprobe gpio_ich
|
||||
_i2c_psu_init
|
||||
_i2c_qsfp_eeprom_init "new"
|
||||
_i2c_mb_eeprom_init "new"
|
||||
@ -576,14 +584,30 @@ function _clear_gpiomap {
|
||||
rm -rf ${PATH_GPIOMAP}
|
||||
}
|
||||
|
||||
# To set the global variable GPIO_OFFSET
|
||||
function _set_gpio_offset {
|
||||
GPIO_OFFSET=0
|
||||
for d in `ls /sys/class/gpio/ | grep gpiochip`
|
||||
do
|
||||
gpiochip_no=${d##gpiochip}
|
||||
if [ $gpiochip_no -gt 255 ]; then
|
||||
GPIO_OFFSET=256
|
||||
break
|
||||
fi
|
||||
done
|
||||
#echo "set GPIO_OFFSET=${GPIO_OFFSET}"
|
||||
}
|
||||
|
||||
#GPIO Init
|
||||
function _i2c_gpio_init {
|
||||
local i=0
|
||||
|
||||
#ABS Port 0-31
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_1}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN1}/new_device
|
||||
_set_gpio_offset
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_0}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN1}/new_device
|
||||
for i in {224..255}
|
||||
#for i in {224..255}
|
||||
for((i=${GPIO_OFFSET}+224;i<=${GPIO_OFFSET}+255;i++));
|
||||
do
|
||||
_gpio_export ${i} ${DIR_IN} ${ACTIVE_LOW}
|
||||
_set_gpiomap ${i} "QSFP$(( i - 223 ))_ABS"
|
||||
@ -592,7 +616,8 @@ function _i2c_gpio_init {
|
||||
#INT Port 0-31
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_3}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN1}/new_device
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_2}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN1}/new_device
|
||||
for i in {192..223}
|
||||
#for i in {192..223}
|
||||
for((i=${GPIO_OFFSET}+192;i<=${GPIO_OFFSET}+223;i++));
|
||||
do
|
||||
_gpio_export ${i} ${DIR_IN} ${ACTIVE_LOW}
|
||||
_set_gpiomap ${i} "QSFP$(( i - 191 ))_INT"
|
||||
@ -601,7 +626,8 @@ function _i2c_gpio_init {
|
||||
#LP Mode Port 0-31
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_5}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN2}/new_device
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_4}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN2}/new_device
|
||||
for i in {160..191}
|
||||
#for i in {160..191}
|
||||
for((i=${GPIO_OFFSET}+160;i<=${GPIO_OFFSET}+191;i++));
|
||||
do
|
||||
_gpio_export ${i} ${DIR_OUT} ${ACTIVE_HIGH}
|
||||
_set_gpiomap ${i} "QSFP$(( i - 159 ))_LPMODE"
|
||||
@ -610,7 +636,8 @@ function _i2c_gpio_init {
|
||||
#RST Port 0-31
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_7}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN2}/new_device
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_6}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN2}/new_device
|
||||
for i in {128..159}
|
||||
#for i in {128..159}
|
||||
for((i=${GPIO_OFFSET}+128;i<=${GPIO_OFFSET}+159;i++));
|
||||
do
|
||||
_gpio_export ${i} ${DIR_OUT} ${ACTIVE_LOW}
|
||||
_set_gpiomap ${i} "QSFP$(( i - 127 ))_RST"
|
||||
@ -622,7 +649,8 @@ function _i2c_gpio_init {
|
||||
#MODSEL Port 0-31
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_9}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN3}/new_device
|
||||
echo "pca9535 ${I2C_ADDR_MUX_9535_8}" > ${PATH_SYS_I2C_DEVICES}/i2c-${NUM_MUX_9548_1_CHAN3}/new_device
|
||||
for i in {96..127}
|
||||
#for i in {96..127}
|
||||
for((i=${GPIO_OFFSET}+96;i<=${GPIO_OFFSET}+127;i++));
|
||||
do
|
||||
_gpio_export ${i} ${DIR_OUT} ${ACTIVE_LOW}
|
||||
_set_gpiomap ${i} "QSFP$(( i - 95 ))_MODSEL"
|
||||
@ -965,31 +993,36 @@ function _qsfp_port_i2c_var_set {
|
||||
regAddr=0x20
|
||||
dataAddr=0
|
||||
eeprombusbase=${NUM_MUX_9548_2_CHAN0}
|
||||
gpioBase=224
|
||||
gpioBase=$((${GPIO_OFFSET}+224))
|
||||
#gpioBase=224
|
||||
;;
|
||||
9|10|11|12|13|14|15|16)
|
||||
i2cbus=${NUM_MUX_9548_1_CHAN1}
|
||||
regAddr=0x20
|
||||
dataAddr=1
|
||||
eeprombusbase=${NUM_MUX_9548_3_CHAN0}
|
||||
gpioBase=224
|
||||
gpioBase=$((${GPIO_OFFSET}+224))
|
||||
#gpioBase=224
|
||||
;;
|
||||
17|18|19|20|21|22|23|24)
|
||||
i2cbus=${NUM_MUX_9548_1_CHAN1}
|
||||
regAddr=0x21
|
||||
dataAddr=0
|
||||
eeprombusbase=${NUM_MUX_9548_4_CHAN0}
|
||||
gpioBase=240
|
||||
gpioBase=$((${GPIO_OFFSET}+240))
|
||||
#gpioBase=240
|
||||
;;
|
||||
25|26|27|28|29|30|31|32)
|
||||
i2cbus=${NUM_MUX_9548_1_CHAN1}
|
||||
regAddr=0x21
|
||||
dataAddr=1
|
||||
eeprombusbase=${NUM_MUX_9548_5_CHAN0}
|
||||
gpioBase=240
|
||||
gpioBase=$((${GPIO_OFFSET}+240))
|
||||
#gpioBase=240
|
||||
;;
|
||||
*)
|
||||
echo "Please input 1~32"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -1366,6 +1399,7 @@ function _main {
|
||||
start_time_str=`date`
|
||||
start_time_sec=$(date +%s)
|
||||
|
||||
_set_gpio_offset
|
||||
if [ "${EXEC_FUNC}" == "help" ]; then
|
||||
_help
|
||||
elif [ "${EXEC_FUNC}" == "i2c_init" ]; then
|
||||
@ -1439,6 +1473,8 @@ function _main {
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" == "on" ]; then
|
||||
echo "-----------------------------------------------------"
|
||||
end_time_str=`date`
|
||||
end_time_sec=$(date +%s)
|
||||
diff_time=$[ ${end_time_sec} - ${start_time_sec} ]
|
||||
@ -1447,6 +1483,7 @@ function _main {
|
||||
echo "Total Execution Time: ${diff_time} sec"
|
||||
|
||||
echo "done!!!"
|
||||
fi
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -15,7 +15,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
VERSION="1.0.0"
|
||||
# trun on for more debug output
|
||||
#DEBUG="on"
|
||||
|
||||
VERSION="1.1.0"
|
||||
TRUE=200
|
||||
FALSE=404
|
||||
PORT_START=1
|
||||
@ -97,11 +100,14 @@ ZQSFP_PORT0_15_ABS_GPIO_IDX=192
|
||||
ZQSFP_PORT16_31_ABS_GPIO_IDX=176
|
||||
ZQSFP_PORT32_47_ABS_GPIO_IDX=160
|
||||
|
||||
#GPIO Offset
|
||||
GPIO_OFFSET=0
|
||||
|
||||
# Help usage function
|
||||
function _help {
|
||||
echo "========================================================="
|
||||
echo "# Description: Help Function"
|
||||
echo "# Version : ${VERSION}"
|
||||
echo "========================================================="
|
||||
echo "----------------------------------------------------"
|
||||
echo "EX : ${0} help"
|
||||
@ -226,7 +232,9 @@ function _i2c_init {
|
||||
modprobe eeprom_mb
|
||||
_i2c_fan_init
|
||||
_i2c_io_exp_init
|
||||
rmmod gpio_ich
|
||||
_i2c_gpio_init
|
||||
modprobe gpio_ich
|
||||
_i2c_cpld_init
|
||||
_i2c_psu_eeprom_init
|
||||
_i2c_led_psu_status_set
|
||||
@ -529,222 +537,279 @@ function _i2c_unmount_sfp_eeprom {
|
||||
echo "Unmount Port $1 EEPROM"
|
||||
}
|
||||
|
||||
# To set the global variable GPIO_OFFSET
|
||||
function _set_gpio_offset {
|
||||
GPIO_OFFSET=0
|
||||
for d in `ls /sys/class/gpio/ | grep gpiochip`
|
||||
do
|
||||
gpiochip_no=${d##gpiochip}
|
||||
if [ $gpiochip_no -gt 255 ]; then
|
||||
GPIO_OFFSET=256
|
||||
break
|
||||
fi
|
||||
done
|
||||
#echo "set GPIO_OFFSET=${GPIO_OFFSET}"
|
||||
}
|
||||
|
||||
#GPIO Init
|
||||
function _i2c_gpio_init {
|
||||
|
||||
#QSFP/ZQSFP ABS+INT
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX2_CHAN0_DEVICE}/new_device
|
||||
_set_gpio_offset
|
||||
for((i=${GPIO_OFFSET}+240;i<=${GPIO_OFFSET}+255;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
_retry "echo 240 > /sys/class/gpio/export"
|
||||
echo 241 > /sys/class/gpio/export
|
||||
echo 242 > /sys/class/gpio/export
|
||||
echo 243 > /sys/class/gpio/export
|
||||
echo 244 > /sys/class/gpio/export
|
||||
echo 245 > /sys/class/gpio/export
|
||||
echo 246 > /sys/class/gpio/export
|
||||
echo 247 > /sys/class/gpio/export
|
||||
echo 248 > /sys/class/gpio/export
|
||||
echo 249 > /sys/class/gpio/export
|
||||
echo 250 > /sys/class/gpio/export
|
||||
echo 251 > /sys/class/gpio/export
|
||||
echo 252 > /sys/class/gpio/export
|
||||
echo 253 > /sys/class/gpio/export
|
||||
echo 254 > /sys/class/gpio/export
|
||||
echo 255 > /sys/class/gpio/export
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio241/active_low #QSFP49 ABS
|
||||
echo 1 > /sys/class/gpio/gpio240/active_low #QSFP48 ABS
|
||||
echo 1 > /sys/class/gpio/gpio243/active_low #QSFP51 ABS
|
||||
echo 1 > /sys/class/gpio/gpio242/active_low #QSFP50 ABS
|
||||
echo 1 > /sys/class/gpio/gpio245/active_low #QSFP53 ABS
|
||||
echo 1 > /sys/class/gpio/gpio244/active_low #QSFP52 ABS
|
||||
echo 1 > /sys/class/gpio/gpio247/active_low #NA
|
||||
echo 1 > /sys/class/gpio/gpio246/active_low #NA
|
||||
echo 1 > /sys/class/gpio/gpio249/active_low #QSFP49 INT
|
||||
echo 1 > /sys/class/gpio/gpio248/active_low #QSFP48 INT
|
||||
echo 1 > /sys/class/gpio/gpio251/active_low #QSFP51 INT
|
||||
echo 1 > /sys/class/gpio/gpio250/active_low #QSFP50 INT
|
||||
echo 1 > /sys/class/gpio/gpio253/active_low #QSFP53 INT
|
||||
echo 1 > /sys/class/gpio/gpio252/active_low #QSFP52 INT
|
||||
echo 1 > /sys/class/gpio/gpio255/active_low #NA
|
||||
echo 1 > /sys/class/gpio/gpio254/active_low #NA
|
||||
#_retry "echo 240 > /sys/class/gpio/export"
|
||||
#echo 241 > /sys/class/gpio/export
|
||||
#echo 242 > /sys/class/gpio/export
|
||||
#echo 243 > /sys/class/gpio/export
|
||||
#echo 244 > /sys/class/gpio/export
|
||||
#echo 245 > /sys/class/gpio/export
|
||||
#echo 246 > /sys/class/gpio/export
|
||||
#echo 247 > /sys/class/gpio/export
|
||||
#echo 248 > /sys/class/gpio/export
|
||||
#echo 249 > /sys/class/gpio/export
|
||||
#echo 250 > /sys/class/gpio/export
|
||||
#echo 251 > /sys/class/gpio/export
|
||||
#echo 252 > /sys/class/gpio/export
|
||||
#echo 253 > /sys/class/gpio/export
|
||||
#echo 254 > /sys/class/gpio/export
|
||||
#echo 255 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio241/active_low #QSFP49 ABS
|
||||
#echo 1 > /sys/class/gpio/gpio240/active_low #QSFP48 ABS
|
||||
#echo 1 > /sys/class/gpio/gpio243/active_low #QSFP51 ABS
|
||||
#echo 1 > /sys/class/gpio/gpio242/active_low #QSFP50 ABS
|
||||
#echo 1 > /sys/class/gpio/gpio245/active_low #QSFP53 ABS
|
||||
#echo 1 > /sys/class/gpio/gpio244/active_low #QSFP52 ABS
|
||||
#echo 1 > /sys/class/gpio/gpio247/active_low #NA
|
||||
#echo 1 > /sys/class/gpio/gpio246/active_low #NA
|
||||
#echo 1 > /sys/class/gpio/gpio249/active_low #QSFP49 INT
|
||||
#echo 1 > /sys/class/gpio/gpio248/active_low #QSFP48 INT
|
||||
#echo 1 > /sys/class/gpio/gpio251/active_low #QSFP51 INT
|
||||
#echo 1 > /sys/class/gpio/gpio250/active_low #QSFP50 INT
|
||||
#echo 1 > /sys/class/gpio/gpio253/active_low #QSFP53 INT
|
||||
#echo 1 > /sys/class/gpio/gpio252/active_low #QSFP52 INT
|
||||
#echo 1 > /sys/class/gpio/gpio255/active_low #NA
|
||||
#echo 1 > /sys/class/gpio/gpio254/active_low #NA
|
||||
|
||||
#QSFP/zQSFP LPMODE+MODSEL
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX2_CHAN3_DEVICE}/new_device
|
||||
echo 224 > /sys/class/gpio/export #QSFP0 LPMODE
|
||||
echo 225 > /sys/class/gpio/export #QSFP1 LPMODE
|
||||
echo 226 > /sys/class/gpio/export #QSFP2 LPMODE
|
||||
echo 227 > /sys/class/gpio/export #QSFP3 LPMODE
|
||||
echo 228 > /sys/class/gpio/export #QSFP4 LPMODE
|
||||
echo 229 > /sys/class/gpio/export #QSFP5 LPMODE
|
||||
echo 230 > /sys/class/gpio/export #NA
|
||||
echo 231 > /sys/class/gpio/export #NA
|
||||
echo 232 > /sys/class/gpio/export #QSFP0 MODSEL
|
||||
echo 233 > /sys/class/gpio/export #QSFP1 MODSEL
|
||||
echo 234 > /sys/class/gpio/export #QSFP2 MODSEL
|
||||
echo 235 > /sys/class/gpio/export #QSFP3 MODSEL
|
||||
echo 236 > /sys/class/gpio/export #QSFP4 MODSEL
|
||||
echo 237 > /sys/class/gpio/export #QSFP5 MODSEL
|
||||
echo 238 > /sys/class/gpio/export #NA
|
||||
echo 239 > /sys/class/gpio/export #NA
|
||||
echo out > /sys/class/gpio/gpio224/direction
|
||||
echo out > /sys/class/gpio/gpio225/direction
|
||||
echo out > /sys/class/gpio/gpio226/direction
|
||||
echo out > /sys/class/gpio/gpio227/direction
|
||||
echo out > /sys/class/gpio/gpio228/direction
|
||||
echo out > /sys/class/gpio/gpio229/direction
|
||||
echo out > /sys/class/gpio/gpio230/direction
|
||||
echo out > /sys/class/gpio/gpio231/direction
|
||||
echo out > /sys/class/gpio/gpio232/direction
|
||||
echo out > /sys/class/gpio/gpio233/direction
|
||||
echo out > /sys/class/gpio/gpio234/direction
|
||||
echo out > /sys/class/gpio/gpio235/direction
|
||||
echo out > /sys/class/gpio/gpio236/direction
|
||||
echo out > /sys/class/gpio/gpio237/direction
|
||||
echo out > /sys/class/gpio/gpio238/direction
|
||||
echo out > /sys/class/gpio/gpio239/direction
|
||||
for((i=${GPIO_OFFSET}+224;i<=${GPIO_OFFSET}+239;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
done
|
||||
|
||||
#echo 224 > /sys/class/gpio/export #QSFP0 LPMODE
|
||||
#echo 225 > /sys/class/gpio/export #QSFP1 LPMODE
|
||||
#echo 226 > /sys/class/gpio/export #QSFP2 LPMODE
|
||||
#echo 227 > /sys/class/gpio/export #QSFP3 LPMODE
|
||||
#echo 228 > /sys/class/gpio/export #QSFP4 LPMODE
|
||||
#echo 229 > /sys/class/gpio/export #QSFP5 LPMODE
|
||||
#echo 230 > /sys/class/gpio/export #NA
|
||||
#echo 231 > /sys/class/gpio/export #NA
|
||||
#echo 232 > /sys/class/gpio/export #QSFP0 MODSEL
|
||||
#echo 233 > /sys/class/gpio/export #QSFP1 MODSEL
|
||||
#echo 234 > /sys/class/gpio/export #QSFP2 MODSEL
|
||||
#echo 235 > /sys/class/gpio/export #QSFP3 MODSEL
|
||||
#echo 236 > /sys/class/gpio/export #QSFP4 MODSEL
|
||||
#echo 237 > /sys/class/gpio/export #QSFP5 MODSEL
|
||||
#echo 238 > /sys/class/gpio/export #NA
|
||||
#echo 239 > /sys/class/gpio/export #NA
|
||||
#echo out > /sys/class/gpio/gpio224/direction
|
||||
#echo out > /sys/class/gpio/gpio225/direction
|
||||
#echo out > /sys/class/gpio/gpio226/direction
|
||||
#echo out > /sys/class/gpio/gpio227/direction
|
||||
#echo out > /sys/class/gpio/gpio228/direction
|
||||
#echo out > /sys/class/gpio/gpio229/direction
|
||||
#echo out > /sys/class/gpio/gpio230/direction
|
||||
#echo out > /sys/class/gpio/gpio231/direction
|
||||
#echo out > /sys/class/gpio/gpio232/direction
|
||||
#echo out > /sys/class/gpio/gpio233/direction
|
||||
#echo out > /sys/class/gpio/gpio234/direction
|
||||
#echo out > /sys/class/gpio/gpio235/direction
|
||||
#echo out > /sys/class/gpio/gpio236/direction
|
||||
#echo out > /sys/class/gpio/gpio237/direction
|
||||
#echo out > /sys/class/gpio/gpio238/direction
|
||||
#echo out > /sys/class/gpio/gpio239/direction
|
||||
|
||||
#QSFP RST
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX2_CHAN5_DEVICE}/new_device
|
||||
echo 208 > /sys/class/gpio/export #QSFP0 RST
|
||||
echo 209 > /sys/class/gpio/export #QSFP1 RST
|
||||
echo 210 > /sys/class/gpio/export #QSFP2 RST
|
||||
echo 211 > /sys/class/gpio/export #QSFP3 RST
|
||||
echo 212 > /sys/class/gpio/export #QSFP4 RST
|
||||
echo 213 > /sys/class/gpio/export #QSFP5 RST
|
||||
echo 214 > /sys/class/gpio/export #NA
|
||||
echo 215 > /sys/class/gpio/export #NA
|
||||
echo 216 > /sys/class/gpio/export #NA
|
||||
echo 217 > /sys/class/gpio/export #NA
|
||||
echo 218 > /sys/class/gpio/export #NA
|
||||
echo 219 > /sys/class/gpio/export #NA
|
||||
echo 220 > /sys/class/gpio/export #NA
|
||||
echo 221 > /sys/class/gpio/export #NA
|
||||
echo 222 > /sys/class/gpio/export #NA
|
||||
echo 223 > /sys/class/gpio/export #NA
|
||||
echo out > /sys/class/gpio/gpio208/direction
|
||||
echo out > /sys/class/gpio/gpio209/direction
|
||||
echo out > /sys/class/gpio/gpio210/direction
|
||||
echo out > /sys/class/gpio/gpio211/direction
|
||||
echo out > /sys/class/gpio/gpio212/direction
|
||||
echo out > /sys/class/gpio/gpio213/direction
|
||||
echo 1 > /sys/class/gpio/gpio208/active_low
|
||||
echo 1 > /sys/class/gpio/gpio209/active_low
|
||||
echo 1 > /sys/class/gpio/gpio210/active_low
|
||||
echo 1 > /sys/class/gpio/gpio211/active_low
|
||||
echo 1 > /sys/class/gpio/gpio212/active_low
|
||||
echo 1 > /sys/class/gpio/gpio213/active_low
|
||||
echo 0 > /sys/class/gpio/gpio208/value
|
||||
echo 0 > /sys/class/gpio/gpio209/value
|
||||
echo 0 > /sys/class/gpio/gpio210/value
|
||||
echo 0 > /sys/class/gpio/gpio211/value
|
||||
echo 0 > /sys/class/gpio/gpio212/value
|
||||
echo 0 > /sys/class/gpio/gpio213/value
|
||||
for((i=${GPIO_OFFSET}+208;i<=${GPIO_OFFSET}+213;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
echo low > /sys/class/gpio/gpio${i}/direction
|
||||
#echo out > /sys/class/gpio/gpio${i}/direction
|
||||
#echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
done
|
||||
for((i=${GPIO_OFFSET}+214;i<=${GPIO_OFFSET}+223;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
done
|
||||
|
||||
#echo 208 > /sys/class/gpio/export #QSFP0 RST
|
||||
#echo 209 > /sys/class/gpio/export #QSFP1 RST
|
||||
#echo 210 > /sys/class/gpio/export #QSFP2 RST
|
||||
#echo 211 > /sys/class/gpio/export #QSFP3 RST
|
||||
#echo 212 > /sys/class/gpio/export #QSFP4 RST
|
||||
#echo 213 > /sys/class/gpio/export #QSFP5 RST
|
||||
#echo 214 > /sys/class/gpio/export #NA
|
||||
#echo 215 > /sys/class/gpio/export #NA
|
||||
#echo 216 > /sys/class/gpio/export #NA
|
||||
#echo 217 > /sys/class/gpio/export #NA
|
||||
#echo 218 > /sys/class/gpio/export #NA
|
||||
#echo 219 > /sys/class/gpio/export #NA
|
||||
#echo 220 > /sys/class/gpio/export #NA
|
||||
#echo 221 > /sys/class/gpio/export #NA
|
||||
#echo 222 > /sys/class/gpio/export #NA
|
||||
#echo 223 > /sys/class/gpio/export #NA
|
||||
#echo out > /sys/class/gpio/gpio208/direction
|
||||
#echo out > /sys/class/gpio/gpio209/direction
|
||||
#echo out > /sys/class/gpio/gpio210/direction
|
||||
#echo out > /sys/class/gpio/gpio211/direction
|
||||
#echo out > /sys/class/gpio/gpio212/direction
|
||||
#echo out > /sys/class/gpio/gpio213/direction
|
||||
#echo 1 > /sys/class/gpio/gpio208/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio209/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio210/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio211/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio212/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio213/active_low
|
||||
#echo 0 > /sys/class/gpio/gpio208/value
|
||||
#echo 0 > /sys/class/gpio/gpio209/value
|
||||
#echo 0 > /sys/class/gpio/gpio210/value
|
||||
#echo 0 > /sys/class/gpio/gpio211/value
|
||||
#echo 0 > /sys/class/gpio/gpio212/value
|
||||
#echo 0 > /sys/class/gpio/gpio213/value
|
||||
|
||||
|
||||
#SFP+ ABS 0-15
|
||||
echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-${NUM_MUX2_CHAN0_DEVICE}/new_device
|
||||
echo 192 > /sys/class/gpio/export
|
||||
echo 193 > /sys/class/gpio/export
|
||||
echo 194 > /sys/class/gpio/export
|
||||
echo 195 > /sys/class/gpio/export
|
||||
echo 196 > /sys/class/gpio/export
|
||||
echo 197 > /sys/class/gpio/export
|
||||
echo 198 > /sys/class/gpio/export
|
||||
echo 199 > /sys/class/gpio/export
|
||||
echo 200 > /sys/class/gpio/export
|
||||
echo 201 > /sys/class/gpio/export
|
||||
echo 202 > /sys/class/gpio/export
|
||||
echo 203 > /sys/class/gpio/export
|
||||
echo 204 > /sys/class/gpio/export
|
||||
echo 205 > /sys/class/gpio/export
|
||||
echo 206 > /sys/class/gpio/export
|
||||
echo 207 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio192/active_low #SFP+00
|
||||
echo 1 > /sys/class/gpio/gpio193/active_low #SFP+01
|
||||
echo 1 > /sys/class/gpio/gpio194/active_low #SFP+02
|
||||
echo 1 > /sys/class/gpio/gpio195/active_low #SFP+03
|
||||
echo 1 > /sys/class/gpio/gpio196/active_low #SFP+04
|
||||
echo 1 > /sys/class/gpio/gpio197/active_low #SFP+05
|
||||
echo 1 > /sys/class/gpio/gpio198/active_low #SFP+06
|
||||
echo 1 > /sys/class/gpio/gpio199/active_low #SFP+07
|
||||
echo 1 > /sys/class/gpio/gpio200/active_low #SFP+08
|
||||
echo 1 > /sys/class/gpio/gpio201/active_low #SFP+09
|
||||
echo 1 > /sys/class/gpio/gpio202/active_low #SFP+10
|
||||
echo 1 > /sys/class/gpio/gpio203/active_low #SFP+11
|
||||
echo 1 > /sys/class/gpio/gpio204/active_low #SFP+12
|
||||
echo 1 > /sys/class/gpio/gpio205/active_low #SFP+13
|
||||
echo 1 > /sys/class/gpio/gpio206/active_low #SFP+14
|
||||
echo 1 > /sys/class/gpio/gpio207/active_low #SFP+15
|
||||
for((i=${GPIO_OFFSET}+192;i<=${GPIO_OFFSET}+207;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#echo 192 > /sys/class/gpio/export
|
||||
#echo 193 > /sys/class/gpio/export
|
||||
#echo 194 > /sys/class/gpio/export
|
||||
#echo 195 > /sys/class/gpio/export
|
||||
#echo 196 > /sys/class/gpio/export
|
||||
#echo 197 > /sys/class/gpio/export
|
||||
#echo 198 > /sys/class/gpio/export
|
||||
#echo 199 > /sys/class/gpio/export
|
||||
#echo 200 > /sys/class/gpio/export
|
||||
#echo 201 > /sys/class/gpio/export
|
||||
#echo 202 > /sys/class/gpio/export
|
||||
#echo 203 > /sys/class/gpio/export
|
||||
#echo 204 > /sys/class/gpio/export
|
||||
#echo 205 > /sys/class/gpio/export
|
||||
#echo 206 > /sys/class/gpio/export
|
||||
#echo 207 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio192/active_low #SFP+00
|
||||
#echo 1 > /sys/class/gpio/gpio193/active_low #SFP+01
|
||||
#echo 1 > /sys/class/gpio/gpio194/active_low #SFP+02
|
||||
#echo 1 > /sys/class/gpio/gpio195/active_low #SFP+03
|
||||
#echo 1 > /sys/class/gpio/gpio196/active_low #SFP+04
|
||||
#echo 1 > /sys/class/gpio/gpio197/active_low #SFP+05
|
||||
#echo 1 > /sys/class/gpio/gpio198/active_low #SFP+06
|
||||
#echo 1 > /sys/class/gpio/gpio199/active_low #SFP+07
|
||||
#echo 1 > /sys/class/gpio/gpio200/active_low #SFP+08
|
||||
#echo 1 > /sys/class/gpio/gpio201/active_low #SFP+09
|
||||
#echo 1 > /sys/class/gpio/gpio202/active_low #SFP+10
|
||||
#echo 1 > /sys/class/gpio/gpio203/active_low #SFP+11
|
||||
#echo 1 > /sys/class/gpio/gpio204/active_low #SFP+12
|
||||
#echo 1 > /sys/class/gpio/gpio205/active_low #SFP+13
|
||||
#echo 1 > /sys/class/gpio/gpio206/active_low #SFP+14
|
||||
#echo 1 > /sys/class/gpio/gpio207/active_low #SFP+15
|
||||
|
||||
#SFP+ ABS 16-31
|
||||
echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-${NUM_MUX2_CHAN0_DEVICE}/new_device
|
||||
echo 176 > /sys/class/gpio/export
|
||||
echo 177 > /sys/class/gpio/export
|
||||
echo 178 > /sys/class/gpio/export
|
||||
echo 179 > /sys/class/gpio/export
|
||||
echo 180 > /sys/class/gpio/export
|
||||
echo 181 > /sys/class/gpio/export
|
||||
echo 182 > /sys/class/gpio/export
|
||||
echo 183 > /sys/class/gpio/export
|
||||
echo 184 > /sys/class/gpio/export
|
||||
echo 185 > /sys/class/gpio/export
|
||||
echo 186 > /sys/class/gpio/export
|
||||
echo 187 > /sys/class/gpio/export
|
||||
echo 188 > /sys/class/gpio/export
|
||||
echo 189 > /sys/class/gpio/export
|
||||
echo 190 > /sys/class/gpio/export
|
||||
echo 191 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio176/active_low #SFP+16
|
||||
echo 1 > /sys/class/gpio/gpio177/active_low #SFP+17
|
||||
echo 1 > /sys/class/gpio/gpio178/active_low #SFP+18
|
||||
echo 1 > /sys/class/gpio/gpio179/active_low #SFP+19
|
||||
echo 1 > /sys/class/gpio/gpio180/active_low #SFP+20
|
||||
echo 1 > /sys/class/gpio/gpio181/active_low #SFP+21
|
||||
echo 1 > /sys/class/gpio/gpio182/active_low #SFP+22
|
||||
echo 1 > /sys/class/gpio/gpio183/active_low #SFP+23
|
||||
echo 1 > /sys/class/gpio/gpio184/active_low #SFP+24
|
||||
echo 1 > /sys/class/gpio/gpio185/active_low #SFP+25
|
||||
echo 1 > /sys/class/gpio/gpio186/active_low #SFP+26
|
||||
echo 1 > /sys/class/gpio/gpio187/active_low #SFP+27
|
||||
echo 1 > /sys/class/gpio/gpio188/active_low #SFP+28
|
||||
echo 1 > /sys/class/gpio/gpio189/active_low #SFP+29
|
||||
echo 1 > /sys/class/gpio/gpio190/active_low #SFP+30
|
||||
echo 1 > /sys/class/gpio/gpio191/active_low #SFP+31
|
||||
for((i=${GPIO_OFFSET}+176;i<=${GPIO_OFFSET}+191;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#echo 176 > /sys/class/gpio/export
|
||||
#echo 177 > /sys/class/gpio/export
|
||||
#echo 178 > /sys/class/gpio/export
|
||||
#echo 179 > /sys/class/gpio/export
|
||||
#echo 180 > /sys/class/gpio/export
|
||||
#echo 181 > /sys/class/gpio/export
|
||||
#echo 182 > /sys/class/gpio/export
|
||||
#echo 183 > /sys/class/gpio/export
|
||||
#echo 184 > /sys/class/gpio/export
|
||||
#echo 185 > /sys/class/gpio/export
|
||||
#echo 186 > /sys/class/gpio/export
|
||||
#echo 187 > /sys/class/gpio/export
|
||||
#echo 188 > /sys/class/gpio/export
|
||||
#echo 189 > /sys/class/gpio/export
|
||||
#echo 190 > /sys/class/gpio/export
|
||||
#echo 191 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio176/active_low #SFP+16
|
||||
#echo 1 > /sys/class/gpio/gpio177/active_low #SFP+17
|
||||
#echo 1 > /sys/class/gpio/gpio178/active_low #SFP+18
|
||||
#echo 1 > /sys/class/gpio/gpio179/active_low #SFP+19
|
||||
#echo 1 > /sys/class/gpio/gpio180/active_low #SFP+20
|
||||
#echo 1 > /sys/class/gpio/gpio181/active_low #SFP+21
|
||||
#echo 1 > /sys/class/gpio/gpio182/active_low #SFP+22
|
||||
#echo 1 > /sys/class/gpio/gpio183/active_low #SFP+23
|
||||
#echo 1 > /sys/class/gpio/gpio184/active_low #SFP+24
|
||||
#echo 1 > /sys/class/gpio/gpio185/active_low #SFP+25
|
||||
#echo 1 > /sys/class/gpio/gpio186/active_low #SFP+26
|
||||
#echo 1 > /sys/class/gpio/gpio187/active_low #SFP+27
|
||||
#echo 1 > /sys/class/gpio/gpio188/active_low #SFP+28
|
||||
#echo 1 > /sys/class/gpio/gpio189/active_low #SFP+29
|
||||
#echo 1 > /sys/class/gpio/gpio190/active_low #SFP+30
|
||||
#echo 1 > /sys/class/gpio/gpio191/active_low #SFP+31
|
||||
|
||||
#SFP+ ABS 32-47
|
||||
echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-${NUM_MUX2_CHAN0_DEVICE}/new_device
|
||||
echo 160 > /sys/class/gpio/export
|
||||
echo 161 > /sys/class/gpio/export
|
||||
echo 162 > /sys/class/gpio/export
|
||||
echo 163 > /sys/class/gpio/export
|
||||
echo 164 > /sys/class/gpio/export
|
||||
echo 165 > /sys/class/gpio/export
|
||||
echo 166 > /sys/class/gpio/export
|
||||
echo 167 > /sys/class/gpio/export
|
||||
echo 168 > /sys/class/gpio/export
|
||||
echo 169 > /sys/class/gpio/export
|
||||
echo 170 > /sys/class/gpio/export
|
||||
echo 171 > /sys/class/gpio/export
|
||||
echo 172 > /sys/class/gpio/export
|
||||
echo 173 > /sys/class/gpio/export
|
||||
echo 174 > /sys/class/gpio/export
|
||||
echo 175 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio160/active_low #SFP+32
|
||||
echo 1 > /sys/class/gpio/gpio161/active_low #SFP+33
|
||||
echo 1 > /sys/class/gpio/gpio162/active_low #SFP+34
|
||||
echo 1 > /sys/class/gpio/gpio163/active_low #SFP+35
|
||||
echo 1 > /sys/class/gpio/gpio164/active_low #SFP+36
|
||||
echo 1 > /sys/class/gpio/gpio165/active_low #SFP+37
|
||||
echo 1 > /sys/class/gpio/gpio166/active_low #SFP+38
|
||||
echo 1 > /sys/class/gpio/gpio167/active_low #SFP+39
|
||||
echo 1 > /sys/class/gpio/gpio168/active_low #SFP+40
|
||||
echo 1 > /sys/class/gpio/gpio169/active_low #SFP+41
|
||||
echo 1 > /sys/class/gpio/gpio170/active_low #SFP+42
|
||||
echo 1 > /sys/class/gpio/gpio171/active_low #SFP+43
|
||||
echo 1 > /sys/class/gpio/gpio172/active_low #SFP+44
|
||||
echo 1 > /sys/class/gpio/gpio173/active_low #SFP+45
|
||||
echo 1 > /sys/class/gpio/gpio174/active_low #SFP+46
|
||||
echo 1 > /sys/class/gpio/gpio175/active_low #SFP+47
|
||||
for((i=${GPIO_OFFSET}+160;i<=${GPIO_OFFSET}+175;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#echo 160 > /sys/class/gpio/export
|
||||
#echo 161 > /sys/class/gpio/export
|
||||
#echo 162 > /sys/class/gpio/export
|
||||
#echo 163 > /sys/class/gpio/export
|
||||
#echo 164 > /sys/class/gpio/export
|
||||
#echo 165 > /sys/class/gpio/export
|
||||
#echo 166 > /sys/class/gpio/export
|
||||
#echo 167 > /sys/class/gpio/export
|
||||
#echo 168 > /sys/class/gpio/export
|
||||
#echo 169 > /sys/class/gpio/export
|
||||
#echo 170 > /sys/class/gpio/export
|
||||
#echo 171 > /sys/class/gpio/export
|
||||
#echo 172 > /sys/class/gpio/export
|
||||
#echo 173 > /sys/class/gpio/export
|
||||
#echo 174 > /sys/class/gpio/export
|
||||
#echo 175 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio160/active_low #SFP+32
|
||||
#echo 1 > /sys/class/gpio/gpio161/active_low #SFP+33
|
||||
#echo 1 > /sys/class/gpio/gpio162/active_low #SFP+34
|
||||
#echo 1 > /sys/class/gpio/gpio163/active_low #SFP+35
|
||||
#echo 1 > /sys/class/gpio/gpio164/active_low #SFP+36
|
||||
#echo 1 > /sys/class/gpio/gpio165/active_low #SFP+37
|
||||
#echo 1 > /sys/class/gpio/gpio166/active_low #SFP+38
|
||||
#echo 1 > /sys/class/gpio/gpio167/active_low #SFP+39
|
||||
#echo 1 > /sys/class/gpio/gpio168/active_low #SFP+40
|
||||
#echo 1 > /sys/class/gpio/gpio169/active_low #SFP+41
|
||||
#echo 1 > /sys/class/gpio/gpio170/active_low #SFP+42
|
||||
#echo 1 > /sys/class/gpio/gpio171/active_low #SFP+43
|
||||
#echo 1 > /sys/class/gpio/gpio172/active_low #SFP+44
|
||||
#echo 1 > /sys/class/gpio/gpio173/active_low #SFP+45
|
||||
#echo 1 > /sys/class/gpio/gpio174/active_low #SFP+46
|
||||
#echo 1 > /sys/class/gpio/gpio175/active_low #SFP+47
|
||||
|
||||
}
|
||||
|
||||
@ -1038,43 +1103,50 @@ function _qsfp_port_i2c_var_set {
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x20
|
||||
dataAddr=0
|
||||
gpioBase=${ZQSFP_PORT0_15_ABS_GPIO_IDX}
|
||||
gpioBase=$((${GPIO_OFFSET}+${ZQSFP_PORT0_15_ABS_GPIO_IDX}))
|
||||
#gpioBase=${ZQSFP_PORT0_15_ABS_GPIO_IDX}
|
||||
;;
|
||||
9|10|11|12|13|14|15|16)
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x20
|
||||
dataAddr=1
|
||||
gpioBase=${ZQSFP_PORT0_15_ABS_GPIO_IDX}
|
||||
gpioBase=$((${GPIO_OFFSET}+${ZQSFP_PORT0_15_ABS_GPIO_IDX}))
|
||||
#gpioBase=${ZQSFP_PORT0_15_ABS_GPIO_IDX}
|
||||
;;
|
||||
17|18|19|20|21|22|23|24)
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x21
|
||||
dataAddr=0
|
||||
gpioBase=${ZQSFP_PORT16_31_ABS_GPIO_IDX}
|
||||
gpioBase=$((${GPIO_OFFSET}+${ZQSFP_PORT16_31_ABS_GPIO_IDX}))
|
||||
#gpioBase=${ZQSFP_PORT16_31_ABS_GPIO_IDX}
|
||||
;;
|
||||
25|26|27|28|29|30|31|32)
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x21
|
||||
dataAddr=1
|
||||
gpioBase=${ZQSFP_PORT16_31_ABS_GPIO_IDX}
|
||||
gpioBase=$((${GPIO_OFFSET}+${ZQSFP_PORT16_31_ABS_GPIO_IDX}))
|
||||
#gpioBase=${ZQSFP_PORT16_31_ABS_GPIO_IDX}
|
||||
;;
|
||||
33|34|35|36|37|38|39|40)
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x22
|
||||
dataAddr=0
|
||||
gpioBase=${ZQSFP_PORT32_47_ABS_GPIO_IDX}
|
||||
gpioBase=$((${GPIO_OFFSET}+${ZQSFP_PORT32_47_ABS_GPIO_IDX}))
|
||||
#gpioBase=${ZQSFP_PORT32_47_ABS_GPIO_IDX}
|
||||
;;
|
||||
41|42|43|44|45|46|47|48)
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x22
|
||||
dataAddr=1
|
||||
gpioBase=${ZQSFP_PORT32_47_ABS_GPIO_IDX}
|
||||
gpioBase=$((${GPIO_OFFSET}+${ZQSFP_PORT32_47_ABS_GPIO_IDX}))
|
||||
#gpioBase=${ZQSFP_PORT32_47_ABS_GPIO_IDX}
|
||||
;;
|
||||
49|50|51|52|53|54)
|
||||
i2cbus=${NUM_MUX2_CHAN0_DEVICE}
|
||||
regAddr=0x23
|
||||
dataAddr=0
|
||||
gpioBase=$((240 - 48))
|
||||
gpioBase=$((${GPIO_OFFSET}+240-48))
|
||||
#gpioBase=$((240 - 48))
|
||||
;;
|
||||
*)
|
||||
echo "Please input 1~54"
|
||||
@ -1399,6 +1471,7 @@ function _main {
|
||||
tart_time_str=`date`
|
||||
start_time_sec=$(date +%s)
|
||||
|
||||
_set_gpio_offset
|
||||
if [ "${EXEC_FUNC}" == "help" ]; then
|
||||
_help
|
||||
elif [ "${EXEC_FUNC}" == "i2c_init" ]; then
|
||||
@ -1472,6 +1545,8 @@ function _main {
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" == "on" ]; then
|
||||
echo "-----------------------------------------------------"
|
||||
end_time_str=`date`
|
||||
end_time_sec=$(date +%s)
|
||||
diff_time=$[ ${end_time_sec} - ${start_time_sec} ]
|
||||
@ -1480,6 +1555,7 @@ function _main {
|
||||
echo "Total Execution Time: ${diff_time} sec"
|
||||
|
||||
echo "done!!!"
|
||||
fi
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -15,6 +15,9 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# trun on for more debug output
|
||||
#DEBUG="on"
|
||||
|
||||
VERSION="1.0.0"
|
||||
TRUE=200
|
||||
FALSE=404
|
||||
@ -1144,6 +1147,8 @@ function _main {
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" == "on" ]; then
|
||||
echo "-----------------------------------------------------"
|
||||
end_time_str=`date`
|
||||
end_time_sec=$(date +%s)
|
||||
diff_time=$[ ${end_time_sec} - ${start_time_sec} ]
|
||||
@ -1152,6 +1157,7 @@ function _main {
|
||||
echo "Total Execution Time: ${diff_time} sec"
|
||||
|
||||
echo "done!!!"
|
||||
fi
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -15,7 +15,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
VERSION="1.0.0"
|
||||
# trun on for more debug output
|
||||
#DEBUG="on"
|
||||
|
||||
VERSION="1.1.0"
|
||||
TRUE=200
|
||||
FALSE=404
|
||||
|
||||
@ -78,10 +81,14 @@ PSU_DC_OFF=0
|
||||
PSU_EXIST=1
|
||||
PSU_NOT_EXIST=0
|
||||
|
||||
#GPIO Offset
|
||||
GPIO_OFFSET=0
|
||||
|
||||
# Help usage function
|
||||
function _help {
|
||||
echo "========================================================="
|
||||
echo "# Description: Help Function"
|
||||
echo "# Version : ${VERSION}"
|
||||
echo "========================================================="
|
||||
echo "----------------------------------------------------"
|
||||
echo "EX : ${0} help"
|
||||
@ -191,7 +198,9 @@ function _i2c_init {
|
||||
modprobe gpio-pca953x
|
||||
_i2c_fan_init
|
||||
_i2c_io_exp_init
|
||||
rmmod gpio_ich
|
||||
_i2c_gpio_init
|
||||
modprobe gpio_ich
|
||||
_i2c_cpld_init
|
||||
_i2c_qsfp_eeprom_init "new"
|
||||
_i2c_mb_eeprom_init "new"
|
||||
@ -367,351 +376,420 @@ function _i2c_io_exp_init {
|
||||
i2cset -y -r ${NUM_MUX1_CHAN7_DEVICE} 0x20 7 0xCC
|
||||
}
|
||||
|
||||
# To set the global variable GPIO_OFFSET
|
||||
function _set_gpio_offset {
|
||||
GPIO_OFFSET=0
|
||||
for d in `ls /sys/class/gpio/ | grep gpiochip`
|
||||
do
|
||||
gpiochip_no=${d##gpiochip}
|
||||
if [ $gpiochip_no -gt 255 ]; then
|
||||
GPIO_OFFSET=256
|
||||
break
|
||||
fi
|
||||
done
|
||||
#echo "set GPIO_OFFSET=${GPIO_OFFSET}"
|
||||
}
|
||||
|
||||
#GPIO Init
|
||||
function _i2c_gpio_init {
|
||||
#ABS Port 0-15
|
||||
#ABS Port 0-15 (zQSFP00 ~ zQSFP15)
|
||||
echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
echo 240 > /sys/class/gpio/export
|
||||
echo 241 > /sys/class/gpio/export
|
||||
echo 242 > /sys/class/gpio/export
|
||||
echo 243 > /sys/class/gpio/export
|
||||
echo 244 > /sys/class/gpio/export
|
||||
echo 245 > /sys/class/gpio/export
|
||||
echo 246 > /sys/class/gpio/export
|
||||
echo 247 > /sys/class/gpio/export
|
||||
echo 248 > /sys/class/gpio/export
|
||||
echo 249 > /sys/class/gpio/export
|
||||
echo 250 > /sys/class/gpio/export
|
||||
echo 251 > /sys/class/gpio/export
|
||||
echo 252 > /sys/class/gpio/export
|
||||
echo 253 > /sys/class/gpio/export
|
||||
echo 254 > /sys/class/gpio/export
|
||||
echo 255 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio241/active_low #zQSFP00
|
||||
echo 1 > /sys/class/gpio/gpio240/active_low #zQSFP01
|
||||
echo 1 > /sys/class/gpio/gpio243/active_low #zQSFP02
|
||||
echo 1 > /sys/class/gpio/gpio242/active_low #zQSFP03
|
||||
echo 1 > /sys/class/gpio/gpio245/active_low #zQSFP04
|
||||
echo 1 > /sys/class/gpio/gpio244/active_low #zQSFP05
|
||||
echo 1 > /sys/class/gpio/gpio247/active_low #zQSFP06
|
||||
echo 1 > /sys/class/gpio/gpio246/active_low #zQSFP07
|
||||
echo 1 > /sys/class/gpio/gpio249/active_low #zQSFP08
|
||||
echo 1 > /sys/class/gpio/gpio248/active_low #zQSFP09
|
||||
echo 1 > /sys/class/gpio/gpio251/active_low #zQSFP10
|
||||
echo 1 > /sys/class/gpio/gpio250/active_low #zQSFP11
|
||||
echo 1 > /sys/class/gpio/gpio253/active_low #zQSFP12
|
||||
echo 1 > /sys/class/gpio/gpio252/active_low #zQSFP13
|
||||
echo 1 > /sys/class/gpio/gpio255/active_low #zQSFP14
|
||||
echo 1 > /sys/class/gpio/gpio254/active_low #zQSFP15
|
||||
_set_gpio_offset
|
||||
for((i=${GPIO_OFFSET}+240;i<=${GPIO_OFFSET}+255;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#ABS Port 16-31
|
||||
#echo 240 > /sys/class/gpio/export
|
||||
#echo 241 > /sys/class/gpio/export
|
||||
#echo 242 > /sys/class/gpio/export
|
||||
#echo 243 > /sys/class/gpio/export
|
||||
#echo 244 > /sys/class/gpio/export
|
||||
#echo 245 > /sys/class/gpio/export
|
||||
#echo 246 > /sys/class/gpio/export
|
||||
#echo 247 > /sys/class/gpio/export
|
||||
#echo 248 > /sys/class/gpio/export
|
||||
#echo 249 > /sys/class/gpio/export
|
||||
#echo 250 > /sys/class/gpio/export
|
||||
#echo 251 > /sys/class/gpio/export
|
||||
#echo 252 > /sys/class/gpio/export
|
||||
#echo 253 > /sys/class/gpio/export
|
||||
#echo 254 > /sys/class/gpio/export
|
||||
#echo 255 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio241/active_low #zQSFP00
|
||||
#echo 1 > /sys/class/gpio/gpio240/active_low #zQSFP01
|
||||
#echo 1 > /sys/class/gpio/gpio243/active_low #zQSFP02
|
||||
#echo 1 > /sys/class/gpio/gpio242/active_low #zQSFP03
|
||||
#echo 1 > /sys/class/gpio/gpio245/active_low #zQSFP04
|
||||
#echo 1 > /sys/class/gpio/gpio244/active_low #zQSFP05
|
||||
#echo 1 > /sys/class/gpio/gpio247/active_low #zQSFP06
|
||||
#echo 1 > /sys/class/gpio/gpio246/active_low #zQSFP07
|
||||
#echo 1 > /sys/class/gpio/gpio249/active_low #zQSFP08
|
||||
#echo 1 > /sys/class/gpio/gpio248/active_low #zQSFP09
|
||||
#echo 1 > /sys/class/gpio/gpio251/active_low #zQSFP10
|
||||
#echo 1 > /sys/class/gpio/gpio250/active_low #zQSFP11
|
||||
#echo 1 > /sys/class/gpio/gpio253/active_low #zQSFP12
|
||||
#echo 1 > /sys/class/gpio/gpio252/active_low #zQSFP13
|
||||
#echo 1 > /sys/class/gpio/gpio255/active_low #zQSFP14
|
||||
#echo 1 > /sys/class/gpio/gpio254/active_low #zQSFP15
|
||||
|
||||
#ABS Port 16-31 (zQSFP16 ~ zQSFP31)
|
||||
echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
echo 224 > /sys/class/gpio/export
|
||||
echo 225 > /sys/class/gpio/export
|
||||
echo 226 > /sys/class/gpio/export
|
||||
echo 227 > /sys/class/gpio/export
|
||||
echo 228 > /sys/class/gpio/export
|
||||
echo 229 > /sys/class/gpio/export
|
||||
echo 230 > /sys/class/gpio/export
|
||||
echo 231 > /sys/class/gpio/export
|
||||
echo 232 > /sys/class/gpio/export
|
||||
echo 233 > /sys/class/gpio/export
|
||||
echo 234 > /sys/class/gpio/export
|
||||
echo 235 > /sys/class/gpio/export
|
||||
echo 236 > /sys/class/gpio/export
|
||||
echo 237 > /sys/class/gpio/export
|
||||
echo 238 > /sys/class/gpio/export
|
||||
echo 239 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio225/active_low #zQSFP16
|
||||
echo 1 > /sys/class/gpio/gpio224/active_low #zQSFP17
|
||||
echo 1 > /sys/class/gpio/gpio227/active_low #zQSFP18
|
||||
echo 1 > /sys/class/gpio/gpio226/active_low #zQSFP19
|
||||
echo 1 > /sys/class/gpio/gpio229/active_low #zQSFP20
|
||||
echo 1 > /sys/class/gpio/gpio228/active_low #zQSFP21
|
||||
echo 1 > /sys/class/gpio/gpio231/active_low #zQSFP22
|
||||
echo 1 > /sys/class/gpio/gpio230/active_low #zQSFP23
|
||||
echo 1 > /sys/class/gpio/gpio233/active_low #zQSFP24
|
||||
echo 1 > /sys/class/gpio/gpio232/active_low #zQSFP25
|
||||
echo 1 > /sys/class/gpio/gpio235/active_low #zQSFP26
|
||||
echo 1 > /sys/class/gpio/gpio234/active_low #zQSFP27
|
||||
echo 1 > /sys/class/gpio/gpio237/active_low #zQSFP28
|
||||
echo 1 > /sys/class/gpio/gpio236/active_low #zQSFP29
|
||||
echo 1 > /sys/class/gpio/gpio239/active_low #zQSFP30
|
||||
echo 1 > /sys/class/gpio/gpio238/active_low #zQSFP31
|
||||
for((i=${GPIO_OFFSET}+224;i<=${GPIO_OFFSET}+239;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#INT Port 0-15
|
||||
#echo 224 > /sys/class/gpio/export
|
||||
#echo 225 > /sys/class/gpio/export
|
||||
#echo 226 > /sys/class/gpio/export
|
||||
#echo 227 > /sys/class/gpio/export
|
||||
#echo 228 > /sys/class/gpio/export
|
||||
#echo 229 > /sys/class/gpio/export
|
||||
#echo 230 > /sys/class/gpio/export
|
||||
#echo 231 > /sys/class/gpio/export
|
||||
#echo 232 > /sys/class/gpio/export
|
||||
#echo 233 > /sys/class/gpio/export
|
||||
#echo 234 > /sys/class/gpio/export
|
||||
#echo 235 > /sys/class/gpio/export
|
||||
#echo 236 > /sys/class/gpio/export
|
||||
#echo 237 > /sys/class/gpio/export
|
||||
#echo 238 > /sys/class/gpio/export
|
||||
#echo 239 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio225/active_low #zQSFP16
|
||||
#echo 1 > /sys/class/gpio/gpio224/active_low #zQSFP17
|
||||
#echo 1 > /sys/class/gpio/gpio227/active_low #zQSFP18
|
||||
#echo 1 > /sys/class/gpio/gpio226/active_low #zQSFP19
|
||||
#echo 1 > /sys/class/gpio/gpio229/active_low #zQSFP20
|
||||
#echo 1 > /sys/class/gpio/gpio228/active_low #zQSFP21
|
||||
#echo 1 > /sys/class/gpio/gpio231/active_low #zQSFP22
|
||||
#echo 1 > /sys/class/gpio/gpio230/active_low #zQSFP23
|
||||
#echo 1 > /sys/class/gpio/gpio233/active_low #zQSFP24
|
||||
#echo 1 > /sys/class/gpio/gpio232/active_low #zQSFP25
|
||||
#echo 1 > /sys/class/gpio/gpio235/active_low #zQSFP26
|
||||
#echo 1 > /sys/class/gpio/gpio234/active_low #zQSFP27
|
||||
#echo 1 > /sys/class/gpio/gpio237/active_low #zQSFP28
|
||||
#echo 1 > /sys/class/gpio/gpio236/active_low #zQSFP29
|
||||
#echo 1 > /sys/class/gpio/gpio239/active_low #zQSFP30
|
||||
#echo 1 > /sys/class/gpio/gpio238/active_low #zQSFP31
|
||||
|
||||
#INT Port 0-15 (zQSFP00 ~ zQSFP15)
|
||||
echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
echo 208 > /sys/class/gpio/export
|
||||
echo 209 > /sys/class/gpio/export
|
||||
echo 210 > /sys/class/gpio/export
|
||||
echo 211 > /sys/class/gpio/export
|
||||
echo 212 > /sys/class/gpio/export
|
||||
echo 213 > /sys/class/gpio/export
|
||||
echo 214 > /sys/class/gpio/export
|
||||
echo 215 > /sys/class/gpio/export
|
||||
echo 216 > /sys/class/gpio/export
|
||||
echo 217 > /sys/class/gpio/export
|
||||
echo 218 > /sys/class/gpio/export
|
||||
echo 219 > /sys/class/gpio/export
|
||||
echo 220 > /sys/class/gpio/export
|
||||
echo 221 > /sys/class/gpio/export
|
||||
echo 222 > /sys/class/gpio/export
|
||||
echo 223 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio208/active_low
|
||||
echo 1 > /sys/class/gpio/gpio209/active_low
|
||||
echo 1 > /sys/class/gpio/gpio210/active_low
|
||||
echo 1 > /sys/class/gpio/gpio211/active_low
|
||||
echo 1 > /sys/class/gpio/gpio212/active_low
|
||||
echo 1 > /sys/class/gpio/gpio213/active_low
|
||||
echo 1 > /sys/class/gpio/gpio214/active_low
|
||||
echo 1 > /sys/class/gpio/gpio215/active_low
|
||||
echo 1 > /sys/class/gpio/gpio216/active_low
|
||||
echo 1 > /sys/class/gpio/gpio217/active_low
|
||||
echo 1 > /sys/class/gpio/gpio218/active_low
|
||||
echo 1 > /sys/class/gpio/gpio219/active_low
|
||||
echo 1 > /sys/class/gpio/gpio220/active_low
|
||||
echo 1 > /sys/class/gpio/gpio221/active_low
|
||||
echo 1 > /sys/class/gpio/gpio222/active_low
|
||||
echo 1 > /sys/class/gpio/gpio223/active_low
|
||||
for((i=${GPIO_OFFSET}+208;i<=${GPIO_OFFSET}+223;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#INT Port 16-31
|
||||
#echo 208 > /sys/class/gpio/export
|
||||
#echo 209 > /sys/class/gpio/export
|
||||
#echo 210 > /sys/class/gpio/export
|
||||
#echo 211 > /sys/class/gpio/export
|
||||
#echo 212 > /sys/class/gpio/export
|
||||
#echo 213 > /sys/class/gpio/export
|
||||
#echo 214 > /sys/class/gpio/export
|
||||
#echo 215 > /sys/class/gpio/export
|
||||
#echo 216 > /sys/class/gpio/export
|
||||
#echo 217 > /sys/class/gpio/export
|
||||
#echo 218 > /sys/class/gpio/export
|
||||
#echo 219 > /sys/class/gpio/export
|
||||
#echo 220 > /sys/class/gpio/export
|
||||
#echo 221 > /sys/class/gpio/export
|
||||
#echo 222 > /sys/class/gpio/export
|
||||
#echo 223 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio208/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio209/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio210/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio211/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio212/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio213/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio214/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio215/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio216/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio217/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio218/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio219/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio220/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio221/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio222/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio223/active_low
|
||||
|
||||
#INT Port 16-31 (zQSFP16 ~ zQSFP31)
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN4_DEVICE}/new_device
|
||||
echo 192 > /sys/class/gpio/export
|
||||
echo 193 > /sys/class/gpio/export
|
||||
echo 194 > /sys/class/gpio/export
|
||||
echo 195 > /sys/class/gpio/export
|
||||
echo 196 > /sys/class/gpio/export
|
||||
echo 197 > /sys/class/gpio/export
|
||||
echo 198 > /sys/class/gpio/export
|
||||
echo 199 > /sys/class/gpio/export
|
||||
echo 200 > /sys/class/gpio/export
|
||||
echo 201 > /sys/class/gpio/export
|
||||
echo 202 > /sys/class/gpio/export
|
||||
echo 203 > /sys/class/gpio/export
|
||||
echo 204 > /sys/class/gpio/export
|
||||
echo 205 > /sys/class/gpio/export
|
||||
echo 206 > /sys/class/gpio/export
|
||||
echo 207 > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio192/active_low
|
||||
echo 1 > /sys/class/gpio/gpio193/active_low
|
||||
echo 1 > /sys/class/gpio/gpio194/active_low
|
||||
echo 1 > /sys/class/gpio/gpio195/active_low
|
||||
echo 1 > /sys/class/gpio/gpio196/active_low
|
||||
echo 1 > /sys/class/gpio/gpio197/active_low
|
||||
echo 1 > /sys/class/gpio/gpio198/active_low
|
||||
echo 1 > /sys/class/gpio/gpio199/active_low
|
||||
echo 1 > /sys/class/gpio/gpio200/active_low
|
||||
echo 1 > /sys/class/gpio/gpio201/active_low
|
||||
echo 1 > /sys/class/gpio/gpio202/active_low
|
||||
echo 1 > /sys/class/gpio/gpio203/active_low
|
||||
echo 1 > /sys/class/gpio/gpio204/active_low
|
||||
echo 1 > /sys/class/gpio/gpio205/active_low
|
||||
echo 1 > /sys/class/gpio/gpio206/active_low
|
||||
echo 1 > /sys/class/gpio/gpio207/active_low
|
||||
for((i=${GPIO_OFFSET}+192;i<=${GPIO_OFFSET}+207;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
done
|
||||
|
||||
#echo 192 > /sys/class/gpio/export
|
||||
#echo 193 > /sys/class/gpio/export
|
||||
#echo 194 > /sys/class/gpio/export
|
||||
#echo 195 > /sys/class/gpio/export
|
||||
#echo 196 > /sys/class/gpio/export
|
||||
#echo 197 > /sys/class/gpio/export
|
||||
#echo 198 > /sys/class/gpio/export
|
||||
#echo 199 > /sys/class/gpio/export
|
||||
#echo 200 > /sys/class/gpio/export
|
||||
#echo 201 > /sys/class/gpio/export
|
||||
#echo 202 > /sys/class/gpio/export
|
||||
#echo 203 > /sys/class/gpio/export
|
||||
#echo 204 > /sys/class/gpio/export
|
||||
#echo 205 > /sys/class/gpio/export
|
||||
#echo 206 > /sys/class/gpio/export
|
||||
#echo 207 > /sys/class/gpio/export
|
||||
#echo 1 > /sys/class/gpio/gpio192/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio193/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio194/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio195/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio196/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio197/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio198/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio199/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio200/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio201/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio202/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio203/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio204/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio205/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio206/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio207/active_low
|
||||
|
||||
#LP Mode Port 0-15
|
||||
echo "pca9535 0x20" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
echo 176 > /sys/class/gpio/export
|
||||
echo 177 > /sys/class/gpio/export
|
||||
echo 178 > /sys/class/gpio/export
|
||||
echo 179 > /sys/class/gpio/export
|
||||
echo 180 > /sys/class/gpio/export
|
||||
echo 181 > /sys/class/gpio/export
|
||||
echo 182 > /sys/class/gpio/export
|
||||
echo 183 > /sys/class/gpio/export
|
||||
echo 184 > /sys/class/gpio/export
|
||||
echo 185 > /sys/class/gpio/export
|
||||
echo 186 > /sys/class/gpio/export
|
||||
echo 187 > /sys/class/gpio/export
|
||||
echo 188 > /sys/class/gpio/export
|
||||
echo 189 > /sys/class/gpio/export
|
||||
echo 190 > /sys/class/gpio/export
|
||||
echo 191 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio176/direction
|
||||
echo out > /sys/class/gpio/gpio177/direction
|
||||
echo out > /sys/class/gpio/gpio178/direction
|
||||
echo out > /sys/class/gpio/gpio179/direction
|
||||
echo out > /sys/class/gpio/gpio180/direction
|
||||
echo out > /sys/class/gpio/gpio181/direction
|
||||
echo out > /sys/class/gpio/gpio182/direction
|
||||
echo out > /sys/class/gpio/gpio183/direction
|
||||
echo out > /sys/class/gpio/gpio184/direction
|
||||
echo out > /sys/class/gpio/gpio185/direction
|
||||
echo out > /sys/class/gpio/gpio186/direction
|
||||
echo out > /sys/class/gpio/gpio187/direction
|
||||
echo out > /sys/class/gpio/gpio188/direction
|
||||
echo out > /sys/class/gpio/gpio189/direction
|
||||
echo out > /sys/class/gpio/gpio190/direction
|
||||
echo out > /sys/class/gpio/gpio191/direction
|
||||
for((i=${GPIO_OFFSET}+176;i<=${GPIO_OFFSET}+191;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
done
|
||||
|
||||
#echo 176 > /sys/class/gpio/export
|
||||
#echo 177 > /sys/class/gpio/export
|
||||
#echo 178 > /sys/class/gpio/export
|
||||
#echo 179 > /sys/class/gpio/export
|
||||
#echo 180 > /sys/class/gpio/export
|
||||
#echo 181 > /sys/class/gpio/export
|
||||
#echo 182 > /sys/class/gpio/export
|
||||
#echo 183 > /sys/class/gpio/export
|
||||
#echo 184 > /sys/class/gpio/export
|
||||
#echo 185 > /sys/class/gpio/export
|
||||
#echo 186 > /sys/class/gpio/export
|
||||
#echo 187 > /sys/class/gpio/export
|
||||
#echo 188 > /sys/class/gpio/export
|
||||
#echo 189 > /sys/class/gpio/export
|
||||
#echo 190 > /sys/class/gpio/export
|
||||
#echo 191 > /sys/class/gpio/export
|
||||
#echo out > /sys/class/gpio/gpio176/direction
|
||||
#echo out > /sys/class/gpio/gpio177/direction
|
||||
#echo out > /sys/class/gpio/gpio178/direction
|
||||
#echo out > /sys/class/gpio/gpio179/direction
|
||||
#echo out > /sys/class/gpio/gpio180/direction
|
||||
#echo out > /sys/class/gpio/gpio181/direction
|
||||
#echo out > /sys/class/gpio/gpio182/direction
|
||||
#echo out > /sys/class/gpio/gpio183/direction
|
||||
#echo out > /sys/class/gpio/gpio184/direction
|
||||
#echo out > /sys/class/gpio/gpio185/direction
|
||||
#echo out > /sys/class/gpio/gpio186/direction
|
||||
#echo out > /sys/class/gpio/gpio187/direction
|
||||
#echo out > /sys/class/gpio/gpio188/direction
|
||||
#echo out > /sys/class/gpio/gpio189/direction
|
||||
#echo out > /sys/class/gpio/gpio190/direction
|
||||
#echo out > /sys/class/gpio/gpio191/direction
|
||||
|
||||
#LP Mode Port 16-31
|
||||
echo "pca9535 0x21" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
echo 160 > /sys/class/gpio/export
|
||||
echo 161 > /sys/class/gpio/export
|
||||
echo 162 > /sys/class/gpio/export
|
||||
echo 163 > /sys/class/gpio/export
|
||||
echo 164 > /sys/class/gpio/export
|
||||
echo 165 > /sys/class/gpio/export
|
||||
echo 166 > /sys/class/gpio/export
|
||||
echo 167 > /sys/class/gpio/export
|
||||
echo 168 > /sys/class/gpio/export
|
||||
echo 169 > /sys/class/gpio/export
|
||||
echo 170 > /sys/class/gpio/export
|
||||
echo 171 > /sys/class/gpio/export
|
||||
echo 172 > /sys/class/gpio/export
|
||||
echo 173 > /sys/class/gpio/export
|
||||
echo 174 > /sys/class/gpio/export
|
||||
echo 175 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio160/direction
|
||||
echo out > /sys/class/gpio/gpio161/direction
|
||||
echo out > /sys/class/gpio/gpio162/direction
|
||||
echo out > /sys/class/gpio/gpio163/direction
|
||||
echo out > /sys/class/gpio/gpio164/direction
|
||||
echo out > /sys/class/gpio/gpio165/direction
|
||||
echo out > /sys/class/gpio/gpio166/direction
|
||||
echo out > /sys/class/gpio/gpio167/direction
|
||||
echo out > /sys/class/gpio/gpio168/direction
|
||||
echo out > /sys/class/gpio/gpio169/direction
|
||||
echo out > /sys/class/gpio/gpio170/direction
|
||||
echo out > /sys/class/gpio/gpio171/direction
|
||||
echo out > /sys/class/gpio/gpio172/direction
|
||||
echo out > /sys/class/gpio/gpio173/direction
|
||||
echo out > /sys/class/gpio/gpio174/direction
|
||||
echo out > /sys/class/gpio/gpio175/direction
|
||||
for((i=${GPIO_OFFSET}+160;i<=${GPIO_OFFSET}+175;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${i}/direction
|
||||
done
|
||||
|
||||
#echo 160 > /sys/class/gpio/export
|
||||
#echo 161 > /sys/class/gpio/export
|
||||
#echo 162 > /sys/class/gpio/export
|
||||
#echo 163 > /sys/class/gpio/export
|
||||
#echo 164 > /sys/class/gpio/export
|
||||
#echo 165 > /sys/class/gpio/export
|
||||
#echo 166 > /sys/class/gpio/export
|
||||
#echo 167 > /sys/class/gpio/export
|
||||
#echo 168 > /sys/class/gpio/export
|
||||
#echo 169 > /sys/class/gpio/export
|
||||
#echo 170 > /sys/class/gpio/export
|
||||
#echo 171 > /sys/class/gpio/export
|
||||
#echo 172 > /sys/class/gpio/export
|
||||
#echo 173 > /sys/class/gpio/export
|
||||
#echo 174 > /sys/class/gpio/export
|
||||
#echo 175 > /sys/class/gpio/export
|
||||
#echo out > /sys/class/gpio/gpio160/direction
|
||||
#echo out > /sys/class/gpio/gpio161/direction
|
||||
#echo out > /sys/class/gpio/gpio162/direction
|
||||
#echo out > /sys/class/gpio/gpio163/direction
|
||||
#echo out > /sys/class/gpio/gpio164/direction
|
||||
#echo out > /sys/class/gpio/gpio165/direction
|
||||
#echo out > /sys/class/gpio/gpio166/direction
|
||||
#echo out > /sys/class/gpio/gpio167/direction
|
||||
#echo out > /sys/class/gpio/gpio168/direction
|
||||
#echo out > /sys/class/gpio/gpio169/direction
|
||||
#echo out > /sys/class/gpio/gpio170/direction
|
||||
#echo out > /sys/class/gpio/gpio171/direction
|
||||
#echo out > /sys/class/gpio/gpio172/direction
|
||||
#echo out > /sys/class/gpio/gpio173/direction
|
||||
#echo out > /sys/class/gpio/gpio174/direction
|
||||
#echo out > /sys/class/gpio/gpio175/direction
|
||||
|
||||
#RST Port 0-15
|
||||
echo "pca9535 0x22" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
echo 144 > /sys/class/gpio/export
|
||||
echo 145 > /sys/class/gpio/export
|
||||
echo 146 > /sys/class/gpio/export
|
||||
echo 147 > /sys/class/gpio/export
|
||||
echo 148 > /sys/class/gpio/export
|
||||
echo 149 > /sys/class/gpio/export
|
||||
echo 150 > /sys/class/gpio/export
|
||||
echo 151 > /sys/class/gpio/export
|
||||
echo 152 > /sys/class/gpio/export
|
||||
echo 153 > /sys/class/gpio/export
|
||||
echo 154 > /sys/class/gpio/export
|
||||
echo 155 > /sys/class/gpio/export
|
||||
echo 156 > /sys/class/gpio/export
|
||||
echo 157 > /sys/class/gpio/export
|
||||
echo 158 > /sys/class/gpio/export
|
||||
echo 159 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio144/direction
|
||||
echo out > /sys/class/gpio/gpio145/direction
|
||||
echo out > /sys/class/gpio/gpio146/direction
|
||||
echo out > /sys/class/gpio/gpio147/direction
|
||||
echo out > /sys/class/gpio/gpio148/direction
|
||||
echo out > /sys/class/gpio/gpio149/direction
|
||||
echo out > /sys/class/gpio/gpio150/direction
|
||||
echo out > /sys/class/gpio/gpio151/direction
|
||||
echo out > /sys/class/gpio/gpio152/direction
|
||||
echo out > /sys/class/gpio/gpio153/direction
|
||||
echo out > /sys/class/gpio/gpio154/direction
|
||||
echo out > /sys/class/gpio/gpio155/direction
|
||||
echo out > /sys/class/gpio/gpio156/direction
|
||||
echo out > /sys/class/gpio/gpio157/direction
|
||||
echo out > /sys/class/gpio/gpio158/direction
|
||||
echo out > /sys/class/gpio/gpio159/direction
|
||||
echo 1 > /sys/class/gpio/gpio144/active_low
|
||||
echo 1 > /sys/class/gpio/gpio145/active_low
|
||||
echo 1 > /sys/class/gpio/gpio146/active_low
|
||||
echo 1 > /sys/class/gpio/gpio147/active_low
|
||||
echo 1 > /sys/class/gpio/gpio148/active_low
|
||||
echo 1 > /sys/class/gpio/gpio149/active_low
|
||||
echo 1 > /sys/class/gpio/gpio150/active_low
|
||||
echo 1 > /sys/class/gpio/gpio151/active_low
|
||||
echo 1 > /sys/class/gpio/gpio152/active_low
|
||||
echo 1 > /sys/class/gpio/gpio153/active_low
|
||||
echo 1 > /sys/class/gpio/gpio154/active_low
|
||||
echo 1 > /sys/class/gpio/gpio155/active_low
|
||||
echo 1 > /sys/class/gpio/gpio156/active_low
|
||||
echo 1 > /sys/class/gpio/gpio157/active_low
|
||||
echo 1 > /sys/class/gpio/gpio158/active_low
|
||||
echo 1 > /sys/class/gpio/gpio159/active_low
|
||||
echo 0 > /sys/class/gpio/gpio144/value
|
||||
echo 0 > /sys/class/gpio/gpio145/value
|
||||
echo 0 > /sys/class/gpio/gpio146/value
|
||||
echo 0 > /sys/class/gpio/gpio147/value
|
||||
echo 0 > /sys/class/gpio/gpio148/value
|
||||
echo 0 > /sys/class/gpio/gpio149/value
|
||||
echo 0 > /sys/class/gpio/gpio150/value
|
||||
echo 0 > /sys/class/gpio/gpio151/value
|
||||
echo 0 > /sys/class/gpio/gpio152/value
|
||||
echo 0 > /sys/class/gpio/gpio153/value
|
||||
echo 0 > /sys/class/gpio/gpio154/value
|
||||
echo 0 > /sys/class/gpio/gpio155/value
|
||||
echo 0 > /sys/class/gpio/gpio156/value
|
||||
echo 0 > /sys/class/gpio/gpio157/value
|
||||
echo 0 > /sys/class/gpio/gpio158/value
|
||||
echo 0 > /sys/class/gpio/gpio159/value
|
||||
for((i=${GPIO_OFFSET}+144;i<=${GPIO_OFFSET}+159;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
echo low > /sys/class/gpio/gpio${i}/direction
|
||||
#echo out > /sys/class/gpio/gpio${i}/direction
|
||||
#echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
done
|
||||
|
||||
#echo 144 > /sys/class/gpio/export
|
||||
#echo 145 > /sys/class/gpio/export
|
||||
#echo 146 > /sys/class/gpio/export
|
||||
#echo 147 > /sys/class/gpio/export
|
||||
#echo 148 > /sys/class/gpio/export
|
||||
#echo 149 > /sys/class/gpio/export
|
||||
#echo 150 > /sys/class/gpio/export
|
||||
#echo 151 > /sys/class/gpio/export
|
||||
#echo 152 > /sys/class/gpio/export
|
||||
#echo 153 > /sys/class/gpio/export
|
||||
#echo 154 > /sys/class/gpio/export
|
||||
#echo 155 > /sys/class/gpio/export
|
||||
#echo 156 > /sys/class/gpio/export
|
||||
#echo 157 > /sys/class/gpio/export
|
||||
#echo 158 > /sys/class/gpio/export
|
||||
#echo 159 > /sys/class/gpio/export
|
||||
#echo out > /sys/class/gpio/gpio144/direction
|
||||
#echo out > /sys/class/gpio/gpio145/direction
|
||||
#echo out > /sys/class/gpio/gpio146/direction
|
||||
#echo out > /sys/class/gpio/gpio147/direction
|
||||
#echo out > /sys/class/gpio/gpio148/direction
|
||||
#echo out > /sys/class/gpio/gpio149/direction
|
||||
#echo out > /sys/class/gpio/gpio150/direction
|
||||
#echo out > /sys/class/gpio/gpio151/direction
|
||||
#echo out > /sys/class/gpio/gpio152/direction
|
||||
#echo out > /sys/class/gpio/gpio153/direction
|
||||
#echo out > /sys/class/gpio/gpio154/direction
|
||||
#echo out > /sys/class/gpio/gpio155/direction
|
||||
#echo out > /sys/class/gpio/gpio156/direction
|
||||
#echo out > /sys/class/gpio/gpio157/direction
|
||||
#echo out > /sys/class/gpio/gpio158/direction
|
||||
#echo out > /sys/class/gpio/gpio159/direction
|
||||
#echo 1 > /sys/class/gpio/gpio144/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio145/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio146/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio147/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio148/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio149/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio150/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio151/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio152/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio153/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio154/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio155/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio156/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio157/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio158/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio159/active_low
|
||||
#echo 0 > /sys/class/gpio/gpio144/value
|
||||
#echo 0 > /sys/class/gpio/gpio145/value
|
||||
#echo 0 > /sys/class/gpio/gpio146/value
|
||||
#echo 0 > /sys/class/gpio/gpio147/value
|
||||
#echo 0 > /sys/class/gpio/gpio148/value
|
||||
#echo 0 > /sys/class/gpio/gpio149/value
|
||||
#echo 0 > /sys/class/gpio/gpio150/value
|
||||
#echo 0 > /sys/class/gpio/gpio151/value
|
||||
#echo 0 > /sys/class/gpio/gpio152/value
|
||||
#echo 0 > /sys/class/gpio/gpio153/value
|
||||
#echo 0 > /sys/class/gpio/gpio154/value
|
||||
#echo 0 > /sys/class/gpio/gpio155/value
|
||||
#echo 0 > /sys/class/gpio/gpio156/value
|
||||
#echo 0 > /sys/class/gpio/gpio157/value
|
||||
#echo 0 > /sys/class/gpio/gpio158/value
|
||||
#echo 0 > /sys/class/gpio/gpio159/value
|
||||
|
||||
#RST Port 16-31
|
||||
echo "pca9535 0x23" > /sys/bus/i2c/devices/i2c-${NUM_MUX1_CHAN5_DEVICE}/new_device
|
||||
echo 128 > /sys/class/gpio/export
|
||||
echo 129 > /sys/class/gpio/export
|
||||
echo 130 > /sys/class/gpio/export
|
||||
echo 131 > /sys/class/gpio/export
|
||||
echo 132 > /sys/class/gpio/export
|
||||
echo 133 > /sys/class/gpio/export
|
||||
echo 134 > /sys/class/gpio/export
|
||||
echo 135 > /sys/class/gpio/export
|
||||
echo 136 > /sys/class/gpio/export
|
||||
echo 137 > /sys/class/gpio/export
|
||||
echo 138 > /sys/class/gpio/export
|
||||
echo 139 > /sys/class/gpio/export
|
||||
echo 140 > /sys/class/gpio/export
|
||||
echo 141 > /sys/class/gpio/export
|
||||
echo 142 > /sys/class/gpio/export
|
||||
echo 143 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio128/direction
|
||||
echo out > /sys/class/gpio/gpio129/direction
|
||||
echo out > /sys/class/gpio/gpio130/direction
|
||||
echo out > /sys/class/gpio/gpio131/direction
|
||||
echo out > /sys/class/gpio/gpio132/direction
|
||||
echo out > /sys/class/gpio/gpio133/direction
|
||||
echo out > /sys/class/gpio/gpio134/direction
|
||||
echo out > /sys/class/gpio/gpio135/direction
|
||||
echo out > /sys/class/gpio/gpio136/direction
|
||||
echo out > /sys/class/gpio/gpio137/direction
|
||||
echo out > /sys/class/gpio/gpio138/direction
|
||||
echo out > /sys/class/gpio/gpio139/direction
|
||||
echo out > /sys/class/gpio/gpio140/direction
|
||||
echo out > /sys/class/gpio/gpio141/direction
|
||||
echo out > /sys/class/gpio/gpio142/direction
|
||||
echo out > /sys/class/gpio/gpio143/direction
|
||||
echo 1 > /sys/class/gpio/gpio128/active_low
|
||||
echo 1 > /sys/class/gpio/gpio129/active_low
|
||||
echo 1 > /sys/class/gpio/gpio130/active_low
|
||||
echo 1 > /sys/class/gpio/gpio131/active_low
|
||||
echo 1 > /sys/class/gpio/gpio132/active_low
|
||||
echo 1 > /sys/class/gpio/gpio133/active_low
|
||||
echo 1 > /sys/class/gpio/gpio134/active_low
|
||||
echo 1 > /sys/class/gpio/gpio135/active_low
|
||||
echo 1 > /sys/class/gpio/gpio136/active_low
|
||||
echo 1 > /sys/class/gpio/gpio137/active_low
|
||||
echo 1 > /sys/class/gpio/gpio138/active_low
|
||||
echo 1 > /sys/class/gpio/gpio139/active_low
|
||||
echo 1 > /sys/class/gpio/gpio140/active_low
|
||||
echo 1 > /sys/class/gpio/gpio141/active_low
|
||||
echo 1 > /sys/class/gpio/gpio142/active_low
|
||||
echo 1 > /sys/class/gpio/gpio143/active_low
|
||||
echo 0 > /sys/class/gpio/gpio128/value
|
||||
echo 0 > /sys/class/gpio/gpio129/value
|
||||
echo 0 > /sys/class/gpio/gpio130/value
|
||||
echo 0 > /sys/class/gpio/gpio131/value
|
||||
echo 0 > /sys/class/gpio/gpio132/value
|
||||
echo 0 > /sys/class/gpio/gpio133/value
|
||||
echo 0 > /sys/class/gpio/gpio134/value
|
||||
echo 0 > /sys/class/gpio/gpio135/value
|
||||
echo 0 > /sys/class/gpio/gpio136/value
|
||||
echo 0 > /sys/class/gpio/gpio137/value
|
||||
echo 0 > /sys/class/gpio/gpio138/value
|
||||
echo 0 > /sys/class/gpio/gpio139/value
|
||||
echo 0 > /sys/class/gpio/gpio140/value
|
||||
echo 0 > /sys/class/gpio/gpio141/value
|
||||
echo 0 > /sys/class/gpio/gpio142/value
|
||||
echo 0 > /sys/class/gpio/gpio143/value
|
||||
for((i=${GPIO_OFFSET}+128;i<=${GPIO_OFFSET}+143;i++));
|
||||
do
|
||||
echo $i > /sys/class/gpio/export
|
||||
echo 1 > /sys/class/gpio/gpio${i}/active_low
|
||||
echo low > /sys/class/gpio/gpio${i}/direction
|
||||
#echo out > /sys/class/gpio/gpio${i}/direction
|
||||
#echo 0 > /sys/class/gpio/gpio${i}/value
|
||||
done
|
||||
|
||||
#echo 128 > /sys/class/gpio/export
|
||||
#echo 129 > /sys/class/gpio/export
|
||||
#echo 130 > /sys/class/gpio/export
|
||||
#echo 131 > /sys/class/gpio/export
|
||||
#echo 132 > /sys/class/gpio/export
|
||||
#echo 133 > /sys/class/gpio/export
|
||||
#echo 134 > /sys/class/gpio/export
|
||||
#echo 135 > /sys/class/gpio/export
|
||||
#echo 136 > /sys/class/gpio/export
|
||||
#echo 137 > /sys/class/gpio/export
|
||||
#echo 138 > /sys/class/gpio/export
|
||||
#echo 139 > /sys/class/gpio/export
|
||||
#echo 140 > /sys/class/gpio/export
|
||||
#echo 141 > /sys/class/gpio/export
|
||||
#echo 142 > /sys/class/gpio/export
|
||||
#echo 143 > /sys/class/gpio/export
|
||||
#echo out > /sys/class/gpio/gpio128/direction
|
||||
#echo out > /sys/class/gpio/gpio129/direction
|
||||
#echo out > /sys/class/gpio/gpio130/direction
|
||||
#echo out > /sys/class/gpio/gpio131/direction
|
||||
#echo out > /sys/class/gpio/gpio132/direction
|
||||
#echo out > /sys/class/gpio/gpio133/direction
|
||||
#echo out > /sys/class/gpio/gpio134/direction
|
||||
#echo out > /sys/class/gpio/gpio135/direction
|
||||
#echo out > /sys/class/gpio/gpio136/direction
|
||||
#echo out > /sys/class/gpio/gpio137/direction
|
||||
#echo out > /sys/class/gpio/gpio138/direction
|
||||
#echo out > /sys/class/gpio/gpio139/direction
|
||||
#echo out > /sys/class/gpio/gpio140/direction
|
||||
#echo out > /sys/class/gpio/gpio141/direction
|
||||
#echo out > /sys/class/gpio/gpio142/direction
|
||||
#echo out > /sys/class/gpio/gpio143/direction
|
||||
#echo 1 > /sys/class/gpio/gpio128/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio129/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio130/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio131/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio132/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio133/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio134/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio135/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio136/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio137/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio138/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio139/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio140/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio141/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio142/active_low
|
||||
#echo 1 > /sys/class/gpio/gpio143/active_low
|
||||
#echo 0 > /sys/class/gpio/gpio128/value
|
||||
#echo 0 > /sys/class/gpio/gpio129/value
|
||||
#echo 0 > /sys/class/gpio/gpio130/value
|
||||
#echo 0 > /sys/class/gpio/gpio131/value
|
||||
#echo 0 > /sys/class/gpio/gpio132/value
|
||||
#echo 0 > /sys/class/gpio/gpio133/value
|
||||
#echo 0 > /sys/class/gpio/gpio134/value
|
||||
#echo 0 > /sys/class/gpio/gpio135/value
|
||||
#echo 0 > /sys/class/gpio/gpio136/value
|
||||
#echo 0 > /sys/class/gpio/gpio137/value
|
||||
#echo 0 > /sys/class/gpio/gpio138/value
|
||||
#echo 0 > /sys/class/gpio/gpio139/value
|
||||
#echo 0 > /sys/class/gpio/gpio140/value
|
||||
#echo 0 > /sys/class/gpio/gpio141/value
|
||||
#echo 0 > /sys/class/gpio/gpio142/value
|
||||
#echo 0 > /sys/class/gpio/gpio143/value
|
||||
|
||||
}
|
||||
|
||||
@ -1008,41 +1086,48 @@ function _qsfp_port_i2c_var_set {
|
||||
regAddr=0x20
|
||||
dataAddr=0
|
||||
eeprombusbase=${NUM_MUX3_CHAN0_DEVICE}
|
||||
gpioBase=240
|
||||
gpioBase=$((${GPIO_OFFSET}+240))
|
||||
#gpioBase=240
|
||||
;;
|
||||
9|10|11|12|13|14|15|16)
|
||||
i2cbus=${NUM_MUX1_CHAN4_DEVICE}
|
||||
regAddr=0x20
|
||||
dataAddr=1
|
||||
eeprombusbase=${NUM_MUX4_CHAN0_DEVICE}
|
||||
gpioBase=240
|
||||
gpioBase=$((${GPIO_OFFSET}+240))
|
||||
#gpioBase=240
|
||||
;;
|
||||
17|18|19|20|21|22|23|24)
|
||||
i2cbus=${NUM_MUX1_CHAN4_DEVICE}
|
||||
regAddr=0x21
|
||||
dataAddr=0
|
||||
eeprombusbase=${NUM_MUX5_CHAN0_DEVICE}
|
||||
gpioBase=$((224 - 16))
|
||||
gpioBase=$((${GPIO_OFFSET}+224-16))
|
||||
#gpioBase=$((224 - 16))
|
||||
;;
|
||||
25|26|27|28|29|30|31|32)
|
||||
i2cbus=${NUM_MUX1_CHAN4_DEVICE}
|
||||
regAddr=0x21
|
||||
dataAddr=1
|
||||
eeprombusbase=${NUM_MUX6_CHAN0_DEVICE}
|
||||
gpioBase=$((224 - 16))
|
||||
;;
|
||||
33)
|
||||
i2cbus=${NUM_MUX1_CHAN7_DEVICE}
|
||||
regAddr=0x22
|
||||
dataAddr=0
|
||||
;;
|
||||
34)
|
||||
i2cbus=${NUM_MUX1_CHAN7_DEVICE}
|
||||
regAddr=0x22
|
||||
dataAddr=1
|
||||
gpioBase=$((${GPIO_OFFSET}+224-16))
|
||||
#gpioBase=$((224 - 16))
|
||||
;;
|
||||
#33)
|
||||
# i2cbus=${NUM_MUX1_CHAN7_DEVICE}
|
||||
# regAddr=0x22
|
||||
# dataAddr=0
|
||||
# gpioBase=${GPIO_OFFSET}
|
||||
#;;
|
||||
#34)
|
||||
# i2cbus=${NUM_MUX1_CHAN7_DEVICE}
|
||||
# regAddr=0x22
|
||||
# dataAddr=1
|
||||
# gpioBase=${GPIO_OFFSET}
|
||||
#;;
|
||||
*)
|
||||
echo "Please input 1~32"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@ -1428,6 +1513,7 @@ function _main {
|
||||
tart_time_str=`date`
|
||||
start_time_sec=$(date +%s)
|
||||
|
||||
_set_gpio_offset
|
||||
if [ "${EXEC_FUNC}" == "help" ]; then
|
||||
_help
|
||||
elif [ "${EXEC_FUNC}" == "i2c_init" ]; then
|
||||
@ -1505,6 +1591,8 @@ function _main {
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" == "on" ]; then
|
||||
echo "-----------------------------------------------------"
|
||||
end_time_str=`date`
|
||||
end_time_sec=$(date +%s)
|
||||
diff_time=$[ ${end_time_sec} - ${start_time_sec} ]
|
||||
@ -1513,6 +1601,7 @@ function _main {
|
||||
echo "Total Execution Time: ${diff_time} sec"
|
||||
|
||||
echo "done!!!"
|
||||
fi
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -15,6 +15,9 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# trun on for more debug output
|
||||
#DEBUG="on"
|
||||
|
||||
VERSION="1.0.0"
|
||||
TRUE=200
|
||||
FALSE=404
|
||||
@ -602,6 +605,35 @@ function _i2c_io_exp_init {
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_0} 0x00
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_1} $((2#00011111))
|
||||
|
||||
#PCA9555 on BMC Dummy Board
|
||||
#set SYSTEM_LED_RST_L before init PCA9539 LED BOARD IO Expander
|
||||
echo "Init PCA9555 MUX RST IO Expander"
|
||||
#PCA9555 MUX RST Expander
|
||||
#0.0 FRU_I2C_MUX_RST_L OUT 1
|
||||
#0.1 MAIN_I2C_MUX_RST_L OUT 1
|
||||
#0.2 SYSTEM_LED_RST_L OUT 1
|
||||
#0.3 BMC_TO_UCD_RST_L OUT 1
|
||||
#0.4 BMC_TO_HOST_RST_L OUT 1
|
||||
#0.5 ETHX_RST_L OUT 1
|
||||
#0.6 GPIOF4 IN
|
||||
#0.7 N/A
|
||||
#1.0 CPU_to_FRU_I2C_EN OUT 1
|
||||
#1.1 CPU_to_MAIN_I2C_EN OUT 1
|
||||
#1.2 P3V3_FAN_EN OUT 1
|
||||
#1.3 P3V3_I2C_EN OUT 1
|
||||
#1.4 UCD9090_CNTRL OUT 1
|
||||
#1.5 UART_MUX_SEL OUT 0
|
||||
#1.6 USB_MUX_SEL OUT 0
|
||||
#1.7 ETHX_CPU_EEPROM_SEL OUT 0
|
||||
i2c_bus=${I2C_BUS_MUX_RST}
|
||||
i2c_addr=${I2C_ADDR_MUX_RST}
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_OUT_0} $((2#00111111))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_OUT_1} $((2#00011111))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_POLARITY_0} 0x00
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_POLARITY_1} 0x00
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_0} $((2#01000000))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_1} 0x00
|
||||
|
||||
echo "Init PCA9539 LED BOARD IO Expander"
|
||||
#PCA9539 LED BOARD
|
||||
#0.0 SYS_LED_G OUT 1
|
||||
@ -721,34 +753,6 @@ function _i2c_io_exp_init {
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_0} $((2#11011011))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_1} $((2#11100011))
|
||||
|
||||
#PCA9555 on BMC Dummy Board
|
||||
echo "Init PCA9555 MUX RST IO Expander"
|
||||
#PCA9555 MUX RST Expander
|
||||
#0.0 FRU_I2C_MUX_RST_L OUT 1
|
||||
#0.1 MAIN_I2C_MUX_RST_L OUT 1
|
||||
#0.2 SYSTEM_LED_RST_L OUT 1
|
||||
#0.3 BMC_TO_UCD_RST_L OUT 1
|
||||
#0.4 BMC_TO_HOST_RST_L OUT 1
|
||||
#0.5 ETHX_RST_L OUT 1
|
||||
#0.6 GPIOF4 IN
|
||||
#0.7 N/A
|
||||
#1.0 CPU_to_FRU_I2C_EN OUT 1
|
||||
#1.1 CPU_to_MAIN_I2C_EN OUT 1
|
||||
#1.2 P3V3_FAN_EN OUT 1
|
||||
#1.3 P3V3_I2C_EN OUT 1
|
||||
#1.4 UCD9090_CNTRL OUT 1
|
||||
#1.5 UART_MUX_SEL OUT 0
|
||||
#1.6 USB_MUX_SEL OUT 0
|
||||
#1.7 ETHX_CPU_EEPROM_SEL OUT 0
|
||||
i2c_bus=${I2C_BUS_MUX_RST}
|
||||
i2c_addr=${I2C_ADDR_MUX_RST}
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_OUT_0} $((2#00111111))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_OUT_1} $((2#00011111))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_POLARITY_0} 0x00
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_POLARITY_1} 0x00
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_0} $((2#01000000))
|
||||
i2cset -y -r ${i2c_bus} ${i2c_addr} ${REG_CFG_1} 0x00
|
||||
|
||||
#PCA9539 on CPU Board
|
||||
echo "Init PCA9539 CPLD IO Expander on CPU"
|
||||
i2c_bus=${I2C_BUS_MUX_CPU_CPLD}
|
||||
@ -1021,6 +1025,17 @@ function _i2c_led_test {
|
||||
_i2c_fan_led
|
||||
_pause 'Check [FAN LED] = Amber and Press [Enter] key to continue...'
|
||||
|
||||
#PSU1 led (green)
|
||||
_i2c_reset_led
|
||||
COLOR_LED="green"
|
||||
_i2c_psu1_led
|
||||
_pause 'Check [PSU1 LED] = Green and Press [Enter] key to continue...'
|
||||
#PSU1 led (amber)
|
||||
_i2c_reset_led
|
||||
COLOR_LED="amber"
|
||||
_i2c_psu1_led
|
||||
_pause 'Check [PSU1 LED] = Amber and Press [Enter] key to continue...'
|
||||
|
||||
#PSU2 led (green)
|
||||
_i2c_reset_led
|
||||
COLOR_LED="green"
|
||||
@ -1032,17 +1047,6 @@ function _i2c_led_test {
|
||||
_i2c_psu2_led
|
||||
_pause 'Check [PSU2 LED] = Amber and Press [Enter] key to continue...'
|
||||
|
||||
#PSU1 led (green)
|
||||
_i2c_reset_led
|
||||
COLOR_LED="green"
|
||||
_i2c_psu1_led
|
||||
_pause 'Check [PSU1 LED] = Green and Press [Enter] key to continue...'
|
||||
#PSU2 led (amber)
|
||||
_i2c_reset_led
|
||||
COLOR_LED="amber"
|
||||
_i2c_psu1_led
|
||||
_pause 'Check [PSU1 LED] = Amber and Press [Enter] key to continue...'
|
||||
|
||||
#Turn OFF All LED
|
||||
_i2c_reset_led
|
||||
_pause 'Check turn off all LEDs and Press [Enter] key to continue...'
|
||||
@ -1090,6 +1094,7 @@ function _qsfp_port_i2c_var_set {
|
||||
;;
|
||||
*)
|
||||
echo "Please input 1~${PORT_NUM}"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -1930,13 +1935,17 @@ function _main {
|
||||
exit ${FALSE}
|
||||
fi
|
||||
|
||||
if [ "$DEBUG" == "on" ]; then
|
||||
echo "-----------------------------------------------------"
|
||||
end_time_str=`date`
|
||||
end_time_sec=$(date +%s)
|
||||
diff_time=$[ ${end_time_sec} - ${start_time_sec} ]
|
||||
echo "------------------------------"
|
||||
echo "Start Time: ${start_time_str} (${start_time_sec})"
|
||||
echo "End Time : ${end_time_str} (${end_time_sec})"
|
||||
echo "Total Execution Time: ${diff_time} sec"
|
||||
|
||||
echo "DONE"
|
||||
echo "done!!!"
|
||||
fi
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -1 +0,0 @@
|
||||
Subproject commit 796169e43aee944fdf7b549d04cb181117e0fb89
|
52
platform/nephos/sonic-platform-modules-ingrasys/.gitignore
vendored
Normal file
52
platform/nephos/sonic-platform-modules-ingrasys/.gitignore
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.ilk
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
*.pdb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
674
platform/nephos/sonic-platform-modules-ingrasys/LICENSE
Normal file
674
platform/nephos/sonic-platform-modules-ingrasys/LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
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.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
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
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
@ -0,0 +1,11 @@
|
||||
platform-driver (1.0.0) unstable; urgency=low
|
||||
|
||||
* Add support for S9130-32X, S9230-64X series
|
||||
|
||||
-- developer <developer@ingrasys.com> Wed, 29 Mar 2017 11:00:00 +0800
|
||||
|
||||
platform-driver (1.0.0) unstable; urgency=low
|
||||
|
||||
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
|
||||
|
||||
-- developer <developer@ingrasys.com> Wed, 05 Oct 2016 16:30:45 +0800
|
@ -0,0 +1 @@
|
||||
9
|
15
platform/nephos/sonic-platform-modules-ingrasys/debian/control
Executable file
15
platform/nephos/sonic-platform-modules-ingrasys/debian/control
Executable file
@ -0,0 +1,15 @@
|
||||
Source: platform-driver
|
||||
Section: unknown
|
||||
Priority: optional
|
||||
Maintainer: Wade He <wade.ce.he@ingrasys.com>
|
||||
Build-Depends: debhelper (>= 9), dh-systemd
|
||||
Standards-Version: 1.0.0
|
||||
|
||||
Package: sonic-platform-ingrasys-s9130-32x
|
||||
Architecture: amd64
|
||||
Description: This package contains S9130-32X platform driver utility for SONiC project.
|
||||
|
||||
Package: sonic-platform-ingrasys-s9230-64x
|
||||
Architecture: amd64
|
||||
Description: This package contains S9230-64X platform driver utility for SONiC project.
|
||||
|
42
platform/nephos/sonic-platform-modules-ingrasys/debian/rules
Executable file
42
platform/nephos/sonic-platform-modules-ingrasys/debian/rules
Executable file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export INSTALL_MOD_DIR:=extra
|
||||
|
||||
PACKAGE_PRE_NAME := sonic-platform-ingrasys
|
||||
KVERSION ?= $(shell uname -r)
|
||||
KERNEL_SRC := /lib/modules/$(KVERSION)
|
||||
MOD_SRC_DIR:= $(shell pwd)
|
||||
MODULE_DIRS:= s9130-32x s9230-64x
|
||||
MODULE_DIR := modules
|
||||
UTILS_DIR := utils
|
||||
SERVICE_DIR := service
|
||||
CONF_DIR := conf
|
||||
|
||||
%:
|
||||
dh $@ --with systemd
|
||||
|
||||
override_dh_auto_build:
|
||||
(for mod in $(MODULE_DIRS); do \
|
||||
make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \
|
||||
done)
|
||||
|
||||
override_dh_auto_install:
|
||||
(for mod in $(MODULE_DIRS); do \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} \
|
||||
$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko \
|
||||
debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/sbin; \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/*.sh \
|
||||
debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/sbin; \
|
||||
dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \
|
||||
cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service \
|
||||
debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system; \
|
||||
done)
|
||||
|
||||
override_dh_clean:
|
||||
dh_clean
|
||||
(for mod in $(MODULE_DIRS); do \
|
||||
make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \
|
||||
done)
|
||||
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S9130-32X board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils.sh i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s9130-32x.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: setup-board
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Should-Start:
|
||||
# Should-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# Short-Description: Setup S9230-64X board.
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Setting up board... "
|
||||
|
||||
depmod -a
|
||||
|
||||
echo "done."
|
||||
;;
|
||||
|
||||
stop)
|
||||
|
||||
i2c_utils i2c_deinit
|
||||
|
||||
echo "done."
|
||||
|
||||
;;
|
||||
|
||||
force-reload|restart)
|
||||
echo "Not supported"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/sonic-platform-ingrasys-s9230-64x.init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
@ -0,0 +1,167 @@
|
||||
# Ingrasys S9130-32X Platform Driver for SONiC
|
||||
|
||||
Copyright (C) 2016 Ingrasys, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
## Licensing terms
|
||||
|
||||
The Licensing terms of the files within this project is split 2 parts.
|
||||
The Linux kernel is released under the GNU General Public License version 2.
|
||||
All other code is released under the GNU General Public License version 3.
|
||||
Please see the LICENSE file for copies of both licenses.
|
||||
|
||||
## Contents of this package
|
||||
|
||||
- service/
|
||||
> Service config files for platform initialization and monitoring
|
||||
- utils/
|
||||
> Scripts useful during platform bringup and sysfs function
|
||||
- conf/
|
||||
> Platform configure files.
|
||||
|
||||
## Kernel modules and drivers
|
||||
|
||||
The driver for interacting with Ingrasys S9130-32X is contained in the I2C
|
||||
kernel module and initialization script. The initialization script loads
|
||||
the modules in the correct order. It has been built and tested against
|
||||
the Linux 3.16 kernel.
|
||||
|
||||
The initialization script will modprobe the needed modules, navigate to the
|
||||
module's device directory in sysfs, and write configuration data to
|
||||
the kernel module.
|
||||
|
||||
### IGB
|
||||
|
||||
This is OOB Ports on front panel for management plane.
|
||||
|
||||
The IGB module must be loaded first on Ingrasys S9130-32X platform.
|
||||
|
||||
### I2C i801
|
||||
|
||||
The I2C i801 on Ingrasys S9130-32X can be found in
|
||||
`/sys/bus/i2c/devices/i2c-0/`
|
||||
|
||||
This is I2C bus for power monitor, FAN controller, HWM and thermal sensors.
|
||||
|
||||
### I2C PCA9548
|
||||
The PCA9548 module on S9130-32X can be found in
|
||||
`/sys/bus/i2c/devices/i2c-1/` , `/sys/bus/i2c/devices/i2c-2/`,
|
||||
`/sys/bus/i2c/devices/i2c-3/`, `/sys/bus/i2c/devices/i2c-4/`,
|
||||
`/sys/bus/i2c/devices/i2c-5/`, `/sys/bus/i2c/devices/i2c-6/`,
|
||||
`/sys/bus/i2c/devices/i2c-7/`, `/sys/bus/i2c/devices/i2c-8/`
|
||||
|
||||
The pca9548 module for zQSFP module get/set functions, PSU information,
|
||||
fan status and EEPROM.
|
||||
|
||||
## Hardware components
|
||||
|
||||
The hardware components are initialized in the init script on S9130-32X.
|
||||
The following describes manual initialization as well as interaction.
|
||||
The examples below are just for Ingrasys S9130-32X platform.
|
||||
|
||||
### Hardware initialization
|
||||
|
||||
When the sonic-platform-ingrasys-s9130-32x package is installed on the S9130-32X,
|
||||
it is automatically initialized. If you want to manual initialization, the
|
||||
utility command usage as follows:
|
||||
```
|
||||
i2c_utils.sh i2c_init
|
||||
```
|
||||
|
||||
### EEPROM
|
||||
|
||||
The EEPROM is including the board SKU, model name, vendor name, serial number,
|
||||
and other information can be accessed with the specific eeprom kernel module.
|
||||
After using `modprobe eeprom_mb` to detect the eeprom, it will show up in sysfs.
|
||||
|
||||
The hexdump utility can be used to decode the raw output of the EEPROM.
|
||||
For example,
|
||||
```
|
||||
bash# echo "mb_eeprom 0x51" > /sys/bus/i2c/devices/i2c-0/new_device
|
||||
bash# cat /sys/bus/i2c/drivers/mb_eeprom/0-0051/eeprom | hexdump -C
|
||||
```
|
||||
|
||||
### Front panel LEDs
|
||||
|
||||
LEDs can be setup on/off by using i2c utility `/usr/sbin/i2c_utils.sh`.
|
||||
Utility function command usage as follows:
|
||||
|
||||
```
|
||||
Status LED:
|
||||
i2c_utils.sh i2c_sys_led green|amber
|
||||
|
||||
Fan status LED:
|
||||
i2c_utils.sh i2c_fan_led green|amber on|off
|
||||
|
||||
PSU1 status LED:
|
||||
i2c_utils.sh i2c_psu1_led green|amber on|off
|
||||
|
||||
PSU2 status LED:
|
||||
i2c_utils.sh i2c_psu2_led green|amber on|off
|
||||
|
||||
```
|
||||
QSFP Module Port LEDs control by ASIC library.
|
||||
|
||||
|
||||
### Fan speed
|
||||
|
||||
Fan speed are controlled by the w83795 kernel module.
|
||||
It can be found in `/sys/class/hwmon/hwmon5/device/`.
|
||||
If they were compiled as modules, you will need to modprobe w83795 for
|
||||
their sysfs entries to show up. Each fan has an `fan<N>_input` file
|
||||
for reading the fan speed. And `pwm1` setting fan1 to fan4,
|
||||
`pwm2` setting fan5 to fan8.
|
||||
|
||||
There is docker-platform-monitor container installed fancontrol package that can
|
||||
automatic control platform fan speed.
|
||||
|
||||
|
||||
### Temperature sensors
|
||||
|
||||
There is docker-platform-monitor container installed lm-sensors package that can
|
||||
monitor platform temperature. And `sensors` command can show each
|
||||
temperature sensors status.
|
||||
|
||||
### Power supplies
|
||||
|
||||
Power supplies status and its EEPROM info can be used i2c utility
|
||||
`/usr/sbin/i2c_utils.sh` to get.
|
||||
The usage as follows:
|
||||
```
|
||||
PSU EEPROM:
|
||||
i2c_utils.sh i2c_psu_eeprom_get
|
||||
hexdump -C psu0.rom
|
||||
hexdump -C psu1.rom
|
||||
|
||||
PSU Status:
|
||||
i2c_utils.sh i2c_psu_status
|
||||
```
|
||||
|
||||
### QSFPs
|
||||
QSFP modules are managed by the pca9548 kernel driver.
|
||||
The i2c utility `/usr/sbin/i2c_utils.sh` can be used to get status and
|
||||
module EEPROM informations.
|
||||
The usage as follows:
|
||||
```
|
||||
QSFP EEPROM:
|
||||
i2c_utils.sh i2c_qsfp_eeprom_get [1-32]
|
||||
|
||||
QSFP Insert Event:
|
||||
i2c_utils.sh i2c_qsfp_eeprom_get [1-32]
|
||||
0 => not insert
|
||||
1 => inserted
|
||||
```
|
||||
|
@ -0,0 +1,2 @@
|
||||
obj-m := eeprom_mb.o
|
||||
obj-m += ingrasys_s9130_32x_psu.o
|
267
platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/modules/eeprom_mb.c
Executable file
267
platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/modules/eeprom_mb.c
Executable file
@ -0,0 +1,267 @@
|
||||
/*
|
||||
* Copyright (C) 1998, 1999 Frodo Looijaard <frodol@dds.nl> and
|
||||
* Philip Edelbrock <phil@netroedge.com>
|
||||
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
|
||||
* Copyright (C) 2003 IBM Corp.
|
||||
* Copyright (C) 2004 Jean Delvare <jdelvare@suse.de>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* enable dev_dbg print out */
|
||||
//#define DEBUG
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
/* Addresses to scan */
|
||||
static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54,
|
||||
0x55, 0x56, 0x57,*/ I2C_CLIENT_END };
|
||||
|
||||
/* Size of EEPROM in bytes */
|
||||
#define EEPROM_SIZE 512
|
||||
|
||||
#define SLICE_BITS (6)
|
||||
#define SLICE_SIZE (1 << SLICE_BITS)
|
||||
#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE)
|
||||
|
||||
/* Each client has this additional data */
|
||||
struct eeprom_data {
|
||||
struct mutex update_lock;
|
||||
u8 valid; /* bitfield, bit!=0 if slice is valid */
|
||||
unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */
|
||||
u8 data[EEPROM_SIZE]; /* Register values */
|
||||
};
|
||||
|
||||
|
||||
static void mb_eeprom_update_client(struct i2c_client *client, u8 slice)
|
||||
{
|
||||
struct eeprom_data *data = i2c_get_clientdata(client);
|
||||
int i, j;
|
||||
int ret;
|
||||
int addr;
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
if (!(data->valid & (1 << slice)) ||
|
||||
time_after(jiffies, data->last_updated[slice] + 300 * HZ)) {
|
||||
dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice);
|
||||
|
||||
addr = slice << SLICE_BITS;
|
||||
|
||||
ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF));
|
||||
/* select the eeprom address */
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "address set failed\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) {
|
||||
for (j = i; j < (i+SLICE_SIZE); j++) {
|
||||
int res;
|
||||
|
||||
res = i2c_smbus_read_byte(client);
|
||||
if (res < 0) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
data->data[j] = res & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
data->last_updated[slice] = jiffies;
|
||||
data->valid |= (1 << slice);
|
||||
}
|
||||
exit:
|
||||
mutex_unlock(&data->update_lock);
|
||||
}
|
||||
|
||||
static ssize_t mb_eeprom_read(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));
|
||||
struct eeprom_data *data = i2c_get_clientdata(client);
|
||||
u8 slice;
|
||||
|
||||
if (off > EEPROM_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
if (off + count > EEPROM_SIZE) {
|
||||
count = EEPROM_SIZE - off;
|
||||
}
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Only refresh slices which contain requested bytes */
|
||||
for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) {
|
||||
mb_eeprom_update_client(client, slice);
|
||||
}
|
||||
|
||||
memcpy(buf, &data->data[off], count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t mb_eeprom_write(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));
|
||||
struct eeprom_data *data = i2c_get_clientdata(client);
|
||||
int ret;
|
||||
int i;
|
||||
u8 cmd;
|
||||
u16 value16;
|
||||
|
||||
dev_dbg(&client->dev, "mb_eeprom_write off=%d, count=%d\n", (int)off, (int)count);
|
||||
|
||||
if (off > EEPROM_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
if (off + count > EEPROM_SIZE) {
|
||||
count = EEPROM_SIZE - off;
|
||||
}
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
for(i=0; i < count; i++) {
|
||||
/* write command */
|
||||
cmd = (off >> 8) & 0xff;
|
||||
value16 = off & 0xff;
|
||||
value16 |= buf[i] << 8;
|
||||
ret = i2c_smbus_write_word_data(client, cmd, value16);
|
||||
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "write address failed at %d \n", (int)off);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
off++;
|
||||
|
||||
/* need to wait for write complete */
|
||||
udelay(10000);
|
||||
}
|
||||
exit:
|
||||
mutex_unlock(&data->update_lock);
|
||||
/* force to update client when reading */
|
||||
for(i=0; i < SLICE_NUM; i++) {
|
||||
data->last_updated[i] = 0;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct bin_attribute mb_eeprom_attr = {
|
||||
.attr = {
|
||||
.name = "eeprom",
|
||||
.mode = S_IRUGO | S_IWUSR,
|
||||
},
|
||||
.size = EEPROM_SIZE,
|
||||
.read = mb_eeprom_read,
|
||||
.write = mb_eeprom_write,
|
||||
};
|
||||
|
||||
/* Return 0 if detection is successful, -ENODEV otherwise */
|
||||
static int mb_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info)
|
||||
{
|
||||
struct i2c_adapter *adapter = client->adapter;
|
||||
|
||||
/* EDID EEPROMs are often 24C00 EEPROMs, which answer to all
|
||||
addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline
|
||||
attaching to addresses >= 0x56 on DDC buses */
|
||||
if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE)
|
||||
&& !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
strlcpy(info->type, "eeprom", I2C_NAME_SIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mb_eeprom_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct eeprom_data *data;
|
||||
int err;
|
||||
|
||||
if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) {
|
||||
err = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memset(data->data, 0xff, EEPROM_SIZE);
|
||||
i2c_set_clientdata(client, data);
|
||||
mutex_init(&data->update_lock);
|
||||
|
||||
/* create the sysfs eeprom file */
|
||||
err = sysfs_create_bin_file(&client->dev.kobj, &mb_eeprom_attr);
|
||||
if (err) {
|
||||
goto exit_kfree;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
exit_kfree:
|
||||
kfree(data);
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mb_eeprom_remove(struct i2c_client *client)
|
||||
{
|
||||
sysfs_remove_bin_file(&client->dev.kobj, &mb_eeprom_attr);
|
||||
kfree(i2c_get_clientdata(client));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id mb_eeprom_id[] = {
|
||||
{ "mb_eeprom", 0 },
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct i2c_driver mb_eeprom_driver = {
|
||||
.driver = {
|
||||
.name = "mb_eeprom",
|
||||
},
|
||||
.probe = mb_eeprom_probe,
|
||||
.remove = mb_eeprom_remove,
|
||||
.id_table = mb_eeprom_id,
|
||||
|
||||
.class = I2C_CLASS_DDC | I2C_CLASS_SPD,
|
||||
.detect = mb_eeprom_detect,
|
||||
.address_list = normal_i2c,
|
||||
};
|
||||
|
||||
module_i2c_driver(mb_eeprom_driver);
|
||||
|
||||
MODULE_AUTHOR("Wade <wade.ce.he@@ingrasys.com>");
|
||||
MODULE_DESCRIPTION("Ingrasys Mother Borad EEPROM driver");
|
||||
MODULE_LICENSE("GPL");
|
@ -0,0 +1,148 @@
|
||||
#ifndef _S9130_32X_PLATFORM_H
|
||||
#define _S9130_32X_PLATFORM_H
|
||||
|
||||
#include <linux/i2c.h>
|
||||
|
||||
// remove debug before release
|
||||
#define DEBUG
|
||||
|
||||
enum bus_order {
|
||||
I2C_BUS_MAIN,
|
||||
MUX_9548_0_CH0,
|
||||
MUX_9548_0_CH1,
|
||||
MUX_9548_0_CH2,
|
||||
MUX_9548_0_CH3,
|
||||
MUX_9548_0_CH4,
|
||||
MUX_9548_0_CH5,
|
||||
MUX_9548_0_CH6,
|
||||
MUX_9548_0_CH7,
|
||||
MUX_9548_1_CH0,
|
||||
MUX_9548_1_CH1,
|
||||
MUX_9548_1_CH2,
|
||||
MUX_9548_1_CH3,
|
||||
MUX_9548_1_CH4,
|
||||
MUX_9548_1_CH5,
|
||||
MUX_9548_1_CH6,
|
||||
MUX_9548_1_CH7,
|
||||
MUX_9546_0_CH0,
|
||||
MUX_9546_0_CH1,
|
||||
MUX_9546_0_CH2,
|
||||
MUX_9546_0_CH3,
|
||||
MUX_9546_1_CH0,
|
||||
MUX_9546_1_CH1,
|
||||
MUX_9546_1_CH2,
|
||||
MUX_9546_1_CH3,
|
||||
MUX_9548_2_CH0,
|
||||
MUX_9548_2_CH1,
|
||||
MUX_9548_2_CH2,
|
||||
MUX_9548_2_CH3,
|
||||
MUX_9548_2_CH4,
|
||||
MUX_9548_2_CH5,
|
||||
MUX_9548_2_CH6,
|
||||
MUX_9548_2_CH7,
|
||||
MUX_9548_3_CH0,
|
||||
MUX_9548_3_CH1,
|
||||
MUX_9548_3_CH2,
|
||||
MUX_9548_3_CH3,
|
||||
MUX_9548_3_CH4,
|
||||
MUX_9548_3_CH5,
|
||||
MUX_9548_3_CH6,
|
||||
MUX_9548_3_CH7,
|
||||
MUX_9548_4_CH0,
|
||||
MUX_9548_4_CH1,
|
||||
MUX_9548_4_CH2,
|
||||
MUX_9548_4_CH3,
|
||||
MUX_9548_4_CH4,
|
||||
MUX_9548_4_CH5,
|
||||
MUX_9548_4_CH6,
|
||||
MUX_9548_4_CH7,
|
||||
MUX_9548_5_CH0,
|
||||
MUX_9548_5_CH1,
|
||||
MUX_9548_5_CH2,
|
||||
MUX_9548_5_CH3,
|
||||
MUX_9548_5_CH4,
|
||||
MUX_9548_5_CH5,
|
||||
MUX_9548_5_CH6,
|
||||
MUX_9548_5_CH7,
|
||||
MUX_9548_6_CH0,
|
||||
MUX_9548_6_CH1,
|
||||
MUX_9548_6_CH2,
|
||||
MUX_9548_6_CH3,
|
||||
MUX_9548_6_CH4,
|
||||
MUX_9548_6_CH5,
|
||||
MUX_9548_6_CH6,
|
||||
MUX_9548_6_CH7,
|
||||
MUX_9548_7_CH0,
|
||||
MUX_9548_7_CH1,
|
||||
MUX_9548_7_CH2,
|
||||
MUX_9548_7_CH3,
|
||||
MUX_9548_7_CH4,
|
||||
MUX_9548_7_CH5,
|
||||
MUX_9548_7_CH6,
|
||||
MUX_9548_7_CH7,
|
||||
MUX_9548_8_CH0,
|
||||
MUX_9548_8_CH1,
|
||||
MUX_9548_8_CH2,
|
||||
MUX_9548_8_CH3,
|
||||
MUX_9548_8_CH4,
|
||||
MUX_9548_8_CH5,
|
||||
MUX_9548_8_CH6,
|
||||
MUX_9548_8_CH7,
|
||||
MUX_9548_9_CH0,
|
||||
MUX_9548_9_CH1,
|
||||
MUX_9548_9_CH2,
|
||||
MUX_9548_9_CH3,
|
||||
MUX_9548_9_CH4,
|
||||
MUX_9548_9_CH5,
|
||||
MUX_9548_9_CH6,
|
||||
MUX_9548_9_CH7,
|
||||
MUX_9548_10_CH0,
|
||||
MUX_9548_10_CH1,
|
||||
MUX_9548_10_CH2,
|
||||
MUX_9548_10_CH3,
|
||||
MUX_9548_10_CH4,
|
||||
MUX_9548_10_CH5,
|
||||
MUX_9548_10_CH6,
|
||||
MUX_9548_10_CH7,
|
||||
};
|
||||
|
||||
#define I2C_ADDR_MUX_9555_0 (0x20)
|
||||
#define I2C_ADDR_MUX_9555_1 (0x24)
|
||||
#define I2C_ADDR_MUX_9555_2 (0x25)
|
||||
#define I2C_ADDR_MUX_9555_3 (0x26)
|
||||
#define I2C_ADDR_MUX_9539_0 (0x76)
|
||||
#define I2C_ADDR_MUX_9539_1 (0x76)
|
||||
#define I2C_BUS_FAN_STATUS (I2C_BUS_MAIN)
|
||||
#define I2C_BUS_SYS_LED (MUX_9548_1_CH1)
|
||||
|
||||
#define NUM_OF_I2C_MUX (11)
|
||||
#define NUM_OF_CPLD (5)
|
||||
#define NUM_OF_QSFP_PORT (64)
|
||||
#define NUM_OF_SFP_PORT (2)
|
||||
#define QSFP_EEPROM_I2C_ADDR (0x50)
|
||||
|
||||
enum gpio_reg {
|
||||
REG_PORT0_IN,
|
||||
REG_PORT1_IN,
|
||||
REG_PORT0_OUT,
|
||||
REG_PORT1_OUT,
|
||||
REG_PORT0_POL,
|
||||
REG_PORT1_POL,
|
||||
REG_PORT0_DIR,
|
||||
REG_PORT1_DIR,
|
||||
};
|
||||
|
||||
struct ing_i2c_board_info {
|
||||
int ch;
|
||||
int size;
|
||||
struct i2c_board_info *board_info;
|
||||
};
|
||||
|
||||
struct i2c_init_data {
|
||||
__u16 ch;
|
||||
__u16 addr;
|
||||
__u8 reg;
|
||||
__u8 value;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,388 @@
|
||||
/*
|
||||
* S9130-32x PSU driver
|
||||
*
|
||||
* Copyright (C) 2017 Ingrasys, 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 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 <linux/module.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/dmi.h>
|
||||
#include "ingrasys_s9130_32x_platform.h"
|
||||
|
||||
static ssize_t show_psu_eeprom(struct device *dev,
|
||||
struct device_attribute *da,
|
||||
char *buf);
|
||||
static struct s9130_psu_data *s9130_psu_update_status(struct device *dev);
|
||||
static struct s9130_psu_data *s9130_psu_update_eeprom(struct device *dev);
|
||||
static int s9130_psu_read_block(struct i2c_client *client,
|
||||
u8 command,
|
||||
u8 *data,
|
||||
int data_len);
|
||||
|
||||
|
||||
#define DRIVER_NAME "psu"
|
||||
|
||||
// Addresses scanned
|
||||
static const unsigned short normal_i2c[] = { 0x50, I2C_CLIENT_END };
|
||||
|
||||
/* PSU EEPROM SIZE */
|
||||
#define EEPROM_SZ 256
|
||||
#define READ_EEPROM 1
|
||||
#define NREAD_EEPROM 0
|
||||
|
||||
static struct i2c_client pca9555_client;
|
||||
|
||||
/* pca9555 gpio pin mapping */
|
||||
#define PSU2_PWROK 0
|
||||
#define PSU2_PRSNT_L 1
|
||||
#define PSU2_PWRON_L 2
|
||||
#define PSU1_PWROK 3
|
||||
#define PSU1_PRSNT_L 4
|
||||
#define PSU1_PWRON_L 5
|
||||
#define TMP_75_INT_L 6
|
||||
|
||||
/* Driver Private Data */
|
||||
struct s9130_psu_data {
|
||||
struct mutex lock;
|
||||
char valid; /* !=0 if registers are valid */
|
||||
unsigned long last_updated; /* In jiffies */
|
||||
u8 index; /* PSU index */
|
||||
s32 status; /* IO expander value */
|
||||
char eeprom[EEPROM_SZ]; /* psu eeprom data */
|
||||
char psuABS; /* PSU absent */
|
||||
char psuPG; /* PSU power good */
|
||||
};
|
||||
|
||||
enum psu_index
|
||||
{
|
||||
s9130_psu1,
|
||||
s9130_psu2
|
||||
};
|
||||
|
||||
/*
|
||||
* display power good attribute
|
||||
*/
|
||||
static ssize_t
|
||||
show_psu_pg(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
struct s9130_psu_data *data = s9130_psu_update_status(dev);
|
||||
unsigned int value;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
value = data->psuPG;
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return sprintf(buf, "%d\n", value);
|
||||
}
|
||||
|
||||
/*
|
||||
* display power absent attribute
|
||||
*/
|
||||
static ssize_t
|
||||
show_psu_abs(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
struct s9130_psu_data *data = s9130_psu_update_status(dev);
|
||||
unsigned int value;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
value = data->psuABS;
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return sprintf(buf, "%d\n", value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* sysfs attributes for psu
|
||||
*/
|
||||
static DEVICE_ATTR(psu_pg, S_IRUGO, show_psu_pg, NULL);
|
||||
static DEVICE_ATTR(psu_abs, S_IRUGO, show_psu_abs, NULL);
|
||||
static DEVICE_ATTR(psu_eeprom, S_IRUGO, show_psu_eeprom, NULL);
|
||||
|
||||
static struct attribute *s9130_psu_attributes[] = {
|
||||
&dev_attr_psu_pg.attr,
|
||||
&dev_attr_psu_abs.attr,
|
||||
&dev_attr_psu_eeprom.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* display psu eeprom content
|
||||
*/
|
||||
static ssize_t
|
||||
show_psu_eeprom(struct device *dev,
|
||||
struct device_attribute *da,
|
||||
char *buf)
|
||||
{
|
||||
struct s9130_psu_data *data = s9130_psu_update_eeprom(dev);
|
||||
|
||||
memcpy(buf, (char *)data->eeprom, EEPROM_SZ);
|
||||
return EEPROM_SZ;
|
||||
}
|
||||
|
||||
static const struct attribute_group s9130_psu_group = {
|
||||
.attrs = s9130_psu_attributes,
|
||||
};
|
||||
|
||||
/*
|
||||
* check gpio expander is accessible
|
||||
*/
|
||||
static int
|
||||
pca9555_detect(struct i2c_client *client)
|
||||
{
|
||||
if (i2c_smbus_read_byte_data(client, REG_PORT0_DIR) < 0) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* client address init
|
||||
*/
|
||||
static void
|
||||
i2c_devices_client_address_init(struct i2c_client *client)
|
||||
{
|
||||
pca9555_client = *client;
|
||||
pca9555_client.addr = 0x25;
|
||||
}
|
||||
|
||||
static int
|
||||
s9130_psu_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *dev_id)
|
||||
{
|
||||
struct s9130_psu_data *data;
|
||||
int status, err;
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
|
||||
status = -EIO;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
data = kzalloc(sizeof(struct s9130_psu_data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
status = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
memset(data, 0, sizeof(struct s9130_psu_data));
|
||||
i2c_set_clientdata(client, data);
|
||||
data->valid = 0;
|
||||
data->index = dev_id->driver_data;
|
||||
mutex_init(&data->lock);
|
||||
|
||||
i2c_devices_client_address_init(client);
|
||||
|
||||
err = pca9555_detect(&pca9555_client);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
dev_info(&client->dev, "chip found\n");
|
||||
|
||||
/* Register sysfs hooks */
|
||||
status = sysfs_create_group(&client->dev.kobj, &s9130_psu_group);
|
||||
if (status) {
|
||||
goto exit_free;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
exit_remove:
|
||||
sysfs_remove_group(&client->dev.kobj, &s9130_psu_group);
|
||||
exit_free:
|
||||
kfree(data);
|
||||
exit:
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
s9130_psu_remove(struct i2c_client *client)
|
||||
{
|
||||
struct s9130_psu_data *data = i2c_get_clientdata(client);
|
||||
|
||||
sysfs_remove_group(&client->dev.kobj, &s9130_psu_group);
|
||||
kfree(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* psu eeprom read utility
|
||||
*/
|
||||
static int
|
||||
s9130_psu_read_block(struct i2c_client *client,
|
||||
u8 command,
|
||||
u8 *data,
|
||||
int data_len)
|
||||
{
|
||||
int i=0, ret=0;
|
||||
int blk_max = 32; //max block read size
|
||||
|
||||
/* read eeprom, 32 * 8 = 256 bytes */
|
||||
for (i=0; i < EEPROM_SZ/blk_max; i++) {
|
||||
ret = i2c_smbus_read_i2c_block_data(client, (i*blk_max), blk_max,
|
||||
data + (i*blk_max));
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* update eeprom content
|
||||
*/
|
||||
static struct s9130_psu_data
|
||||
*s9130_psu_update_eeprom(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct s9130_psu_data *data = i2c_get_clientdata(client);
|
||||
s32 status = 0;
|
||||
int psu_pwrok = 0;
|
||||
int psu_prsnt_l = 0;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
|
||||
if (time_after(jiffies, data->last_updated + 300 * HZ)
|
||||
|| !data->valid) {
|
||||
|
||||
/* Read psu status */
|
||||
|
||||
status = i2c_smbus_read_word_data(&(pca9555_client), REG_PORT0_IN);
|
||||
data->status = status;
|
||||
|
||||
/*read psu status from io expander*/
|
||||
|
||||
if (data->index == s9130_psu1) {
|
||||
psu_pwrok = PSU1_PWROK;
|
||||
psu_prsnt_l = PSU1_PRSNT_L;
|
||||
} else {
|
||||
psu_pwrok = PSU2_PWROK;
|
||||
psu_prsnt_l = PSU2_PRSNT_L;
|
||||
}
|
||||
data->psuPG = (status >> psu_pwrok) & 0x1;
|
||||
data->psuABS = (status >> psu_prsnt_l) & 0x1;
|
||||
|
||||
/* Read eeprom */
|
||||
if (!data->psuABS) {
|
||||
//clear local eeprom data
|
||||
memset(data->eeprom, 0, EEPROM_SZ);
|
||||
|
||||
//read eeprom
|
||||
status = s9130_psu_read_block(client, 0, data->eeprom,
|
||||
ARRAY_SIZE(data->eeprom));
|
||||
|
||||
if (status < 0) {
|
||||
memset(data->eeprom, 0, EEPROM_SZ);
|
||||
dev_err(&client->dev, "Read eeprom failed, status=(%d)\n", status);
|
||||
} else {
|
||||
data->valid = 1;
|
||||
}
|
||||
} else {
|
||||
memset(data->eeprom, 0, EEPROM_SZ);
|
||||
}
|
||||
data->last_updated = jiffies;
|
||||
}
|
||||
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/*
|
||||
* update psu status
|
||||
*/
|
||||
static struct s9130_psu_data
|
||||
*s9130_psu_update_status(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct s9130_psu_data *data = i2c_get_clientdata(client);
|
||||
s32 status = 0;
|
||||
int psu_pwrok = 0;
|
||||
int psu_prsnt_l = 0;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
|
||||
/* Read psu status */
|
||||
|
||||
status = i2c_smbus_read_word_data(&(pca9555_client), REG_PORT0_IN);
|
||||
data->status = status;
|
||||
|
||||
/*read psu status from io expander*/
|
||||
|
||||
if (data->index == s9130_psu1) {
|
||||
psu_pwrok = PSU1_PWROK;
|
||||
psu_prsnt_l = PSU1_PRSNT_L;
|
||||
} else {
|
||||
psu_pwrok = PSU2_PWROK;
|
||||
psu_prsnt_l = PSU2_PRSNT_L;
|
||||
}
|
||||
data->psuPG = (status >> psu_pwrok) & 0x1;
|
||||
data->psuABS = (status >> psu_prsnt_l) & 0x1;
|
||||
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id s9130_psu_id[] = {
|
||||
{ "psu1", s9130_psu1 },
|
||||
{ "psu2", s9130_psu2 },
|
||||
{}
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(i2c, s9130_psu_id);
|
||||
|
||||
static struct i2c_driver s9130_psu_driver = {
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
},
|
||||
.probe = s9130_psu_probe,
|
||||
.remove = s9130_psu_remove,
|
||||
.id_table = s9130_psu_id,
|
||||
.address_list = normal_i2c,
|
||||
};
|
||||
|
||||
static int __init s9130_psu_init(void)
|
||||
{
|
||||
return i2c_add_driver(&s9130_psu_driver);
|
||||
}
|
||||
|
||||
static void __exit s9130_psu_exit(void)
|
||||
{
|
||||
i2c_del_driver(&s9130_psu_driver);
|
||||
}
|
||||
|
||||
module_init(s9130_psu_init);
|
||||
module_exit(s9130_psu_exit);
|
||||
|
||||
MODULE_AUTHOR("Jason Tsai <feng.lee.usa@ingrasys.com>");
|
||||
MODULE_DESCRIPTION("S9130-32X psu driver");
|
||||
MODULE_LICENSE("GPL");
|
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description= This QSFP Monitor service is to setup QSFP SI.
|
||||
Requires=s9130-32x-monitor.service
|
||||
After=s9130-32x-monitor.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/qsfp_monitor.sh
|
||||
KillSignal=SIGKILL
|
||||
SuccessExitStatus=SIGKILL
|
||||
|
||||
# Resource Limitations
|
||||
LimitCORE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description= This Platform Monitor service is to initialize platform and monitor platform.
|
||||
Before=platform-monitor.service
|
||||
After=sysinit.target
|
||||
Wants=fancontrol.service
|
||||
Wants=qsfp-monitor.service
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/sbin/i2c_utils.sh i2c_init
|
||||
ExecStart=/usr/sbin/s9130_32x_monitor.sh
|
||||
KillSignal=SIGKILL
|
||||
SuccessExitStatus=SIGKILL
|
||||
|
||||
# Resource Limitations
|
||||
LimitCORE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
1720
platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh
Executable file
1720
platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/i2c_utils.sh
Executable file
File diff suppressed because it is too large
Load Diff
104
platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/qsfp_monitor.sh
Executable file
104
platform/nephos/sonic-platform-modules-ingrasys/s9130-32x/utils/qsfp_monitor.sh
Executable file
@ -0,0 +1,104 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2017 Ingrasys, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
INTERVAL=3
|
||||
I2C_UTILS="/usr/sbin/i2c_utils.sh"
|
||||
QSFP_SI_SCRIPT="/usr/sbin/qsfp_si_cfg.sh"
|
||||
QSFP_ARRAY=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
|
||||
|
||||
#QSFP SI monitor
|
||||
function _qsfp_si_monitor {
|
||||
local i
|
||||
local status
|
||||
for i in {0..31};
|
||||
do
|
||||
status=`${I2C_UTILS} i2c_qsfp_status_get $(expr $i + 1) | egrep '^status=.*$' | sed -e 's/status=//g'`
|
||||
if [ "${status}" == "1" ]; then
|
||||
_qsfp_type_check $i
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#QSFP type
|
||||
function _qsfp_type_check {
|
||||
local port=$1
|
||||
local qsfp_type=`${I2C_UTILS} i2c_qsfp_type_get $(expr $port + 1)`
|
||||
local identifier=`echo "$qsfp_type" | grep '^identifier=.*$' | sed -e 's/identifier=//g'`
|
||||
if [ "${identifier}" == "11" ]; then
|
||||
connector=`echo "$qsfp_type" | grep '^connector=.*$' | sed -e 's/connector=//g'`
|
||||
case ${connector} in
|
||||
21|23)
|
||||
#DAC
|
||||
if [ "${QSFP_ARRAY[$port]}" != "${connector}" ]; then
|
||||
echo "Change Port $(expr $port + 1) to DAC"
|
||||
QSFP_ARRAY[$port]=${connector}
|
||||
${QSFP_SI_SCRIPT} dac $port >/dev/null
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
#Optical
|
||||
if [ "${QSFP_ARRAY[$port]}" != "${connector}" ]; then
|
||||
echo "Change Port $(expr $port + 1) to Optical"
|
||||
QSFP_ARRAY[$port]=${connector}
|
||||
${QSFP_SI_SCRIPT} optical $port >/dev/null
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
#Docker exist check
|
||||
function _docker_swss_check {
|
||||
while true
|
||||
do
|
||||
# Check if syncd starts
|
||||
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
|
||||
if [ "$result" == "3" ]; then
|
||||
return
|
||||
fi
|
||||
sleep $INTERVAL
|
||||
done
|
||||
}
|
||||
|
||||
#Docker exist check
|
||||
function _qsfp_si_cfg_script_check {
|
||||
|
||||
if [ -f ${QSFP_SI_SCRIPT} ] && [ -x ${QSFP_SI_SCRIPT} ]; then
|
||||
echo "SI Script exists. Start monitor."
|
||||
return
|
||||
else
|
||||
echo "SI Script not exist. Exit monitor."
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
# main function
|
||||
function _main {
|
||||
#Check SI Script
|
||||
_qsfp_si_cfg_script_check
|
||||
#Check docker swss is running
|
||||
_docker_swss_check
|
||||
while true
|
||||
do
|
||||
_qsfp_si_monitor
|
||||
# Sleep while still handling signals
|
||||
sleep $INTERVAL &
|
||||
wait $!
|
||||
done
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2016 Ingrasys, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
INTERVAL=5
|
||||
I2C_UTILS="/usr/sbin/i2c_utils.sh"
|
||||
|
||||
|
||||
# LED status monitor
|
||||
function _led_monitor {
|
||||
${I2C_UTILS} i2c_led_fan_status_set >/dev/null
|
||||
${I2C_UTILS} i2c_led_psu_status_set >/dev/null
|
||||
${I2C_UTILS} i2c_led_fan_tray_status_set >/dev/null
|
||||
}
|
||||
|
||||
# main function
|
||||
function _main {
|
||||
while true
|
||||
do
|
||||
_led_monitor
|
||||
# Sleep while still handling signals
|
||||
sleep $INTERVAL &
|
||||
wait $!
|
||||
done
|
||||
}
|
||||
|
||||
_main
|
@ -0,0 +1,182 @@
|
||||
# Ingrasys S9230-64X Platform Driver for SONiC
|
||||
|
||||
Copyright (C) 2016 Ingrasys, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
## Licensing terms
|
||||
|
||||
The Licensing terms of the files within this project is split 2 parts.
|
||||
The Linux kernel is released under the GNU General Public License version 2.
|
||||
All other code is released under the GNU General Public License version 3.
|
||||
Please see the LICENSE file for copies of both licenses.
|
||||
|
||||
## Contents of this package
|
||||
|
||||
- service/
|
||||
> Service config files for platform initialization and monitoring
|
||||
- utils/
|
||||
> Scripts useful during platform bringup and sysfs function
|
||||
- conf/
|
||||
> Platform configure files.
|
||||
|
||||
## Kernel modules and drivers
|
||||
|
||||
The driver for interacting with Ingrasys S9230-64X is contained in the I2C
|
||||
kernel module and initialization script. The initialization script loads
|
||||
the modules in the correct order. It has been built and tested against
|
||||
the Linux 3.16 kernel.
|
||||
|
||||
The initialization script will modprobe the needed modules, navigate to the
|
||||
module's device directory in sysfs, and write configuration data to
|
||||
the kernel module.
|
||||
|
||||
### IGB
|
||||
|
||||
This is OOB Ports on front panel for management plane.
|
||||
|
||||
The IGB module must be loaded first on Ingrasys S9230-64X platform.
|
||||
|
||||
### I2C i801
|
||||
|
||||
The I2C i801 on Ingrasys S9230-64X can be found in
|
||||
`/sys/bus/i2c/devices/i2c-0/`
|
||||
|
||||
This is I2C bus for power monitor, FAN controller, HWM and thermal sensors.
|
||||
|
||||
### I2C PCA9548
|
||||
The PCA9548 module on S9230-64X can be found in
|
||||
`/sys/bus/i2c/devices/i2c-1/` , `/sys/bus/i2c/devices/i2c-2/`,
|
||||
`/sys/bus/i2c/devices/i2c-3/`, `/sys/bus/i2c/devices/i2c-4/`,
|
||||
`/sys/bus/i2c/devices/i2c-5/`, `/sys/bus/i2c/devices/i2c-6/`,
|
||||
`/sys/bus/i2c/devices/i2c-7/`, `/sys/bus/i2c/devices/i2c-8/`
|
||||
|
||||
The pca9548 module for CPLD get/set functions, PSU information,
|
||||
fan status and EEPROM.
|
||||
|
||||
## Hardware components
|
||||
|
||||
The hardware components are initialized in the init script on S9230-64X.
|
||||
The following describes manual initialization as well as interaction.
|
||||
The examples below are just for Ingrasys S9230-64X platform.
|
||||
|
||||
### Hardware initialization
|
||||
|
||||
When the sonic-platform-ingrasys-s9230-64X package is installed on the S9230-64X,
|
||||
it is automatically initialized. If you want to manual initialization, the
|
||||
utility command usage as follows:
|
||||
```
|
||||
i2c_utils.sh i2c_init
|
||||
```
|
||||
|
||||
### EEPROM
|
||||
|
||||
The EEPROM is including the board SKU, model name, vendor name, serial number,
|
||||
and other information can be accessed with the specific eeprom kernel module.
|
||||
After using `modprobe eeprom_mb` to detect the eeprom, it will show up in sysfs.
|
||||
|
||||
The hexdump utility can be used to decode the raw output of the EEPROM.
|
||||
For example,
|
||||
```
|
||||
bash# echo "mb_eeprom 0x55" > /sys/bus/i2c/devices/i2c-0/new_device
|
||||
bash# cat /sys/bus/i2c/drivers/mb_eeprom/0-0055/eeprom | hexdump -C
|
||||
```
|
||||
|
||||
### Front panel LEDs
|
||||
|
||||
LEDs can be setup on/off by using i2c utility `/usr/sbin/i2c_utils.sh`.
|
||||
Utility function command usage as follows:
|
||||
|
||||
```
|
||||
Status LED:
|
||||
i2c_utils.sh i2c_sys_led green|amber
|
||||
|
||||
Fan status LED:
|
||||
i2c_utils.sh i2c_fan_led green|amber on|off
|
||||
|
||||
PSU1 status LED:
|
||||
i2c_utils.sh i2c_psu1_led green|amber on|off
|
||||
|
||||
PSU2 status LED:
|
||||
i2c_utils.sh i2c_psu2_led green|amber on|off
|
||||
|
||||
```
|
||||
QSFP Module Port LEDs control by ASIC library.
|
||||
|
||||
|
||||
### Fan speed
|
||||
|
||||
Fan speed are controlled by the w83795 kernel module.
|
||||
It can be found in `/sys/class/hwmon/hwmon7/device/`.
|
||||
If they were compiled as modules, you will need to modprobe w83795 for
|
||||
their sysfs entries to show up. Each fan has an `fan<N>_input` file
|
||||
for reading the fan speed. And `pwm1` setting fan1 to fan4,
|
||||
`pwm2` setting fan5 to fan8.
|
||||
|
||||
There is docker-platform-monitor container installed fancontrol package that can
|
||||
automatic control platform fan speed.
|
||||
|
||||
|
||||
### Temperature sensors
|
||||
|
||||
There is docker-platform-monitor container installed lm-sensors package that can
|
||||
monitor platform temperature. And `sensors` command can show each
|
||||
temperature sensors status.
|
||||
|
||||
### Power supplies
|
||||
|
||||
Power supplies status and its EEPROM info can be used i2c utility
|
||||
`/usr/sbin/i2c_utils.sh` to get.
|
||||
The usage as follows:
|
||||
```
|
||||
PSU EEPROM:
|
||||
i2c_utils.sh i2c_psu_eeprom_get
|
||||
hexdump -C psu0.rom
|
||||
hexdump -C psu1.rom
|
||||
|
||||
PSU Status:
|
||||
i2c_utils.sh i2c_psu_status
|
||||
```
|
||||
|
||||
### QSFPs
|
||||
QSFP modules are managed by the CPLD 1~5 according to port number.
|
||||
The i2c utility `/usr/sbin/i2c_utils.sh` can be used to get status and
|
||||
module EEPROM informations.
|
||||
The usage as follows:
|
||||
```
|
||||
QSFP EEPROM:
|
||||
i2c_utils.sh i2c_qsfp_eeprom_get [1-64]
|
||||
|
||||
QSFP Insert Event:
|
||||
i2c_utils.sh i2c_qsfp_status_get [1-64]
|
||||
0 => not insert
|
||||
1 => inserted
|
||||
```
|
||||
|
||||
### SFP+
|
||||
SFP+ modules are managed by the CPLD 1~2 according to port number.
|
||||
The i2c utility `/usr/sbin/i2c_utils.sh` can be used to get status and
|
||||
module EEPROM informations.
|
||||
The usage as follows:
|
||||
```
|
||||
SFP EEPROM:
|
||||
i2c_utils.sh i2c_sfp_eeprom_get [1-2]
|
||||
|
||||
SFP Insert Event:
|
||||
i2c_utils.sh i2c_sfp_status_get [1-2]
|
||||
0 => not insert
|
||||
1 => inserted
|
||||
```
|
||||
|
@ -0,0 +1,3 @@
|
||||
obj-m := eeprom_mb.o
|
||||
obj-m += ingrasys_s9230_64x_i2c_cpld.o
|
||||
obj-m += ingrasys_s9230_64x_psu.o
|
267
platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/modules/eeprom_mb.c
Executable file
267
platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/modules/eeprom_mb.c
Executable file
@ -0,0 +1,267 @@
|
||||
/*
|
||||
* Copyright (C) 1998, 1999 Frodo Looijaard <frodol@dds.nl> and
|
||||
* Philip Edelbrock <phil@netroedge.com>
|
||||
* Copyright (C) 2003 Greg Kroah-Hartman <greg@kroah.com>
|
||||
* Copyright (C) 2003 IBM Corp.
|
||||
* Copyright (C) 2004 Jean Delvare <jdelvare@suse.de>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* enable dev_dbg print out */
|
||||
//#define DEBUG
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
/* Addresses to scan */
|
||||
static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54,
|
||||
0x55, 0x56, 0x57,*/ I2C_CLIENT_END };
|
||||
|
||||
/* Size of EEPROM in bytes */
|
||||
#define EEPROM_SIZE 512
|
||||
|
||||
#define SLICE_BITS (6)
|
||||
#define SLICE_SIZE (1 << SLICE_BITS)
|
||||
#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE)
|
||||
|
||||
/* Each client has this additional data */
|
||||
struct eeprom_data {
|
||||
struct mutex update_lock;
|
||||
u8 valid; /* bitfield, bit!=0 if slice is valid */
|
||||
unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */
|
||||
u8 data[EEPROM_SIZE]; /* Register values */
|
||||
};
|
||||
|
||||
|
||||
static void mb_eeprom_update_client(struct i2c_client *client, u8 slice)
|
||||
{
|
||||
struct eeprom_data *data = i2c_get_clientdata(client);
|
||||
int i, j;
|
||||
int ret;
|
||||
int addr;
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
if (!(data->valid & (1 << slice)) ||
|
||||
time_after(jiffies, data->last_updated[slice] + 300 * HZ)) {
|
||||
dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice);
|
||||
|
||||
addr = slice << SLICE_BITS;
|
||||
|
||||
ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF));
|
||||
/* select the eeprom address */
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "address set failed\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) {
|
||||
for (j = i; j < (i+SLICE_SIZE); j++) {
|
||||
int res;
|
||||
|
||||
res = i2c_smbus_read_byte(client);
|
||||
if (res < 0) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
data->data[j] = res & 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
data->last_updated[slice] = jiffies;
|
||||
data->valid |= (1 << slice);
|
||||
}
|
||||
exit:
|
||||
mutex_unlock(&data->update_lock);
|
||||
}
|
||||
|
||||
static ssize_t mb_eeprom_read(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));
|
||||
struct eeprom_data *data = i2c_get_clientdata(client);
|
||||
u8 slice;
|
||||
|
||||
if (off > EEPROM_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
if (off + count > EEPROM_SIZE) {
|
||||
count = EEPROM_SIZE - off;
|
||||
}
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Only refresh slices which contain requested bytes */
|
||||
for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) {
|
||||
mb_eeprom_update_client(client, slice);
|
||||
}
|
||||
|
||||
memcpy(buf, &data->data[off], count);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t mb_eeprom_write(struct file *filp, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj));
|
||||
struct eeprom_data *data = i2c_get_clientdata(client);
|
||||
int ret;
|
||||
int i;
|
||||
u8 cmd;
|
||||
u16 value16;
|
||||
|
||||
dev_dbg(&client->dev, "mb_eeprom_write off=%d, count=%d\n", (int)off, (int)count);
|
||||
|
||||
if (off > EEPROM_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
if (off + count > EEPROM_SIZE) {
|
||||
count = EEPROM_SIZE - off;
|
||||
}
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
for(i=0; i < count; i++) {
|
||||
/* write command */
|
||||
cmd = (off >> 8) & 0xff;
|
||||
value16 = off & 0xff;
|
||||
value16 |= buf[i] << 8;
|
||||
ret = i2c_smbus_write_word_data(client, cmd, value16);
|
||||
|
||||
if (ret < 0) {
|
||||
dev_err(&client->dev, "write address failed at %d \n", (int)off);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
off++;
|
||||
|
||||
/* need to wait for write complete */
|
||||
udelay(10000);
|
||||
}
|
||||
exit:
|
||||
mutex_unlock(&data->update_lock);
|
||||
/* force to update client when reading */
|
||||
for(i=0; i < SLICE_NUM; i++) {
|
||||
data->last_updated[i] = 0;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct bin_attribute mb_eeprom_attr = {
|
||||
.attr = {
|
||||
.name = "eeprom",
|
||||
.mode = S_IRUGO | S_IWUSR,
|
||||
},
|
||||
.size = EEPROM_SIZE,
|
||||
.read = mb_eeprom_read,
|
||||
.write = mb_eeprom_write,
|
||||
};
|
||||
|
||||
/* Return 0 if detection is successful, -ENODEV otherwise */
|
||||
static int mb_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info)
|
||||
{
|
||||
struct i2c_adapter *adapter = client->adapter;
|
||||
|
||||
/* EDID EEPROMs are often 24C00 EEPROMs, which answer to all
|
||||
addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline
|
||||
attaching to addresses >= 0x56 on DDC buses */
|
||||
if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE)
|
||||
&& !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
strlcpy(info->type, "eeprom", I2C_NAME_SIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mb_eeprom_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
struct eeprom_data *data;
|
||||
int err;
|
||||
|
||||
if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) {
|
||||
err = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memset(data->data, 0xff, EEPROM_SIZE);
|
||||
i2c_set_clientdata(client, data);
|
||||
mutex_init(&data->update_lock);
|
||||
|
||||
/* create the sysfs eeprom file */
|
||||
err = sysfs_create_bin_file(&client->dev.kobj, &mb_eeprom_attr);
|
||||
if (err) {
|
||||
goto exit_kfree;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
exit_kfree:
|
||||
kfree(data);
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mb_eeprom_remove(struct i2c_client *client)
|
||||
{
|
||||
sysfs_remove_bin_file(&client->dev.kobj, &mb_eeprom_attr);
|
||||
kfree(i2c_get_clientdata(client));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id mb_eeprom_id[] = {
|
||||
{ "mb_eeprom", 0 },
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct i2c_driver mb_eeprom_driver = {
|
||||
.driver = {
|
||||
.name = "mb_eeprom",
|
||||
},
|
||||
.probe = mb_eeprom_probe,
|
||||
.remove = mb_eeprom_remove,
|
||||
.id_table = mb_eeprom_id,
|
||||
|
||||
.class = I2C_CLASS_DDC | I2C_CLASS_SPD,
|
||||
.detect = mb_eeprom_detect,
|
||||
.address_list = normal_i2c,
|
||||
};
|
||||
|
||||
module_i2c_driver(mb_eeprom_driver);
|
||||
|
||||
MODULE_AUTHOR("Wade <wade.ce.he@@ingrasys.com>");
|
||||
MODULE_DESCRIPTION("Ingrasys Mother Borad EEPROM driver");
|
||||
MODULE_LICENSE("GPL");
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,223 @@
|
||||
/* header file for i2c cpld driver of ingrasys_s9230_64x
|
||||
*
|
||||
* Copyright (C) 2017 Ingrasys Technology Corporation.
|
||||
* Leo Lin <feng.lee.usa@ingrasys.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef INGRASYS_S9230_64X_I2C_CPLD_H
|
||||
#define INGRASYS_S9230_64X_I2C_CPLD_H
|
||||
|
||||
/* CPLD device index value */
|
||||
enum cpld_id {
|
||||
cpld1,
|
||||
cpld2,
|
||||
cpld3,
|
||||
cpld4,
|
||||
cpld5
|
||||
};
|
||||
|
||||
/* port number on CPLD */
|
||||
#define CPLD_1_PORT_NUM 12
|
||||
#define CPLD_2_PORT_NUM 13
|
||||
|
||||
/* QSFP port number */
|
||||
#define QSFP_MAX_PORT_NUM 64
|
||||
#define QSFP_MIN_PORT_NUM 1
|
||||
|
||||
/* SFP+ port number */
|
||||
#define SFP_MAX_PORT_NUM 2
|
||||
#define SFP_MIN_PORT_NUM 1
|
||||
|
||||
|
||||
/* CPLD registers */
|
||||
#define CPLD_BOARD_TYPE_REG 0x0
|
||||
#define CPLD_EXT_BOARD_TYPE_REG 0x7
|
||||
#define CPLD_VERSION_REG 0x1
|
||||
#define CPLD_ID_REG 0x2
|
||||
#define CPLD_QSFP_PORT_STATUS_BASE_REG 0x20
|
||||
#define CPLD_QSFP_PORT_CONFIG_BASE_REG 0x30
|
||||
#define CPLD_QSFP_PORT_INTERRUPT_REG 0x40
|
||||
#define CPLD_SFP_PORT_STATUS_REG 0x2F
|
||||
#define CPLD_SFP_PORT_CONFIG_REG 0x3F
|
||||
#define CPLD_QSFP_PORT_INTERRUPT_REG 0x40
|
||||
#define CPLD_10GMUX_CONFIG_REG 0x41
|
||||
#define CPLD_BMC_STATUS_REG 0x42
|
||||
#define CPLD_BMC_WATCHDOG_REG 0x43
|
||||
#define CPLD_USB_STATUS_REG 0x44
|
||||
#define CPLD_REST_CONTROL_REG 0x4A
|
||||
|
||||
|
||||
/* bit definition for register value */
|
||||
enum CPLD_QSFP_PORT_STATUS_BITS {
|
||||
CPLD_QSFP_PORT_STATUS_INT_BIT,
|
||||
CPLD_QSFP_PORT_STATUS_ABS_BIT,
|
||||
};
|
||||
enum CPLD_QSFP_PORT_CONFIG_BITS {
|
||||
CPLD_QSFP_PORT_CONFIG_RESET_BIT,
|
||||
CPLD_QSFP_PORT_CONFIG_RESERVE_BIT,
|
||||
CPLD_QSFP_PORT_CONFIG_LPMODE_BIT,
|
||||
};
|
||||
enum CPLD_SFP_PORT_STATUS_BITS {
|
||||
CPLD_SFP_PORT_STATUS_PRESENT_BIT,
|
||||
CPLD_SFP_PORT_STATUS_TXFAULT_BIT,
|
||||
CPLD_SFP_PORT_STATUS_RXLOS_BIT,
|
||||
};
|
||||
enum CPLD_SFP_PORT_CONFIG_BITS {
|
||||
CPLD_SFP_PORT_CONFIG_TXDIS_BIT,
|
||||
CPLD_SFP_PORT_CONFIG_RS_BIT,
|
||||
CPLD_SFP_PORT_CONFIG_TS_BIT,
|
||||
};
|
||||
enum CPLD_10GMUX_CONFIG_BITS {
|
||||
CPLD_10GMUX_CONFIG_ENSMB_BIT,
|
||||
CPLD_10GMUX_CONFIG_ENINPUT_BIT,
|
||||
CPLD_10GMUX_CONFIG_SEL1_BIT,
|
||||
CPLD_10GMUX_CONFIG_SEL0_BIT,
|
||||
};
|
||||
enum CPLD_BMC_WATCHDOG_BITS {
|
||||
CPLD_10GMUX_CONFIG_ENTIMER_BIT,
|
||||
CPLD_10GMUX_CONFIG_TIMEOUT_BIT,
|
||||
};
|
||||
enum CPLD_RESET_CONTROL_BITS {
|
||||
CPLD_RESET_CONTROL_SWRST_BIT,
|
||||
CPLD_RESET_CONTROL_CP2104RST_BIT,
|
||||
CPLD_RESET_CONTROL_82P33814RST_BIT,
|
||||
CPLD_RESET_CONTROL_BMCRST_BIT,
|
||||
};
|
||||
|
||||
/* bit field structure for register value */
|
||||
struct cpld_reg_board_type_t {
|
||||
u8 build_rev:2;
|
||||
u8 hw_rev:2;
|
||||
u8 board_id:4;
|
||||
};
|
||||
|
||||
struct cpld_reg_version_t {
|
||||
u8 revision:6;
|
||||
u8 release:1;
|
||||
u8 reserve:1;
|
||||
};
|
||||
|
||||
struct cpld_reg_id_t {
|
||||
u8 id:3;
|
||||
u8 release:5;
|
||||
};
|
||||
|
||||
/* common manipulation */
|
||||
#define INVALID(i, min, max) ((i < min) || (i > max) ? 1u : 0u)
|
||||
#define READ_BIT(val, bit) ((0u == (val & (1<<bit))) ? 0u : 1u)
|
||||
#define SET_BIT(val, bit) (val |= (1 << bit))
|
||||
#define CLEAR_BIT(val, bit) (val &= ~(1 << bit))
|
||||
#define TOGGLE_BIT(val, bit) (val ^= (1 << bit))
|
||||
#define _BIT(n) (1<<(n))
|
||||
#define _BIT_MASK(len) (BIT(len)-1)
|
||||
|
||||
/* bitfield of register manipulation */
|
||||
#define READ_BF(bf_struct, val, bf_name, bf_value) \
|
||||
(bf_value = ((struct bf_struct *)&val)->bf_name)
|
||||
#define READ_BF_1(bf_struct, val, bf_name, bf_value) \
|
||||
bf_struct bf; \
|
||||
bf.data = val; \
|
||||
bf_value = bf.bf_name
|
||||
#define BOARD_TYPE_BUILD_REV_GET(val, res) \
|
||||
READ_BF(cpld_reg_board_type_t, val, build_rev, res)
|
||||
#define BOARD_TYPE_HW_REV_GET(val, res) \
|
||||
READ_BF(cpld_reg_board_type_t, val, hw_rev, res)
|
||||
#define BOARD_TYPE_BOARD_ID_GET(val, res) \
|
||||
READ_BF(cpld_reg_board_type_t, val, board_id, res)
|
||||
#define CPLD_VERSION_REV_GET(val, res) \
|
||||
READ_BF(cpld_reg_version_t, val, revision, res)
|
||||
#define CPLD_VERSION_REL_GET(val, res) \
|
||||
READ_BF(cpld_reg_version_t, val, release, res)
|
||||
#define CPLD_ID_ID_GET(val, res) \
|
||||
READ_BF(cpld_reg_id_t, val, id, res)
|
||||
#define CPLD_ID_REL_GET(val, res) \
|
||||
READ_BF(cpld_reg_id_t, val, release, res)
|
||||
/* QSFP/SFP registers manipulation */
|
||||
#define QSFP_TO_CPLD_IDX(qsfp_port, cpld_index, cpld_port) \
|
||||
{ \
|
||||
if (QSFP_MIN_PORT_NUM <= qsfp_port && qsfp_port <= CPLD_1_PORT_NUM) { \
|
||||
cpld_index = cpld1; \
|
||||
cpld_port = qsfp_port - 1; \
|
||||
} else if (CPLD_1_PORT_NUM < qsfp_port \
|
||||
&& qsfp_port <= QSFP_MAX_PORT_NUM) { \
|
||||
cpld_index = cpld2 + (qsfp_port - 1 - CPLD_1_PORT_NUM) \
|
||||
/ CPLD_2_PORT_NUM; \
|
||||
cpld_port = (qsfp_port - 1 - CPLD_1_PORT_NUM) % \
|
||||
CPLD_2_PORT_NUM; \
|
||||
} else { \
|
||||
cpld_index = 0; \
|
||||
cpld_port = 0; \
|
||||
} \
|
||||
}
|
||||
#define SFP_TO_CPLD_IDX(sfp_port, cpld_index) \
|
||||
(cpld_index = sfp_port - SFP_MIN_PORT_NUM)
|
||||
#define QSFP_PORT_STATUS_REG(cpld_port) \
|
||||
(CPLD_QSFP_PORT_STATUS_BASE_REG + cpld_port)
|
||||
#define QSFP_PORT_CONFIG_REG(cpld_port) \
|
||||
(CPLD_QSFP_PORT_CONFIG_BASE_REG + cpld_port)
|
||||
#define QSFP_PORT_INT_BIT_GET(port_status_value) \
|
||||
READ_BIT(port_status_value, CPLD_QSFP_PORT_STATUS_INT_BIT)
|
||||
#define QSFP_PORT_ABS_BIT_GET(port_status_value) \
|
||||
READ_BIT(port_status_value, CPLD_QSFP_PORT_STATUS_ABS_BIT)
|
||||
#define QSFP_PORT_RESET_BIT_GET(port_config_value) \
|
||||
READ_BIT(port_config_value, CPLD_QSFP_PORT_CONFIG_RESET_BIT)
|
||||
#define QSFP_PORT_LPMODE_BIT_GET(port_config_value) \
|
||||
READ_BIT(port_config_value, CPLD_QSFP_PORT_CONFIG_LPMODE_BIT)
|
||||
#define QSFP_PORT_RESET_BIT_SET(port_config_value) \
|
||||
SET_BIT(port_config_value, CPLD_QSFP_PORT_CONFIG_RESET_BIT)
|
||||
#define QSFP_PORT_RESET_BIT_CLEAR(port_config_value) \
|
||||
CLEAR_BIT(port_config_value, CPLD_QSFP_PORT_CONFIG_RESET_BIT)
|
||||
#define QSFP_PORT_LPMODE_BIT_SET(port_config_value) \
|
||||
SET_BIT(port_config_value, CPLD_QSFP_PORT_CONFIG_LPMODE_BIT)
|
||||
#define QSFP_PORT_LPMODE_BIT_CLEAR(port_config_value) \
|
||||
CLEAR_BIT(port_config_value, CPLD_QSFP_PORT_CONFIG_LPMODE_BIT)
|
||||
#define SFP_PORT_PRESENT_BIT_GET(port_status_value) \
|
||||
READ_BIT(port_status_value, CPLD_SFP_PORT_STATUS_PRESENT_BIT)
|
||||
|
||||
#define SFP_PORT_TXFAULT_BIT_GET(port_status_value) \
|
||||
READ_BIT(port_status_value, CPLD_SFP_PORT_STATUS_TXFAULT_BIT)
|
||||
#define SFP_PORT_RXLOS_BIT_GET(port_status_value) \
|
||||
READ_BIT(port_status_value, CPLD_SFP_PORT_STATUS_RXLOS_BIT)
|
||||
#define SFP_PORT_TXDIS_BIT_GET(port_status_value) \
|
||||
READ_BIT(port_status_value, CPLD_SFP_PORT_CONFIG_TXDIS_BIT)
|
||||
#define SFP_PORT_RS_BIT_GET(port_config_value) \
|
||||
READ_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_RS_BIT)
|
||||
#define SFP_PORT_TS_BIT_GET(port_config_value) \
|
||||
READ_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_TS_BIT)
|
||||
#define SFP_PORT_TXDIS_BIT_SET(port_config_value) \
|
||||
SET_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_TXDIS_BIT)
|
||||
#define SFP_PORT_TXDIS_BIT_CLEAR(port_config_value) \
|
||||
CLEAR_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_TXDIS_BIT)
|
||||
#define SFP_PORT_RS_BIT_SET(port_config_value) \
|
||||
SET_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_RS_BIT)
|
||||
#define SFP_PORT_RS_BIT_CLEAR(port_config_value) \
|
||||
CLEAR_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_RS_BIT)
|
||||
#define SFP_PORT_TS_BIT_SET(port_config_value) \
|
||||
SET_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_TS_BIT)
|
||||
#define SFP_PORT_TS_BIT_CLEAR(port_config_value) \
|
||||
CLEAR_BIT(port_config_value, CPLD_SFP_PORT_CONFIG_TS_BIT)
|
||||
|
||||
/* CPLD access functions */
|
||||
extern int ingrasys_i2c_cpld_get_qsfp_port_status_val(u8 port_num);
|
||||
extern int ingrasys_i2c_cpld_get_qsfp_port_config_val(u8 port_num);
|
||||
extern int ingrasys_i2c_cpld_set_qsfp_port_config_val(u8 port_num, u8 reg_val);
|
||||
extern int ingrasys_i2c_cpld_get_sfp_port_status_val(u8 port_num);
|
||||
extern int ingrasys_i2c_cpld_get_sfp_port_config_val(u8 port_num);
|
||||
extern int ingrasys_i2c_cpld_set_sfp_port_config_val(u8 port_num, u8 reg_val);
|
||||
extern u8 fp_port_to_phy_port(u8 fp_port);
|
||||
#endif
|
||||
|
@ -0,0 +1,148 @@
|
||||
#ifndef _S9230_64X_PLATFORM_H
|
||||
#define _S9230_64X_PLATFORM_H
|
||||
|
||||
#include <linux/i2c.h>
|
||||
|
||||
// remove debug before release
|
||||
#define DEBUG
|
||||
|
||||
enum bus_order {
|
||||
I2C_BUS_MAIN,
|
||||
MUX_9548_0_CH0,
|
||||
MUX_9548_0_CH1,
|
||||
MUX_9548_0_CH2,
|
||||
MUX_9548_0_CH3,
|
||||
MUX_9548_0_CH4,
|
||||
MUX_9548_0_CH5,
|
||||
MUX_9548_0_CH6,
|
||||
MUX_9548_0_CH7,
|
||||
MUX_9548_1_CH0,
|
||||
MUX_9548_1_CH1,
|
||||
MUX_9548_1_CH2,
|
||||
MUX_9548_1_CH3,
|
||||
MUX_9548_1_CH4,
|
||||
MUX_9548_1_CH5,
|
||||
MUX_9548_1_CH6,
|
||||
MUX_9548_1_CH7,
|
||||
MUX_9546_0_CH0,
|
||||
MUX_9546_0_CH1,
|
||||
MUX_9546_0_CH2,
|
||||
MUX_9546_0_CH3,
|
||||
MUX_9546_1_CH0,
|
||||
MUX_9546_1_CH1,
|
||||
MUX_9546_1_CH2,
|
||||
MUX_9546_1_CH3,
|
||||
MUX_9548_2_CH0,
|
||||
MUX_9548_2_CH1,
|
||||
MUX_9548_2_CH2,
|
||||
MUX_9548_2_CH3,
|
||||
MUX_9548_2_CH4,
|
||||
MUX_9548_2_CH5,
|
||||
MUX_9548_2_CH6,
|
||||
MUX_9548_2_CH7,
|
||||
MUX_9548_3_CH0,
|
||||
MUX_9548_3_CH1,
|
||||
MUX_9548_3_CH2,
|
||||
MUX_9548_3_CH3,
|
||||
MUX_9548_3_CH4,
|
||||
MUX_9548_3_CH5,
|
||||
MUX_9548_3_CH6,
|
||||
MUX_9548_3_CH7,
|
||||
MUX_9548_4_CH0,
|
||||
MUX_9548_4_CH1,
|
||||
MUX_9548_4_CH2,
|
||||
MUX_9548_4_CH3,
|
||||
MUX_9548_4_CH4,
|
||||
MUX_9548_4_CH5,
|
||||
MUX_9548_4_CH6,
|
||||
MUX_9548_4_CH7,
|
||||
MUX_9548_5_CH0,
|
||||
MUX_9548_5_CH1,
|
||||
MUX_9548_5_CH2,
|
||||
MUX_9548_5_CH3,
|
||||
MUX_9548_5_CH4,
|
||||
MUX_9548_5_CH5,
|
||||
MUX_9548_5_CH6,
|
||||
MUX_9548_5_CH7,
|
||||
MUX_9548_6_CH0,
|
||||
MUX_9548_6_CH1,
|
||||
MUX_9548_6_CH2,
|
||||
MUX_9548_6_CH3,
|
||||
MUX_9548_6_CH4,
|
||||
MUX_9548_6_CH5,
|
||||
MUX_9548_6_CH6,
|
||||
MUX_9548_6_CH7,
|
||||
MUX_9548_7_CH0,
|
||||
MUX_9548_7_CH1,
|
||||
MUX_9548_7_CH2,
|
||||
MUX_9548_7_CH3,
|
||||
MUX_9548_7_CH4,
|
||||
MUX_9548_7_CH5,
|
||||
MUX_9548_7_CH6,
|
||||
MUX_9548_7_CH7,
|
||||
MUX_9548_8_CH0,
|
||||
MUX_9548_8_CH1,
|
||||
MUX_9548_8_CH2,
|
||||
MUX_9548_8_CH3,
|
||||
MUX_9548_8_CH4,
|
||||
MUX_9548_8_CH5,
|
||||
MUX_9548_8_CH6,
|
||||
MUX_9548_8_CH7,
|
||||
MUX_9548_9_CH0,
|
||||
MUX_9548_9_CH1,
|
||||
MUX_9548_9_CH2,
|
||||
MUX_9548_9_CH3,
|
||||
MUX_9548_9_CH4,
|
||||
MUX_9548_9_CH5,
|
||||
MUX_9548_9_CH6,
|
||||
MUX_9548_9_CH7,
|
||||
MUX_9548_10_CH0,
|
||||
MUX_9548_10_CH1,
|
||||
MUX_9548_10_CH2,
|
||||
MUX_9548_10_CH3,
|
||||
MUX_9548_10_CH4,
|
||||
MUX_9548_10_CH5,
|
||||
MUX_9548_10_CH6,
|
||||
MUX_9548_10_CH7,
|
||||
};
|
||||
|
||||
#define I2C_ADDR_MUX_9555_0 (0x20)
|
||||
#define I2C_ADDR_MUX_9555_1 (0x24)
|
||||
#define I2C_ADDR_MUX_9555_2 (0x25)
|
||||
#define I2C_ADDR_MUX_9555_3 (0x26)
|
||||
#define I2C_ADDR_MUX_9539_0 (0x76)
|
||||
#define I2C_ADDR_MUX_9539_1 (0x76)
|
||||
#define I2C_BUS_FAN_STATUS (I2C_BUS_MAIN)
|
||||
#define I2C_BUS_SYS_LED (MUX_9548_1_CH1)
|
||||
|
||||
#define NUM_OF_I2C_MUX (11)
|
||||
#define NUM_OF_CPLD (5)
|
||||
#define NUM_OF_QSFP_PORT (64)
|
||||
#define NUM_OF_SFP_PORT (2)
|
||||
#define QSFP_EEPROM_I2C_ADDR (0x50)
|
||||
|
||||
enum gpio_reg {
|
||||
REG_PORT0_IN,
|
||||
REG_PORT1_IN,
|
||||
REG_PORT0_OUT,
|
||||
REG_PORT1_OUT,
|
||||
REG_PORT0_POL,
|
||||
REG_PORT1_POL,
|
||||
REG_PORT0_DIR,
|
||||
REG_PORT1_DIR,
|
||||
};
|
||||
|
||||
struct ing_i2c_board_info {
|
||||
int ch;
|
||||
int size;
|
||||
struct i2c_board_info *board_info;
|
||||
};
|
||||
|
||||
struct i2c_init_data {
|
||||
__u16 ch;
|
||||
__u16 addr;
|
||||
__u8 reg;
|
||||
__u8 value;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,388 @@
|
||||
/*
|
||||
* S9230-64x PSU driver
|
||||
*
|
||||
* Copyright (C) 2017 Ingrasys, 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 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 <linux/module.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/dmi.h>
|
||||
#include "ingrasys_s9230_64x_platform.h"
|
||||
|
||||
static ssize_t show_psu_eeprom(struct device *dev,
|
||||
struct device_attribute *da,
|
||||
char *buf);
|
||||
static struct s9230_psu_data *s9230_psu_update_status(struct device *dev);
|
||||
static struct s9230_psu_data *s9230_psu_update_eeprom(struct device *dev);
|
||||
static int s9230_psu_read_block(struct i2c_client *client,
|
||||
u8 command,
|
||||
u8 *data,
|
||||
int data_len);
|
||||
|
||||
|
||||
#define DRIVER_NAME "psu"
|
||||
|
||||
// Addresses scanned
|
||||
static const unsigned short normal_i2c[] = { 0x50, I2C_CLIENT_END };
|
||||
|
||||
/* PSU EEPROM SIZE */
|
||||
#define EEPROM_SZ 256
|
||||
#define READ_EEPROM 1
|
||||
#define NREAD_EEPROM 0
|
||||
|
||||
static struct i2c_client pca9555_client;
|
||||
|
||||
/* pca9555 gpio pin mapping */
|
||||
#define PSU2_PWROK 0
|
||||
#define PSU2_PRSNT_L 1
|
||||
#define PSU2_PWRON_L 2
|
||||
#define PSU1_PWROK 3
|
||||
#define PSU1_PRSNT_L 4
|
||||
#define PSU1_PWRON_L 5
|
||||
#define TMP_75_INT_L 6
|
||||
|
||||
/* Driver Private Data */
|
||||
struct s9230_psu_data {
|
||||
struct mutex lock;
|
||||
char valid; /* !=0 if registers are valid */
|
||||
unsigned long last_updated; /* In jiffies */
|
||||
u8 index; /* PSU index */
|
||||
s32 status; /* IO expander value */
|
||||
char eeprom[EEPROM_SZ]; /* psu eeprom data */
|
||||
char psuABS; /* PSU absent */
|
||||
char psuPG; /* PSU power good */
|
||||
};
|
||||
|
||||
enum psu_index
|
||||
{
|
||||
s9230_psu1,
|
||||
s9230_psu2
|
||||
};
|
||||
|
||||
/*
|
||||
* display power good attribute
|
||||
*/
|
||||
static ssize_t
|
||||
show_psu_pg(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
struct s9230_psu_data *data = s9230_psu_update_status(dev);
|
||||
unsigned int value;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
value = data->psuPG;
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return sprintf(buf, "%d\n", value);
|
||||
}
|
||||
|
||||
/*
|
||||
* display power absent attribute
|
||||
*/
|
||||
static ssize_t
|
||||
show_psu_abs(struct device *dev,
|
||||
struct device_attribute *devattr,
|
||||
char *buf)
|
||||
{
|
||||
struct s9230_psu_data *data = s9230_psu_update_status(dev);
|
||||
unsigned int value;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
value = data->psuABS;
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return sprintf(buf, "%d\n", value);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* sysfs attributes for psu
|
||||
*/
|
||||
static DEVICE_ATTR(psu_pg, S_IRUGO, show_psu_pg, NULL);
|
||||
static DEVICE_ATTR(psu_abs, S_IRUGO, show_psu_abs, NULL);
|
||||
static DEVICE_ATTR(psu_eeprom, S_IRUGO, show_psu_eeprom, NULL);
|
||||
|
||||
static struct attribute *s9230_psu_attributes[] = {
|
||||
&dev_attr_psu_pg.attr,
|
||||
&dev_attr_psu_abs.attr,
|
||||
&dev_attr_psu_eeprom.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* display psu eeprom content
|
||||
*/
|
||||
static ssize_t
|
||||
show_psu_eeprom(struct device *dev,
|
||||
struct device_attribute *da,
|
||||
char *buf)
|
||||
{
|
||||
struct s9230_psu_data *data = s9230_psu_update_eeprom(dev);
|
||||
|
||||
memcpy(buf, (char *)data->eeprom, EEPROM_SZ);
|
||||
return EEPROM_SZ;
|
||||
}
|
||||
|
||||
static const struct attribute_group s9230_psu_group = {
|
||||
.attrs = s9230_psu_attributes,
|
||||
};
|
||||
|
||||
/*
|
||||
* check gpio expander is accessible
|
||||
*/
|
||||
static int
|
||||
pca9555_detect(struct i2c_client *client)
|
||||
{
|
||||
if (i2c_smbus_read_byte_data(client, REG_PORT0_DIR) < 0) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* client address init
|
||||
*/
|
||||
static void
|
||||
i2c_devices_client_address_init(struct i2c_client *client)
|
||||
{
|
||||
pca9555_client = *client;
|
||||
pca9555_client.addr = 0x25;
|
||||
}
|
||||
|
||||
static int
|
||||
s9230_psu_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *dev_id)
|
||||
{
|
||||
struct s9230_psu_data *data;
|
||||
int status, err;
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
|
||||
status = -EIO;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
data = kzalloc(sizeof(struct s9230_psu_data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
status = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
memset(data, 0, sizeof(struct s9230_psu_data));
|
||||
i2c_set_clientdata(client, data);
|
||||
data->valid = 0;
|
||||
data->index = dev_id->driver_data;
|
||||
mutex_init(&data->lock);
|
||||
|
||||
i2c_devices_client_address_init(client);
|
||||
|
||||
err = pca9555_detect(&pca9555_client);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
dev_info(&client->dev, "chip found\n");
|
||||
|
||||
/* Register sysfs hooks */
|
||||
status = sysfs_create_group(&client->dev.kobj, &s9230_psu_group);
|
||||
if (status) {
|
||||
goto exit_free;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
exit_remove:
|
||||
sysfs_remove_group(&client->dev.kobj, &s9230_psu_group);
|
||||
exit_free:
|
||||
kfree(data);
|
||||
exit:
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
s9230_psu_remove(struct i2c_client *client)
|
||||
{
|
||||
struct s9230_psu_data *data = i2c_get_clientdata(client);
|
||||
|
||||
sysfs_remove_group(&client->dev.kobj, &s9230_psu_group);
|
||||
kfree(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* psu eeprom read utility
|
||||
*/
|
||||
static int
|
||||
s9230_psu_read_block(struct i2c_client *client,
|
||||
u8 command,
|
||||
u8 *data,
|
||||
int data_len)
|
||||
{
|
||||
int i=0, ret=0;
|
||||
int blk_max = 32; //max block read size
|
||||
|
||||
/* read eeprom, 32 * 8 = 256 bytes */
|
||||
for (i=0; i < EEPROM_SZ/blk_max; i++) {
|
||||
ret = i2c_smbus_read_i2c_block_data(client, (i*blk_max), blk_max,
|
||||
data + (i*blk_max));
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* update eeprom content
|
||||
*/
|
||||
static struct s9230_psu_data
|
||||
*s9230_psu_update_eeprom(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct s9230_psu_data *data = i2c_get_clientdata(client);
|
||||
s32 status = 0;
|
||||
int psu_pwrok = 0;
|
||||
int psu_prsnt_l = 0;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
|
||||
if (time_after(jiffies, data->last_updated + 300 * HZ)
|
||||
|| !data->valid) {
|
||||
|
||||
/* Read psu status */
|
||||
|
||||
status = i2c_smbus_read_word_data(&(pca9555_client), REG_PORT0_IN);
|
||||
data->status = status;
|
||||
|
||||
/*read psu status from io expander*/
|
||||
|
||||
if (data->index == s9230_psu1) {
|
||||
psu_pwrok = PSU1_PWROK;
|
||||
psu_prsnt_l = PSU1_PRSNT_L;
|
||||
} else {
|
||||
psu_pwrok = PSU2_PWROK;
|
||||
psu_prsnt_l = PSU2_PRSNT_L;
|
||||
}
|
||||
data->psuPG = (status >> psu_pwrok) & 0x1;
|
||||
data->psuABS = (status >> psu_prsnt_l) & 0x1;
|
||||
|
||||
/* Read eeprom */
|
||||
if (!data->psuABS) {
|
||||
//clear local eeprom data
|
||||
memset(data->eeprom, 0, EEPROM_SZ);
|
||||
|
||||
//read eeprom
|
||||
status = s9230_psu_read_block(client, 0, data->eeprom,
|
||||
ARRAY_SIZE(data->eeprom));
|
||||
|
||||
if (status < 0) {
|
||||
memset(data->eeprom, 0, EEPROM_SZ);
|
||||
dev_err(&client->dev, "Read eeprom failed, status=(%d)\n", status);
|
||||
} else {
|
||||
data->valid = 1;
|
||||
}
|
||||
} else {
|
||||
memset(data->eeprom, 0, EEPROM_SZ);
|
||||
}
|
||||
data->last_updated = jiffies;
|
||||
}
|
||||
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/*
|
||||
* update psu status
|
||||
*/
|
||||
static struct s9230_psu_data
|
||||
*s9230_psu_update_status(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct s9230_psu_data *data = i2c_get_clientdata(client);
|
||||
s32 status = 0;
|
||||
int psu_pwrok = 0;
|
||||
int psu_prsnt_l = 0;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
|
||||
/* Read psu status */
|
||||
|
||||
status = i2c_smbus_read_word_data(&(pca9555_client), REG_PORT0_IN);
|
||||
data->status = status;
|
||||
|
||||
/*read psu status from io expander*/
|
||||
|
||||
if (data->index == s9230_psu1) {
|
||||
psu_pwrok = PSU1_PWROK;
|
||||
psu_prsnt_l = PSU1_PRSNT_L;
|
||||
} else {
|
||||
psu_pwrok = PSU2_PWROK;
|
||||
psu_prsnt_l = PSU2_PRSNT_L;
|
||||
}
|
||||
data->psuPG = (status >> psu_pwrok) & 0x1;
|
||||
data->psuABS = (status >> psu_prsnt_l) & 0x1;
|
||||
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id s9230_psu_id[] = {
|
||||
{ "psu1", s9230_psu1 },
|
||||
{ "psu2", s9230_psu2 },
|
||||
{}
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(i2c, s9230_psu_id);
|
||||
|
||||
static struct i2c_driver s9230_psu_driver = {
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
},
|
||||
.probe = s9230_psu_probe,
|
||||
.remove = s9230_psu_remove,
|
||||
.id_table = s9230_psu_id,
|
||||
.address_list = normal_i2c,
|
||||
};
|
||||
|
||||
static int __init s9230_psu_init(void)
|
||||
{
|
||||
return i2c_add_driver(&s9230_psu_driver);
|
||||
}
|
||||
|
||||
static void __exit s9230_psu_exit(void)
|
||||
{
|
||||
i2c_del_driver(&s9230_psu_driver);
|
||||
}
|
||||
|
||||
module_init(s9230_psu_init);
|
||||
module_exit(s9230_psu_exit);
|
||||
|
||||
MODULE_AUTHOR("Jason Tsai <feng.lee.usa@ingrasys.com>");
|
||||
MODULE_DESCRIPTION("S9230-64X psu driver");
|
||||
MODULE_LICENSE("GPL");
|
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description= This QSFP Monitor service is to setup QSFP SI.
|
||||
Requires=s9230-64x-monitor.service
|
||||
After=s9230-64x-monitor.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/qsfp_monitor.sh
|
||||
KillSignal=SIGKILL
|
||||
SuccessExitStatus=SIGKILL
|
||||
|
||||
# Resource Limitations
|
||||
LimitCORE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description= This Platform Monitor service is to initialize platform and monitor platform.
|
||||
Before=platform-monitor.service
|
||||
After=sysinit.target
|
||||
Wants=fancontrol.service
|
||||
Wants=qsfp-monitor.service
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
ExecStartPre=/usr/sbin/i2c_utils.sh i2c_init
|
||||
ExecStart=/usr/sbin/s9230_64x_monitor.sh
|
||||
KillSignal=SIGKILL
|
||||
SuccessExitStatus=SIGKILL
|
||||
|
||||
# Resource Limitations
|
||||
LimitCORE=infinity
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
1850
platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh
Executable file
1850
platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/i2c_utils.sh
Executable file
File diff suppressed because it is too large
Load Diff
105
platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/qsfp_monitor.sh
Executable file
105
platform/nephos/sonic-platform-modules-ingrasys/s9230-64x/utils/qsfp_monitor.sh
Executable file
@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2017 Ingrasys, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
INTERVAL=3
|
||||
I2C_UTILS="/usr/sbin/i2c_utils.sh"
|
||||
QSFP_SI_SCRIPT="/usr/sbin/qsfp_si_cfg.sh"
|
||||
QSFP_ARRAY=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \
|
||||
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
|
||||
|
||||
#QSFP SI monitor
|
||||
function _qsfp_si_monitor {
|
||||
local i
|
||||
local status
|
||||
for i in {0..63};
|
||||
do
|
||||
status=`${I2C_UTILS} i2c_qsfp_status_get $(expr $i + 1) | egrep '^status=.*$' | sed -e 's/status=//g'`
|
||||
if [ "${status}" == "1" ]; then
|
||||
_qsfp_type_check $i
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#QSFP type
|
||||
function _qsfp_type_check {
|
||||
local port=$1
|
||||
local qsfp_type=`${I2C_UTILS} i2c_qsfp_type_get $(expr $port + 1)`
|
||||
local identifier=`echo "$qsfp_type" | grep '^identifier=.*$' | sed -e 's/identifier=//g'`
|
||||
if [ "${identifier}" == "11" ]; then
|
||||
connector=`echo "$qsfp_type" | grep '^connector=.*$' | sed -e 's/connector=//g'`
|
||||
case ${connector} in
|
||||
21|23)
|
||||
#DAC
|
||||
if [ "${QSFP_ARRAY[$port]}" != "${connector}" ]; then
|
||||
echo "Change Port $(expr $port + 1) to DAC"
|
||||
QSFP_ARRAY[$port]=${connector}
|
||||
${QSFP_SI_SCRIPT} dac $port >/dev/null
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
#Optical
|
||||
if [ "${QSFP_ARRAY[$port]}" != "${connector}" ]; then
|
||||
echo "Change Port $(expr $port + 1) to Optical"
|
||||
QSFP_ARRAY[$port]=${connector}
|
||||
${QSFP_SI_SCRIPT} optical $port >/dev/null
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
#Docker exist check
|
||||
function _docker_swss_check {
|
||||
while true
|
||||
do
|
||||
# Check if syncd starts
|
||||
result=`docker exec -i swss bash -c "echo -en \"SELECT 1\\nHLEN HIDDEN\" | redis-cli | sed -n 2p"` #TBD FIX ME
|
||||
if [ "$result" == "3" ]; then
|
||||
return
|
||||
fi
|
||||
sleep $INTERVAL
|
||||
done
|
||||
}
|
||||
|
||||
#Docker exist check
|
||||
function _qsfp_si_cfg_script_check {
|
||||
|
||||
if [ -f ${QSFP_SI_SCRIPT} ] && [ -x ${QSFP_SI_SCRIPT} ]; then
|
||||
echo "SI Script exists. Start monitor."
|
||||
return
|
||||
else
|
||||
echo "SI Script not exist. Exit monitor."
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
# main function
|
||||
function _main {
|
||||
#Check SI Script
|
||||
_qsfp_si_cfg_script_check
|
||||
#Check docker swss is running
|
||||
_docker_swss_check
|
||||
while true
|
||||
do
|
||||
_qsfp_si_monitor
|
||||
# Sleep while still handling signals
|
||||
sleep $INTERVAL &
|
||||
wait $!
|
||||
done
|
||||
}
|
||||
|
||||
_main
|
||||
|
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2016 Ingrasys, 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
INTERVAL=5
|
||||
I2C_UTILS="/usr/sbin/i2c_utils.sh"
|
||||
|
||||
|
||||
# LED status monitor
|
||||
function _led_monitor {
|
||||
${I2C_UTILS} i2c_led_fan_status_set >/dev/null
|
||||
${I2C_UTILS} i2c_led_psu_status_set >/dev/null
|
||||
${I2C_UTILS} i2c_led_fan_tray_status_set >/dev/null
|
||||
}
|
||||
|
||||
# main function
|
||||
function _main {
|
||||
while true
|
||||
do
|
||||
_led_monitor
|
||||
# Sleep while still handling signals
|
||||
sleep $INTERVAL &
|
||||
wait $!
|
||||
done
|
||||
}
|
||||
|
||||
_main
|
Loading…
Reference in New Issue
Block a user