DellEMC: Dell platform bug fixes on s5248 and s6232 (#4071)
* Dynamic bus detection and loading driver for eeprom on s5248,s5232 * sfputil fix for S5248
This commit is contained in:
parent
c9483796dc
commit
dc994b8425
@ -9,7 +9,9 @@
|
|||||||
# - specific encoder/decoder if there is special need
|
# - specific encoder/decoder if there is special need
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import os.path
|
||||||
from sonic_eeprom import eeprom_tlvinfo
|
from sonic_eeprom import eeprom_tlvinfo
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
raise ImportError (str(e) + "- required module not found")
|
raise ImportError (str(e) + "- required module not found")
|
||||||
@ -18,5 +20,13 @@ except ImportError, e:
|
|||||||
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
||||||
|
|
||||||
def __init__(self, name, path, cpld_root, ro):
|
def __init__(self, name, path, cpld_root, ro):
|
||||||
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0050/eeprom"
|
self.eeprom_path = None
|
||||||
|
for b in (0, 1):
|
||||||
|
f = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'.format(b)
|
||||||
|
if os.path.exists(f):
|
||||||
|
self.eeprom_path = f
|
||||||
|
break
|
||||||
|
if self.eeprom_path is None:
|
||||||
|
return
|
||||||
|
|
||||||
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
# - specific encoder/decoder if there is special need
|
# - specific encoder/decoder if there is special need
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import os.path
|
||||||
from sonic_eeprom import eeprom_tlvinfo
|
from sonic_eeprom import eeprom_tlvinfo
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
raise ImportError (str(e) + "- required module not found")
|
raise ImportError (str(e) + "- required module not found")
|
||||||
@ -18,5 +20,13 @@ except ImportError, e:
|
|||||||
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
||||||
|
|
||||||
def __init__(self, name, path, cpld_root, ro):
|
def __init__(self, name, path, cpld_root, ro):
|
||||||
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0050/eeprom"
|
self.eeprom_path = None
|
||||||
|
for b in (0, 1):
|
||||||
|
f = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'.format(b)
|
||||||
|
if os.path.exists(f):
|
||||||
|
self.eeprom_path = f
|
||||||
|
break
|
||||||
|
if self.eeprom_path is None:
|
||||||
|
return
|
||||||
|
|
||||||
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
||||||
|
@ -17,9 +17,9 @@ init_devnum() {
|
|||||||
# Attach/Detach syseeprom on CPU board
|
# Attach/Detach syseeprom on CPU board
|
||||||
sys_eeprom() {
|
sys_eeprom() {
|
||||||
case $1 in
|
case $1 in
|
||||||
"new_device") echo 24c16 0x50 > /sys/bus/i2c/devices/i2c-0/$1
|
"new_device") echo 24c16 0x50 > /sys/bus/i2c/devices/i2c-${devnum}/$1
|
||||||
;;
|
;;
|
||||||
"delete_device") echo 0x50 > /sys/bus/i2c/devices/i2c-0/$1
|
"delete_device") echo 0x50 > /sys/bus/i2c/devices/i2c-${devnum}/$1
|
||||||
;;
|
;;
|
||||||
*) echo "s5232f_platform: sys_eeprom : invalid command !"
|
*) echo "s5232f_platform: sys_eeprom : invalid command !"
|
||||||
;;
|
;;
|
||||||
|
@ -17,9 +17,9 @@ init_devnum() {
|
|||||||
# Attach/Detach syseeprom on CPU board
|
# Attach/Detach syseeprom on CPU board
|
||||||
sys_eeprom() {
|
sys_eeprom() {
|
||||||
case $1 in
|
case $1 in
|
||||||
"new_device") echo 24c16 0x50 > /sys/bus/i2c/devices/i2c-0/$1
|
"new_device") echo 24c16 0x50 > /sys/bus/i2c/devices/i2c-${devnum}/$1
|
||||||
;;
|
;;
|
||||||
"delete_device") echo 0x50 > /sys/bus/i2c/devices/i2c-0/$1
|
"delete_device") echo 0x50 > /sys/bus/i2c/devices/i2c-${devnum}/$1
|
||||||
;;
|
;;
|
||||||
*) echo "s5248f_platform: sys_eeprom : invalid command !"
|
*) echo "s5248f_platform: sys_eeprom : invalid command !"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user