Skip to content

Commit

Permalink
[platform]: update mitac platform drivers and device to fix the order…
Browse files Browse the repository at this point in the history
… of i2c modules.

Signed-off-by: Stane Shieh <[email protected]>
  • Loading branch information
stanepc1 committed Sep 6, 2018
1 parent 0085456 commit 406c95f
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 378 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax pcie_aspm=off irqpoll"
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax pcie_aspm=off irqpoll modprobe.blacklist=i2c_ismt"
2 changes: 2 additions & 0 deletions platform/broadcom/sonic-platform-modules-mitac/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ly1200-32x/modules/modules.order
ly1200-32x/modules/.tmp_versions
ly1200-32x/opt/xcvr-serv/*.o
ly1200-32x/opt/sys-serv/*.o
ly1200-32x/opt/xcvr-serv/xcvr-servd
ly1200-32x/opt/sys-serv/sys-servd

debian/sonic-platform-mitac-ly1200-32x/
debian/sonic-platform-mitac-ly1200-32x.debhelper.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Standards-Version: 3.9.3

Package: sonic-platform-mitac-ly1200-32x
Architecture: amd64
Depends: linux-image-4.9.0-7-amd64
Depends: linux-image-4.9.0-7-amd64, bc
Description: kernel modules for platform devices such as fan, led, sfp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Default-Start:
# Default-Stop:
# Short-Description: Setup ly1200-32x board.
### END INIT INFO

Expand All @@ -16,34 +16,32 @@ start)
echo -n "Setting up board... "

echo 0 > /proc/sys/kernel/perf_cpu_time_max_percent
echo 0 > /sys/bus/i2c/devices/1-0031/wd_en

/etc/init.d/gpe start
/etc/init.d/i2c_init start
/etc/init.d/sys_polld start
/opt/script/start_service.sh &
/etc/init.d/xcvr_servd start
/etc/init.d/sys_servd start
echo 0 > /sys/bus/i2c/devices/1-0031/wd_en

echo "done."
;;

stop)
echo -n "cleaning... "

/etc/init.d/gpe stop
/etc/init.d/i2c_init stop
/etc/init.d/xcvr_servd stop
/etc/init.d/sys_servd stop
/etc/init.d/sys_polld stop

echo "done."

;;

force-reload|restart)
echo "Not supported"
;;

*)
echo "Usage: /etc/init.d/sonic-platform-mitac-ly1200-32x.init {start|stop}"
echo "Usage: /etc/init.d/sonic-platform-mitac-ly1200-32x {start|stop}"
exit 1
;;
esac
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Provides: fan-ctrld
# Required-Start:
# Required-Stop:
# Default-Start: rc.local
# Default-Start:
# Default-Stop:
# Short-Description: Daemon fan-ctrld
### END INIT INFO
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Default-Start:
# Default-Stop:
# Short-Description: Setup ly1200-32x board.
### END INIT INFO

Expand Down Expand Up @@ -48,105 +48,9 @@ function log_msg() {

# Load kernel modules
load_modules () {
while [ 1 ]
do
if [ `lsmod | grep -c "i2c_i801 "` -eq 1 ] && [ `lsmod | grep -c "i2c_ismt "` -eq 1 ]; then
log_msg "The kernel module i801 and ismt was insert."
break;
fi
if [ $I2C_BUS_RM_ALL -eq 0 ]; then
I2C_BUS_RM_ALL=1
log_msg "Wait for i2c_i801 and i2c_ismt module insert."
fi
sleep 1
done
if [ $I2C_BUS_RM_ALL -eq 1 ]; then
log_msg "i2c_i801 and i2c_ismt auto insert success."
fi
#----------remove i801 start---------------------
if [ `lsmod | grep -c "i2c_i801 "` -eq 1 ]; then
rmmod i2c_i801
while [ `lsmod | grep -c "i2c_i801 "` -eq 1 ]
do
if [ $I2C_I801_RM_PRINT -eq 0 ]; then
I2C_I801_RM_PRINT=1
log_msg "Wait for i2c_i801 remove."
fi
if [ $I2C_I801_RM_RETRY -lt $RETRY ];then
I2C_I801_RM_RETRY=$((I2C_I801_RM_RETRY + 1))
else
break
fi
sleep 1
done
if [ $I2C_I801_RM_PRINT -eq 1 ]; then
log_msg "i2c_i801 remove success."
fi
fi
#----------remove i801 end------------------------


#----------remove ismt start----------------------
if [ `lsmod | grep -c "i2c_ismt "` -eq 1 ]; then
rmmod i2c_ismt
while [ `lsmod | grep -c "i2c_ismt "` -eq 1 ]
do
if [ $I2C_ISMT_RM_PRINT -eq 0 ]; then
I2C_ISMT_RM_PRINT=1
log_msg "Wait for i2c_ismt remove."
fi
if [ $I2C_ISMT_RM_RETRY -lt $RETRY ];then
I2C_ISMT_RM_RETRY=$((I2C_ISMT_RM_RETRY + 1))
else
break
fi
sleep 1
done
if [ $I2C_ISMT_RM_PRINT -eq 1 ]; then
log_msg "i2c_ismt remove success."
fi
fi
#----------remove ismt end------------------------

#----------insert i801 start----------------------
insmod /lib/modules/`uname -r`/kernel/drivers/i2c/busses/i2c-i801.ko
while [ `lsmod | grep -c "i2c_i801 "` -eq 0 ]
do
if [ $I2C_I801_INS_PRINT -eq 0 ]; then
I2C_I801_INS_PRINT=1
log_msg "Wait for i2c_i801 insert."
fi
if [ $I2C_I801_INS_RETRY -lt $RETRY ];then
I2C_I801_INS_RETRY=$((I2C_I801_INS_RETRY + 1))
else
break
fi
sleep 1
done
if [ $I2C_I801_INS_PRINT -eq 1 ]; then
log_msg "i2c_i801 insert success."
fi
#----------insert i801 end------------------------

#----------insert ismt start----------------------
insmod /lib/modules/`uname -r`/kernel/drivers/i2c/busses/i2c-ismt.ko
while [ `lsmod | grep -c "i2c_ismt "` -eq 0 ]
do
if [ $I2C_ISMT_INS_PRINT -eq 0 ]; then
I2C_ISMT_INS_PRINT=1
log_msg "Wait for i2c_ismt insert."
fi
if [ $I2C_ISMT_INS_RETRY -lt $RETRY ];then
I2C_ISMT_INS_RETRY=$((I2C_ISMT_INS_RETRY + 1))
else
break
fi
sleep 1
done
if [ $I2C_ISMT_INS_PRINT -eq 1 ]; then
log_msg "i2c_ismt insert success."
fi
#----------insert ismt start------------------------
modprobe i2c_i801
modprobe i2c_ismt

if [ `lsmod | grep -c "at24 "` -eq 0 ]; then
insmod /lib/modules/`uname -r`/kernel/drivers/misc/eeprom/at24.ko
fi
Expand Down Expand Up @@ -201,19 +105,24 @@ load_i2c_dev_modules () {
fi
}

# Load nvmem_core modules
load_nvmem_core_modules () {
if [ `lsmod | grep -c "nvmem_core "` -eq 0 ]; then
modprobe nvmem_core
fi
}

case "$1" in
start)
echo -n "Setting up board... "
depmod -a
echo -n "Loading modules for board... "
load_i2c_dev_modules
load_nvmem_core_modules
load_modules
echo "done."
;;

stop)
echo -n "cleaning... "


echo "done."

;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Provides: sys-polld
# Required-Start:
# Required-Stop:
# Default-Start: rc.local
# Default-Start:
# Default-Stop:
# Short-Description: Daemon sys-polld
### END INIT INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Provides: sys-servd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: rc.local
# Default-Stop: 0 1 6
# Default-Start:
# Default-Stop:
# Short-Description: Daemon sys-servd
### END INIT INFO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Provides: xcvr-servd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: rc.local
# Default-Stop: 0 1 6
# Default-Start:
# Default-Stop:
# Short-Description: Daemon xcvr-servd
### END INIT INFO

Expand Down

This file was deleted.

Loading

0 comments on commit 406c95f

Please sign in to comment.