-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[platform]: update mitac platform drivers to support stretch. #1983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
64a2c16
0085456
406c95f
95bdd4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
platform drivers of MiTAC products for the SONiC project | ||
# sonic-platform-modules-mitac_stretch | ||
platform drivers of MiTAC products for the SONiC project of Debian 9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,11 @@ | |
|
||
case "$1" in | ||
start) | ||
eval sonic_version=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") | ||
if [ -f /host/image-$sonic_version/platform/firsttime ]; then | ||
update-rc.d xcvr_servd defaults >/dev/null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not see xcvr_servd in the repository. what does it do? Is it same as sonic xrcvd? https://github.com/Azure/sonic-platform-daemons/tree/master/sonic-xcvrd/scripts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a binary daemon and different from SONiC's xrcvd. The xcvr_servd will execute several initial processes whenever transceiver plug-in, otherwise the transceiver cannot work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is open source project, we cannot have binaries to be checked-in. xrcvd does what you say, it detect the transceiver plug-in plug-out event and does something. if it miss functions you plan to add to you platform, it is the right place to add. Not submitting binary. |
||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs to be moved into postinst script, it should not be in the init script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will move this to postinst. |
||
|
||
echo -n "Setting up board... " | ||
|
||
echo 0 > /proc/sys/kernel/perf_cpu_time_max_percent | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: setup-board | ||
# Provides: setup-board-i2c | ||
# Required-Start: | ||
# Required-Stop: | ||
# Should-Start: | ||
|
@@ -11,6 +11,7 @@ | |
# Short-Description: Setup ly1200-32x board. | ||
### END INIT INFO | ||
|
||
I2C_BUS_RM_ALL=0 | ||
I2C_I801_RM_PRINT=0 | ||
I2C_ISMT_RM_PRINT=0 | ||
I2C_I801_INS_PRINT=0 | ||
|
@@ -47,6 +48,21 @@ 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 | ||
|
@@ -188,6 +204,7 @@ load_i2c_dev_modules () { | |
case "$1" in | ||
start) | ||
echo -n "Setting up board... " | ||
depmod -a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. depmod -a should not be in init script, it should be postinst for package installation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. postinst will automatically add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We create an environment to test reboot 1000 times. If we don't add "depmod -a" here, we will get a "libkmod: ERROR" message. According to "https://books.google.com.tw/books?id=hG_bhCL4tQ8C&pg=PA417&lpg=PA417&dq=why+depmod+everytime&source=bl&ots=DPSB8IGh3M&sig=CU8KApYOLwEeTXYGYpI5LtDIQtY&hl=zh-TW&sa=X&ved=2ahUKEwjXhcuh9pjbAhXBU7wKHee9BQoQ6AEwBXoECAEQZg#v=onepage&q=why%20depmod%20everytime&f=false", "depmod -a" should run every boot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot see the book. depmod should not be in init script, it should be only run during package installation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please go to the directory in ${sonic}/platform/broadcom/ and execute following command grep -nri --exclude-dir=debian --exclude=*.[ch] "depmod -a" * You can see not every vendor runs "depmod -a" once during package installation. Some vendors run "depmod -a" during every boot via *.py which is executed by *.service of systemd. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. modeles.dep does not need to be re-created every boot. we need to re-build them when we introduce new kernel moduels into the image. essentially the package installation time. As you can see, not all vendors are doing the right thing, we will correct them one-by-one, and we can discuss this in the coming community meeting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will remove "depmod -a" from init script. |
||
load_i2c_dev_modules | ||
load_modules | ||
echo "done." | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
##### Temperature vs Fan table ##### | ||
## FORMAT: "PWM" fan speed(range from 0 to 255) | ||
# Duty Cycle 25% 30% 35% 40% 45% 50% 55% 60% 65% 70% 75% 80% 85% 90% 95% 100% | ||
PWM 64 77 89 102 115 128 140 153 166 179 191 204 217 230 242 255 | ||
# Duty Cycle 30% 32.5% 35% 37.5% 40% 45% 50% 55% 60% 65% 70% 75% 80% 90% 100% | ||
PWM 77 83 89 95 102 114 128 141 153 166 179 192 204 230 255 | ||
## FORMAT: sensor name(TEMP_XXX) with asserted temperature by each levels | ||
TEMP_CPU 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 | ||
TEMP_SWITCH 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 | ||
TEMP_CPU 46 48 50 52 54 57 60 63 66 69 72 75 78 81 84 | ||
TEMP_SWITCH 72 74 76 78 80 83 86 89 92 95 98 101 104 107 110 | ||
#TEMP_HDD 25 | ||
#TEMP_TMP75_CPU 25 | ||
#TEMP_TMP75_CENTER 25 | ||
#TEMP_TMP75_RIGHT 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 | ||
TEMP_TMP75_FAN 26.5 31.5 36.5 41.5 46.5 51.5 56.5 61.5 66.5 71.5 76.5 81.5 86.5 91.5 96.5 101.5 | ||
#TEMP_TMP75_RIGHT 33 37 45 53 61 69 77 85 93 | ||
TEMP_TMP75_FAN 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 | ||
TEMP_XCVR 36 38 40 42 44 46 48 50 52 54 56 58 60 63 66 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using override semantic is better, this is a standard Debian rules file.
check example here.
https://github.com/Azure/sonic-platform-modules-s6000/blob/master/debian/rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep using override semantic as you said.