[Accton] Enable pca954x i2c mux idle_disconnect for 5.10 kernel (#9745)
Enable pca954x idle_disconnect to avoid possible I2C device address conflict. How I did it Change pca954x device_attr idle_state to -2 (MUX_IDLE_DISCONNECT). How to verify it Cat pca954x device_attr idle_state and confirm the value is -2. Signed-off-by: Sean Wu <sean_wu@edge-core.com>
This commit is contained in:
parent
c69d376071
commit
a5515b5297
@ -32,7 +32,7 @@
|
|||||||
[
|
[
|
||||||
"i2c-i801",
|
"i2c-i801",
|
||||||
"i2c_dev",
|
"i2c_dev",
|
||||||
"i2c_mux_pca954x force_deselect_on_exit=1",
|
"i2c_mux_pca954x",
|
||||||
"optoe"
|
"optoe"
|
||||||
],
|
],
|
||||||
"pddf_kos":
|
"pddf_kos":
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
[
|
[
|
||||||
"i2c-i801",
|
"i2c-i801",
|
||||||
"i2c_dev",
|
"i2c_dev",
|
||||||
"i2c_mux_pca954x force_deselect_on_exit=1",
|
"i2c_mux_pca954x",
|
||||||
"optoe"
|
"optoe"
|
||||||
],
|
],
|
||||||
"pddf_kos":
|
"pddf_kos":
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
[
|
[
|
||||||
"i2c-i801",
|
"i2c-i801",
|
||||||
"i2c_dev",
|
"i2c_dev",
|
||||||
"i2c_mux_pca954x force_deselect_on_exit=1",
|
"i2c_mux_pca954x",
|
||||||
"optoe"
|
"optoe"
|
||||||
],
|
],
|
||||||
"pddf_kos":
|
"pddf_kos":
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
"i2c-ismt",
|
"i2c-ismt",
|
||||||
"i2c-i801",
|
"i2c-i801",
|
||||||
"i2c_dev",
|
"i2c_dev",
|
||||||
"i2c_mux_pca954x force_deselect_on_exit=1",
|
"i2c_mux_pca954x",
|
||||||
"optoe"
|
"optoe"
|
||||||
],
|
],
|
||||||
"pddf_kos":
|
"pddf_kos":
|
||||||
|
@ -274,7 +274,7 @@ def driver_inserted():
|
|||||||
kos = [
|
kos = [
|
||||||
'depmod -ae',
|
'depmod -ae',
|
||||||
'modprobe i2c_dev',
|
'modprobe i2c_dev',
|
||||||
'modprobe i2c_mux_pca954x force_deselect_on_exit=1',
|
'modprobe i2c_mux_pca954x',
|
||||||
'modprobe ym2651y',
|
'modprobe ym2651y',
|
||||||
'modprobe x86_64_accton_as4630_54te_cpld',
|
'modprobe x86_64_accton_as4630_54te_cpld',
|
||||||
'modprobe x86_64_accton_as4630_54te_leds',
|
'modprobe x86_64_accton_as4630_54te_leds',
|
||||||
@ -330,6 +330,15 @@ def device_install():
|
|||||||
print(output)
|
print(output)
|
||||||
if FORCE == 0:
|
if FORCE == 0:
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
# set all pca954x idle_disconnect
|
||||||
|
cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state'
|
||||||
|
status, output = log_os_system(cmd, 1)
|
||||||
|
if status:
|
||||||
|
print(output)
|
||||||
|
if FORCE == 0:
|
||||||
|
return status
|
||||||
|
|
||||||
print("Check SFP")
|
print("Check SFP")
|
||||||
for i in range(0, len(sfp_map)):
|
for i in range(0, len(sfp_map)):
|
||||||
if(i < 4):
|
if(i < 4):
|
||||||
|
@ -164,7 +164,7 @@ def driver_check():
|
|||||||
|
|
||||||
kos = [
|
kos = [
|
||||||
'modprobe i2c_dev',
|
'modprobe i2c_dev',
|
||||||
'modprobe i2c_mux_pca954x force_deselect_on_exit=1',
|
'modprobe i2c_mux_pca954x',
|
||||||
'modprobe accton_i2c_cpld',
|
'modprobe accton_i2c_cpld',
|
||||||
'modprobe ym2651y',
|
'modprobe ym2651y',
|
||||||
'modprobe accton_as7312_54x_fan',
|
'modprobe accton_as7312_54x_fan',
|
||||||
@ -308,6 +308,15 @@ def device_install():
|
|||||||
print(output)
|
print(output)
|
||||||
if FORCE == 0:
|
if FORCE == 0:
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
# set all pca954x idle_disconnect
|
||||||
|
cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state'
|
||||||
|
status, output = log_os_system(cmd, 1)
|
||||||
|
if status:
|
||||||
|
print(output)
|
||||||
|
if FORCE == 0:
|
||||||
|
return status
|
||||||
|
|
||||||
for i in range(0, len(sfp_map)):
|
for i in range(0, len(sfp_map)):
|
||||||
if i < qsfp_start:
|
if i < qsfp_start:
|
||||||
(status, output) = \
|
(status, output) = \
|
||||||
|
@ -158,7 +158,7 @@ def driver_check():
|
|||||||
|
|
||||||
kos = [
|
kos = [
|
||||||
'modprobe i2c_dev',
|
'modprobe i2c_dev',
|
||||||
'modprobe i2c_mux_pca954x force_deselect_on_exit=1',
|
'modprobe i2c_mux_pca954x',
|
||||||
'modprobe optoe',
|
'modprobe optoe',
|
||||||
'modprobe ym2651y',
|
'modprobe ym2651y',
|
||||||
'modprobe accton_as7315_27xb_fan',
|
'modprobe accton_as7315_27xb_fan',
|
||||||
@ -255,6 +255,14 @@ def device_install():
|
|||||||
if FORCE == 0:
|
if FORCE == 0:
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
# set all pca954x idle_disconnect
|
||||||
|
cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state'
|
||||||
|
status, output = log_os_system(cmd, 1)
|
||||||
|
if status:
|
||||||
|
print(output)
|
||||||
|
if FORCE == 0:
|
||||||
|
return status
|
||||||
|
|
||||||
for i in range(0,len(sfp_map)):
|
for i in range(0,len(sfp_map)):
|
||||||
path = "/sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device"
|
path = "/sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device"
|
||||||
if 1 >= qsfp_start_index:
|
if 1 >= qsfp_start_index:
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect()
|
||||||
|
{
|
||||||
|
echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state >& /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo Fail to set pca954x mux idle disconnect
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect
|
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect()
|
||||||
|
{
|
||||||
|
echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state >& /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo Fail to set pca954x mux idle disconnect
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect
|
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect()
|
||||||
|
{
|
||||||
|
echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state >& /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo Fail to set pca954x mux idle disconnect
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect
|
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect()
|
||||||
|
{
|
||||||
|
echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state >& /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo Fail to set pca954x mux idle disconnect
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
set_pca_mux_idle_disconnect
|
@ -277,7 +277,7 @@ def driver_inserted():
|
|||||||
kos = [
|
kos = [
|
||||||
'depmod -ae',
|
'depmod -ae',
|
||||||
'modprobe i2c_dev',
|
'modprobe i2c_dev',
|
||||||
'modprobe i2c_mux_pca954x force_deselect_on_exit=1',
|
'modprobe i2c_mux_pca954x',
|
||||||
'modprobe ym2651y',
|
'modprobe ym2651y',
|
||||||
'modprobe x86-64-accton-as9726-32d_cpld',
|
'modprobe x86-64-accton-as9726-32d_cpld',
|
||||||
'modprobe x86-64-accton-as9726-32d_fan',
|
'modprobe x86-64-accton-as9726-32d_fan',
|
||||||
@ -326,6 +326,15 @@ def device_install():
|
|||||||
print(output)
|
print(output)
|
||||||
if FORCE == 0:
|
if FORCE == 0:
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
# set all pca954x idle_disconnect
|
||||||
|
cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state'
|
||||||
|
status, output = log_os_system(cmd, 1)
|
||||||
|
if status:
|
||||||
|
print(output)
|
||||||
|
if FORCE == 0:
|
||||||
|
return status
|
||||||
|
|
||||||
print("Check SFP")
|
print("Check SFP")
|
||||||
for i in range(0, len(sfp_map)):
|
for i in range(0, len(sfp_map)):
|
||||||
if(i >= (len(sfp_map)-2)):
|
if(i >= (len(sfp_map)-2)):
|
||||||
|
Reference in New Issue
Block a user