From 706e2731b63fbba24843f7c844077e56fba70df4 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Fri, 18 Dec 2015 13:49:29 -0800 Subject: [PATCH] Quanta platform updates. --- .../src/lib/install/powerpc-quanta-lb9-r0.sh | 10 +- .../python/powerpc_quanta_lb9_r0/__init__.py | 1 - .../platform-config/r0/src/lib/etc/fancontrol | 1 + .../r0/src/lib/etc/fancontrol.b2f | 16 ++ .../r0/src/lib/etc/sensors3.conf | 42 +--- .../src/lib/install/powerpc-quanta-ly2-r0.sh | 22 +- .../platform-config/r0/src/lib/sbin/gpio_init | 209 ++++++++++++++++++ .../python/powerpc_quanta_ly2_r0/__init__.py | 3 +- 8 files changed, 245 insertions(+), 59 deletions(-) create mode 100644 packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol.b2f create mode 100755 packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/sbin/gpio_init diff --git a/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/lib/install/powerpc-quanta-lb9-r0.sh b/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/lib/install/powerpc-quanta-lb9-r0.sh index 22019c45..5f9df9f4 100644 --- a/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/lib/install/powerpc-quanta-lb9-r0.sh +++ b/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/lib/install/powerpc-quanta-lb9-r0.sh @@ -18,17 +18,15 @@ # # ############################################################ -############################################################ -# -# Installer scriptlet for the Quanta LB9. -# + # The loader must be written raw to the first partition. platform_loader_raw=1 + # The bootcommand is to read the loader directly from the first partition and execute it. -platform_bootcmd='diskboot 0x10000000 0:1 ; setenv bootargs console=$consoledev,$baudrate onl_platform=powerpc-quanta-lb9-r0; bootm 0x10000000#quanta-lb9-r0' +platform_bootcmd="diskboot 0x10000000 0:1 ; setenv bootargs console=\$consoledev,\$baudrate onl_platform=$ONL_PLATFORM; bootm 0x10000000#$ONL_PLATFORM" platform_installer() { # Standard installation on the CF card. - installer_standard_blockdev_install sda 16M 64M "" + installer_standard_blockdev_install sda 128M 128M "" } diff --git a/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/python/powerpc_quanta_lb9_r0/__init__.py b/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/python/powerpc_quanta_lb9_r0/__init__.py index 870d5c38..61872744 100644 --- a/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/python/powerpc_quanta_lb9_r0/__init__.py +++ b/packages/platforms/quanta/powerpc-quanta-lb9/platform-config/r0/src/python/powerpc_quanta_lb9_r0/__init__.py @@ -33,7 +33,6 @@ class OnlPlatform_powerpc_quanta_lb9_r0(OnlPlatformQuanta): else: sys.exit(1) - subprocess.call("%s/sbin/gpio_init" % self.basedir_onl()) return True def sys_oid_platform(self): diff --git a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol index 77480a2f..e38e15ee 100644 --- a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol +++ b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol @@ -13,3 +13,4 @@ MINTEMP=hwmon0/device/pwm1=20 hwmon0/device/pwm2=20 hwmon0/device/pwm3=20 hwmon0 MAXTEMP=hwmon0/device/pwm1=60 hwmon0/device/pwm2=60 hwmon0/device/pwm3=60 hwmon0/device/pwm4=60 MINSTART=hwmon0/device/pwm1=150 hwmon0/device/pwm2=150 hwmon0/device/pwm3=150 hwmon0/device/pwm4=150 MINSTOP=hwmon0/device/pwm1=0 hwmon0/device/pwm2=0 hwmon0/device/pwm3=0 hwmon0/device/pwm4=0 +MAXPWM=hwmon0/device/pwm1=254 hwmon0/device/pwm2=254 hwmon0/device/pwm3=254 hwmon0/device/pwm4=254 diff --git a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol.b2f b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol.b2f new file mode 100644 index 00000000..c3a6a067 --- /dev/null +++ b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/fancontrol.b2f @@ -0,0 +1,16 @@ +############################################################ +# +# Platform: Quanta LY2 +# +############################################################ + +INTERVAL=10 +DEVPATH=hwmon0=devices/soc.0/ffe03000.i2c/i2c-0/i2c-4/4-002e +DEVNAME=hwmon0=quanta_ly_hwmon +FCTEMPS=hwmon0/device/pwm5=hwmon0/device/temp1_input hwmon0/device/pwm6=hwmon0/device/temp1_input hwmon0/device/pwm7=hwmon0/device/temp1_input hwmon0/device/pwm8=hwmon0/device/temp1_input +FCFANS=hwmon0/device/pwm5=hwmon0/device/fan5_input hwmon0/device/pwm6=hwmon0/device/fan6_input hwmon0/device/pwm7=hwmon0/device/fan7_input hwmon0/device/pwm8=hwmon0/device/fan8_input +MINTEMP=hwmon0/device/pwm5=20 hwmon0/device/pwm6=20 hwmon0/device/pwm7=20 hwmon0/device/pwm8=20 +MAXTEMP=hwmon0/device/pwm5=60 hwmon0/device/pwm6=60 hwmon0/device/pwm7=60 hwmon0/device/pwm8=60 +MINSTART=hwmon0/device/pwm5=150 hwmon0/device/pwm6=150 hwmon0/device/pwm7=150 hwmon0/device/pwm8=150 +MINSTOP=hwmon0/device/pwm5=0 hwmon0/device/pwm6=0 hwmon0/device/pwm7=0 hwmon0/device/pwm8=0 +MAXPWM=hwmon0/device/pwm5=254 hwmon0/device/pwm6=254 hwmon0/device/pwm7=254 hwmon0/device/pwm8=254 diff --git a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/sensors3.conf b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/sensors3.conf index 8da532e9..28825e47 100644 --- a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/sensors3.conf +++ b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/etc/sensors3.conf @@ -3,41 +3,7 @@ # Platform: Quanta LY2 # ############################################################ - -chip "quanta_ly_hwmon-*" - label fan1 "Fan 1" - label fan2 "Fan 2" - label fan3 "Fan 3" - label fan4 "Fan 4" - label temp1 "Temp 1" - label temp2 "Temp 2" - label temp3 "Temp 3" - label temp4 "Temp 4" - label temp5 "Temp 5" - -chip "pmbus-*" - label in1 "Vin" - ignore in2 - label in3 "Vout" - compute in3 @/500,500*@ - ignore in4 - ignore in5 - ignore in6 - ignore in7 - label fan1 "Fan 5" - label temp1 "Temp 6" - label temp2 "Temp 7" - label temp3 "Temp 8" - label power1 "Pin" - label power2 "Pout" - ignore power3 - ignore power4 - ignore power5 - ignore power6 - label curr1 "Iin" - label curr2 "Iout" - ignore curr3 - ignore curr4 - ignore curr5 - ignore curr6 - ignore curr7 +# +# This sensor data is now processed by the platform code. +# +############################################################ diff --git a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/install/powerpc-quanta-ly2-r0.sh b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/install/powerpc-quanta-ly2-r0.sh index 408ba621..75de0afa 100644 --- a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/install/powerpc-quanta-ly2-r0.sh +++ b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/install/powerpc-quanta-ly2-r0.sh @@ -1,33 +1,29 @@ ############################################################ # -# -# Copyright 2013, 2014 Big Switch Networks, Inc. -# +# +# Copyright 2013, 2014 Big Switch Networks, Inc. +# # Licensed under the Eclipse Public License, Version 1.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.eclipse.org/legal/epl-v10.html -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, # either express or implied. See the License for the specific # language governing permissions and limitations under the # License. -# +# # ############################################################ -############################################################ -# -# Installer scriptlet for the Quanta LY2. -# -# The bootcommand is to read the loader directly from the first partition and execute it. -platform_bootcmd='mmc part 0; fatload mmc 0:1 0x10000000 onl-loader; setenv bootargs console=$consoledev,$baudrate onl_platform=powerpc-quanta-ly2-r0; bootm 0x10000000' +# The bootcommand is to read the loader directly from the first partition and execute it. +platform_bootcmd="mmc part 0; fatload mmc 0:1 0x10000000 $ONL_PLATFORM.itb; setenv bootargs console=\$consoledev,\$baudrate onl_platform=$ONL_PLATFORM; bootm 0x10000000#$ONL_PLATFORM" platform_installer() { # Standard installation on the CF card. - installer_standard_blockdev_install mmcblk0 16M 64M "" + installer_standard_blockdev_install mmcblk0 128M 128M "" } diff --git a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/sbin/gpio_init b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/sbin/gpio_init new file mode 100755 index 00000000..c03d00df --- /dev/null +++ b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/lib/sbin/gpio_init @@ -0,0 +1,209 @@ +#!/bin/sh +set -e + +# fport 1 (pport 0.1) MOD_ABS --> gpio168 +echo "168" > /sys/class/gpio/export +# fport 1 (pport 0.1) RESET missing + +# fport 2 (pport 0.2) MOD_ABS --> gpio169 +echo "169" > /sys/class/gpio/export +# fport 2 (pport 0.2) RESET missing + +# fport 3 (pport 0.3) MOD_ABS --> gpio170 +echo "170" > /sys/class/gpio/export +# fport 3 (pport 0.3) RESET missing + +# fport 4 (pport 0.4) MOD_ABS --> gpio171 +echo "171" > /sys/class/gpio/export +# fport 4 (pport 0.4) RESET missing + +# fport 5 (pport 0.5) MOD_ABS --> gpio172 +echo "172" > /sys/class/gpio/export +# fport 5 (pport 0.5) RESET missing + +# fport 6 (pport 0.6) MOD_ABS --> gpio173 +echo "173" > /sys/class/gpio/export +# fport 6 (pport 0.6) RESET missing + +# fport 7 (pport 0.7) MOD_ABS --> gpio174 +echo "174" > /sys/class/gpio/export +# fport 7 (pport 0.7) RESET missing + +# fport 8 (pport 0.8) MOD_ABS --> gpio175 +echo "175" > /sys/class/gpio/export +# fport 8 (pport 0.8) RESET missing + +# fport 9 (pport 0.9) MOD_ABS --> gpio176 +echo "176" > /sys/class/gpio/export +# fport 9 (pport 0.9) RESET missing + +# fport 10 (pport 0.10) MOD_ABS --> gpio177 +echo "177" > /sys/class/gpio/export +# fport 10 (pport 0.10) RESET missing + +# fport 11 (pport 0.11) MOD_ABS --> gpio178 +echo "178" > /sys/class/gpio/export +# fport 11 (pport 0.11) RESET missing + +# fport 12 (pport 0.12) MOD_ABS --> gpio179 +echo "179" > /sys/class/gpio/export +# fport 12 (pport 0.12) RESET missing + +# fport 13 (pport 0.13) MOD_ABS --> gpio180 +echo "180" > /sys/class/gpio/export +# fport 13 (pport 0.13) RESET missing + +# fport 14 (pport 0.14) MOD_ABS --> gpio181 +echo "181" > /sys/class/gpio/export +# fport 14 (pport 0.14) RESET missing + +# fport 15 (pport 0.15) MOD_ABS --> gpio182 +echo "182" > /sys/class/gpio/export +# fport 15 (pport 0.15) RESET missing + +# fport 16 (pport 0.16) MOD_ABS --> gpio183 +echo "183" > /sys/class/gpio/export +# fport 16 (pport 0.16) RESET missing + +# fport 17 (pport 0.17) MOD_ABS --> gpio144 +echo "144" > /sys/class/gpio/export +# fport 17 (pport 0.17) RESET missing + +# fport 18 (pport 0.18) MOD_ABS --> gpio145 +echo "145" > /sys/class/gpio/export +# fport 18 (pport 0.18) RESET missing + +# fport 19 (pport 0.19) MOD_ABS --> gpio146 +echo "146" > /sys/class/gpio/export +# fport 19 (pport 0.19) RESET missing + +# fport 20 (pport 0.20) MOD_ABS --> gpio147 +echo "147" > /sys/class/gpio/export +# fport 20 (pport 0.20) RESET missing + +# fport 21 (pport 0.21) MOD_ABS --> gpio148 +echo "148" > /sys/class/gpio/export +# fport 21 (pport 0.21) RESET missing + +# fport 22 (pport 0.22) MOD_ABS --> gpio149 +echo "149" > /sys/class/gpio/export +# fport 22 (pport 0.22) RESET missing + +# fport 23 (pport 0.23) MOD_ABS --> gpio150 +echo "150" > /sys/class/gpio/export +# fport 23 (pport 0.23) RESET missing + +# fport 24 (pport 0.24) MOD_ABS --> gpio151 +echo "151" > /sys/class/gpio/export +# fport 24 (pport 0.24) RESET missing + +# fport 25 (pport 0.25) MOD_ABS --> gpio152 +echo "152" > /sys/class/gpio/export +# fport 25 (pport 0.25) RESET missing + +# fport 26 (pport 0.26) MOD_ABS --> gpio153 +echo "153" > /sys/class/gpio/export +# fport 26 (pport 0.26) RESET missing + +# fport 27 (pport 0.27) MOD_ABS --> gpio154 +echo "154" > /sys/class/gpio/export +# fport 27 (pport 0.27) RESET missing + +# fport 28 (pport 0.28) MOD_ABS --> gpio155 +echo "155" > /sys/class/gpio/export +# fport 28 (pport 0.28) RESET missing + +# fport 29 (pport 0.29) MOD_ABS --> gpio156 +echo "156" > /sys/class/gpio/export +# fport 29 (pport 0.29) RESET missing + +# fport 30 (pport 0.30) MOD_ABS --> gpio157 +echo "157" > /sys/class/gpio/export +# fport 30 (pport 0.30) RESET missing + +# fport 31 (pport 0.31) MOD_ABS --> gpio158 +echo "158" > /sys/class/gpio/export +# fport 31 (pport 0.31) RESET missing + +# fport 32 (pport 0.32) MOD_ABS --> gpio159 +echo "159" > /sys/class/gpio/export +# fport 32 (pport 0.32) RESET missing + +# fport 33 (pport 0.33) MOD_ABS --> gpio120 +echo "120" > /sys/class/gpio/export +# fport 33 (pport 0.33) RESET missing + +# fport 34 (pport 0.34) MOD_ABS --> gpio121 +echo "121" > /sys/class/gpio/export +# fport 34 (pport 0.34) RESET missing + +# fport 35 (pport 0.35) MOD_ABS --> gpio122 +echo "122" > /sys/class/gpio/export +# fport 35 (pport 0.35) RESET missing + +# fport 36 (pport 0.36) MOD_ABS --> gpio123 +echo "123" > /sys/class/gpio/export +# fport 36 (pport 0.36) RESET missing + +# fport 37 (pport 0.37) MOD_ABS --> gpio124 +echo "124" > /sys/class/gpio/export +# fport 37 (pport 0.37) RESET missing + +# fport 38 (pport 0.38) MOD_ABS --> gpio125 +echo "125" > /sys/class/gpio/export +# fport 38 (pport 0.38) RESET missing + +# fport 39 (pport 0.39) MOD_ABS --> gpio126 +echo "126" > /sys/class/gpio/export +# fport 39 (pport 0.39) RESET missing + +# fport 40 (pport 0.40) MOD_ABS --> gpio127 +echo "127" > /sys/class/gpio/export +# fport 40 (pport 0.40) RESET missing + +# fport 41 (pport 0.41) MOD_ABS --> gpio128 +echo "128" > /sys/class/gpio/export +# fport 41 (pport 0.41) RESET missing + +# fport 42 (pport 0.42) MOD_ABS --> gpio129 +echo "129" > /sys/class/gpio/export +# fport 42 (pport 0.42) RESET missing + +# fport 43 (pport 0.43) MOD_ABS --> gpio130 +echo "130" > /sys/class/gpio/export +# fport 43 (pport 0.43) RESET missing + +# fport 44 (pport 0.44) MOD_ABS --> gpio131 +echo "131" > /sys/class/gpio/export +# fport 44 (pport 0.44) RESET missing + +# fport 45 (pport 0.45) MOD_ABS --> gpio132 +echo "132" > /sys/class/gpio/export +# fport 45 (pport 0.45) RESET missing + +# fport 46 (pport 0.46) MOD_ABS --> gpio133 +echo "133" > /sys/class/gpio/export +# fport 46 (pport 0.46) RESET missing + +# fport 47 (pport 0.47) MOD_ABS --> gpio134 +echo "134" > /sys/class/gpio/export +# fport 47 (pport 0.47) RESET missing + +# fport 48 (pport 0.48) MOD_ABS --> gpio135 +echo "135" > /sys/class/gpio/export +# fport 48 (pport 0.48) RESET missing + +# fport 49 (pport 0.49) MOD_ABS missing +# fport 49 (pport 0.49) RESET missing + +# fport 50 (pport 0.50) MOD_ABS missing +# fport 50 (pport 0.50) RESET missing + +# fport 51 (pport 0.51) MOD_ABS missing +# fport 51 (pport 0.51) RESET missing + +# fport 52 (pport 0.52) MOD_ABS missing +# fport 52 (pport 0.52) RESET missing + + +exit 0 diff --git a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/python/powerpc_quanta_ly2_r0/__init__.py b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/python/powerpc_quanta_ly2_r0/__init__.py index 4f6e625b..79f42461 100644 --- a/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/python/powerpc_quanta_ly2_r0/__init__.py +++ b/packages/platforms/quanta/powerpc-quanta-ly2/platform-config/r0/src/python/powerpc_quanta_ly2_r0/__init__.py @@ -15,6 +15,8 @@ class OnlPlatform_powerpc_quanta_ly2_r0(OnlPlatformQuanta): return "powerpc-quanta-ly2-r0" def baseconfig(self): + subprocess.check_call("%s/sbin/gpio_init" % self.basedir_onl()) + fan_dir='/sys/devices/soc.0/ffe03000.i2c/i2c-0/i2c-4/4-002e/fan_dir' if os.path.exists(fan_dir): with open(fan_dir) as f: @@ -35,7 +37,6 @@ class OnlPlatform_powerpc_quanta_ly2_r0(OnlPlatformQuanta): else: sys.exit(1) - subprocess.call("%s/sbin/gpio_init" % self.basedir_onl()) return True def sys_oid_platform(self):