mvebu.sh 1.6 KB

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