imx6.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 DualLite/Solo GW552X" |\
  30. "Gateworks Ventana i.MX6 Dual/Quad GW552X")
  31. name="gw552x"
  32. ;;
  33. "Wandboard i.MX6 Dual Lite Board")
  34. name="wandboard"
  35. ;;
  36. *)
  37. name="generic"
  38. ;;
  39. esac
  40. [ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name"
  41. [ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine"
  42. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  43. echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name
  44. echo "$IMX6_MODEL" > /tmp/sysinfo/model
  45. }
  46. imx6_board_name() {
  47. local name
  48. [ -f /tmp/sysinfo/board_name ] || imx6_board_detect
  49. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  50. [ -z "$name" ] && name="unknown"
  51. echo "$name"
  52. }