Support for RTL838x based managed switches

@dmascord @ljanzen I've pushed my WiP tree for the 24 port HP 1920 24+4 port PoE switches (JG925A and JG926A) to https://github.com/tim-seoss/openwrt/tree/hpe-1920-24g-poe-370w-jg926a

Known issues and/or TODO are:

  • When the kernel resets the GPIOs, it sets the fan to run at low speed (this might be a bug), and the gpio-fan kernel module has the policy of not changing initial state (it should be set by firmware). This is bad since it can almost certainly lead to hardware damage under high load and/or temperature conditions. See: Support for RTL838x based managed switches - #2668 by TimSmall
  • Switch the fan speed to high with: echo 10000 > /sys/devices/platform/gpio-fan-chassis-a rray/hwmon/hwmon0/fan1_target (FIXME: this should be done by default at boot time).
  • Fan speed should switch to high based on whatever algorithm HP/H3C/HPE uses.
  • Failure of an individual fan (indicated when /sys/devices/platform/gpio-fan-chassis-array/hwmon/hwmon0/fan1_alarm reads 1), should also trigger a switch to high fan speed (i.e. if one fan fails, then the others should switch to high speed and/or high speed selection might free a stalled fan).

The script below will create a poe config, needs integrating...

#!/bin/bash

NUMPORTS=24
TOTAL_POWER=370
# TOTAL_POWER=180
SCHEME=block-reversed

echo "config global"
echo "  option budget '${TOTAL_POWER}'"

for p in `eval echo {1..${NUMPORTS}}`
do 
        BLOCK=$(( ( ( ( $p - 1 ) / 8 ) + 1 ) * 8 ))
        ID=$(( $BLOCK - ( ( $p - 1 ) % 8) ))
        echo 
        echo "config port"
        echo "  option name 'lan${p}'"
        echo "  option enable '1'"
        echo "  option id '${ID}'" 
        echo "  option poe_plus '1'"
        echo "  option priority '2'"
done
1 Like