mvebu.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2013-2015 OpenWrt.org
  4. # Copyright (C) 2016 LEDE-Project.org
  5. #
  6. MVEBU_BOARD_NAME=
  7. MVEBU_MODEL=
  8. mvebu_board_detect() {
  9. local machine
  10. local name
  11. machine=$(cat /proc/device-tree/model)
  12. case "$machine" in
  13. *"Marvell Armada 370 Evaluation Board")
  14. name="armada-370-db"
  15. ;;
  16. *"Globalscale Mirabox")
  17. name="mirabox"
  18. ;;
  19. *"Marvell Armada 370 Reference Design")
  20. name="armada-370-rd"
  21. ;;
  22. *"Marvell Armada XP Evaluation Board")
  23. name="armada-xp-db"
  24. ;;
  25. *"PlatHome OpenBlocks AX3-4 board")
  26. name="openblocks-ax3-4"
  27. ;;
  28. *"Marvell Armada XP GP Board")
  29. name="armada-xp-gp"
  30. ;;
  31. *"Linksys WRT1200AC")
  32. name="armada-385-linksys-caiman"
  33. ;;
  34. *"Linksys WRT1900AC")
  35. name="armada-xp-linksys-mamba"
  36. ;;
  37. *"Linksys WRT1900ACv2")
  38. name="armada-385-linksys-cobra"
  39. ;;
  40. *"Linksys WRT1900ACS")
  41. name="armada-385-linksys-shelby"
  42. ;;
  43. *"Linksys WRT3200ACM")
  44. name="armada-385-linksys-rango"
  45. ;;
  46. *"Marvell Armada 385 Access Point Development Board")
  47. name="armada-385-db-ap"
  48. ;;
  49. *"Marvell Armada XP Development Board DB-MV784MP-GP")
  50. name="armada-xp-gp"
  51. ;;
  52. *"SolidRun Clearfog A1")
  53. name="armada-388-clearfog"
  54. ;;
  55. esac
  56. [ -z "$name" ] && name="unknown"
  57. [ -z "$MVEBU_BOARD_NAME" ] && MVEBU_BOARD_NAME="$name"
  58. [ -z "$MVEBU_MODEL" ] && MVEBU_MODEL="$machine"
  59. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  60. echo "$MVEBU_BOARD_NAME" > /tmp/sysinfo/board_name
  61. echo "$MVEBU_MODEL" > /tmp/sysinfo/model
  62. }
  63. mvebu_board_name() {
  64. local name
  65. [ -f /tmp/sysinfo/board_name ] || mvebu_board_detect
  66. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  67. [ -z "$name" ] && name="unknown"
  68. echo "$name"
  69. }