brcm2708: order boards and models alphabetically

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
This commit is contained in:
Stijn Tintel 2017-03-05 21:16:06 +01:00 committed by Álvaro Fernández Rojas
parent 2543e986ad
commit a8c2a719fa
4 changed files with 27 additions and 23 deletions

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2014-2016 OpenWrt.org # Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2017 LEDE project
. /lib/functions/uci-defaults.sh . /lib/functions/uci-defaults.sh
. /lib/brcm2708.sh . /lib/brcm2708.sh
@ -11,10 +12,10 @@ board_config_update
board=$(brcm2708_board_name) board=$(brcm2708_board_name)
case "$board" in case "$board" in
rpi-b |\
rpi-b-plus |\
rpi-2-b |\ rpi-2-b |\
rpi-3-b) rpi-3-b |\
rpi-b |\
rpi-b-plus)
ucidef_set_interface_lan "eth0" ucidef_set_interface_lan "eth0"
;; ;;
esac esac

View file

@ -1,20 +1,21 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2015-2016 OpenWrt.org # Copyright (C) 2015-2016 OpenWrt.org
# Copyright (C) 2017 LEDE project
. /lib/functions/leds.sh . /lib/functions/leds.sh
. /lib/brcm2708.sh . /lib/brcm2708.sh
set_state() { set_state() {
case "$(brcm2708_board_name)" in case "$(brcm2708_board_name)" in
rpi-2-b |\
rpi-b-plus)
status_led="led1"
;;
rpi-b |\ rpi-b |\
rpi-cm |\ rpi-cm |\
rpi-zero) rpi-zero)
status_led="led0" status_led="led0"
;; ;;
rpi-b-plus |\
rpi-2-b)
status_led="led1"
;;
esac esac
case "$1" in case "$1" in

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2015-2016 OpenWrt.org # Copyright (C) 2015-2016 OpenWrt.org
# Copyright (C) 2017 LEDE project
ifname="" ifname=""
@ -8,25 +9,25 @@ brcm2708_detect() {
model=$(cat /proc/device-tree/model) model=$(cat /proc/device-tree/model)
case "$model" in case "$model" in
"Raspberry Pi Model B Rev"*)
board_name="rpi-b"
;;
"Raspberry Pi Model B Plus Rev"* |\
"Raspberry Pi Model B+ Rev"*)
board_name="rpi-b-plus"
;;
"Raspberry Pi Compute Module Rev"*)
board_name="rpi-cm"
;;
"Raspberry Pi Zero Rev"*)
board_name="rpi-zero"
;;
"Raspberry Pi 2 Model B Rev"*) "Raspberry Pi 2 Model B Rev"*)
board_name="rpi-2-b" board_name="rpi-2-b"
;; ;;
"Raspberry Pi 3 Model B Rev"*) "Raspberry Pi 3 Model B Rev"*)
board_name="rpi-3-b" board_name="rpi-3-b"
;; ;;
"Raspberry Pi Compute Module Rev"*)
board_name="rpi-cm"
;;
"Raspberry Pi Model B Plus Rev"* |\
"Raspberry Pi Model B+ Rev"*)
board_name="rpi-b-plus"
;;
"Raspberry Pi Model B Rev"*)
board_name="rpi-b"
;;
"Raspberry Pi Zero Rev"*)
board_name="rpi-zero"
;;
*) *)
board_name="unknown" board_name="unknown"
;; ;;

View file

@ -1,14 +1,15 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2015-2016 OpenWrt.org # Copyright (C) 2015-2016 OpenWrt.org
# Copyright (C) 2017 LEDE project
. /lib/brcm2708.sh . /lib/brcm2708.sh
set_preinit_iface() { set_preinit_iface() {
case "$(brcm2708_board_name)" in case "$(brcm2708_board_name)" in
rpi-b |\
rpi-b-plus |\
rpi-2-b |\ rpi-2-b |\
rpi-3-b) rpi-3-b |\
rpi-b |\
rpi-b-plus)
ifname=eth0 ifname=eth0
;; ;;
esac esac