imx6.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2010-2013 OpenWrt.org
  4. #
  5. IMX6_BOARD_NAME=
  6. IMX6_MODEL=
  7. imx6_board_detect() {
  8. local machine
  9. local name
  10. machine=$(cat /proc/device-tree/model)
  11. case "$machine" in
  12. "Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\
  13. "Gateworks Ventana i.MX6 Dual/Quad GW51XX")
  14. name="gw51xx"
  15. ;;
  16. "Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\
  17. "Gateworks Ventana i.MX6 Dual/Quad GW52XX")
  18. name="gw52xx"
  19. ;;
  20. "Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\
  21. "Gateworks Ventana i.MX6 Dual/Quad GW53XX")
  22. name="gw53xx"
  23. ;;
  24. "Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\
  25. "Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\
  26. "Gateworks Ventana GW5400-A")
  27. name="gw54xx"
  28. ;;
  29. "Gateworks Ventana i.MX6 Dual/Quad GW551X" |\
  30. "Gateworks Ventana i.MX6 Solo/DualLite GW551X")
  31. name="gw551x"
  32. ;;
  33. "Gateworks Ventana i.MX6 DualLite/Solo GW552X" |\
  34. "Gateworks Ventana i.MX6 Dual/Quad GW552X")
  35. name="gw552x"
  36. ;;
  37. "Wandboard i.MX6 Dual Lite Board")
  38. name="wandboard"
  39. ;;
  40. *)
  41. name="generic"
  42. ;;
  43. esac
  44. [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name"
  45. [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine"
  46. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  47. echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name
  48. echo "$IMX6_MODEL" > /tmp/sysinfo/model
  49. }
  50. imx6_board_name() {
  51. local name
  52. [ -f /tmp/sysinfo/board_name ] || imx6_board_detect
  53. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  54. [ -z "$name" ] && name="unknown"
  55. echo "$name"
  56. }