at91.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2014 OpenWrt.org
  4. #
  5. AT91_BOARD_NAME=
  6. AT91_MODEL=
  7. at91_board_detect() {
  8. local machine
  9. local name
  10. machine=$(cat /proc/device-tree/model)
  11. case "$machine" in
  12. *"Atmel at91sam9263ek")
  13. name="at91sam9263ek"
  14. ;;
  15. *"Atmel AT91SAM9G15-EK")
  16. name="at91sam9g15ek"
  17. ;;
  18. *"Atmel at91sam9g20ek")
  19. name="at91sam9g20ek"
  20. ;;
  21. *"Atmel at91sam9g20ek 2 mmc")
  22. name="at91sam9g20ek_2mmc"
  23. ;;
  24. *"Atmel AT91SAM9G25-EK")
  25. name="at91sam9g25ek"
  26. ;;
  27. *"Atmel AT91SAM9G35-EK")
  28. name="at91sam9g35ek"
  29. ;;
  30. *"Atmel AT91SAM9M10G45-EK")
  31. name="at91sam9m10g45ek"
  32. ;;
  33. *"Atmel AT91SAM9X25-EK")
  34. name="at91sam9x25ek"
  35. ;;
  36. *"Atmel AT91SAM9X35-EK")
  37. name="at91sam9x35ek"
  38. ;;
  39. *"SAMA5D3 Xplained")
  40. name="sama5d3_xplained"
  41. ;;
  42. *"CalAmp LMU5000")
  43. name="lmu5000"
  44. ;;
  45. *"Calao TNY A9260")
  46. name="tny_a9260"
  47. ;;
  48. *"Calao TNY A9263")
  49. name="tny_a9263"
  50. ;;
  51. *"Calao TNY A9G20")
  52. name="tny_a9g20"
  53. ;;
  54. *"Calao USB A9260")
  55. name="usb_a9260"
  56. ;;
  57. *"Calao USB A9263")
  58. name="usb_a9263"
  59. ;;
  60. *"Calao USB A9G20")
  61. name="usb_a9g20"
  62. ;;
  63. *"Ethernut 5")
  64. name="ethernut5"
  65. ;;
  66. esac
  67. [ -z "$name" ] && name="unknown"
  68. [ -z "$AT91_BOARD_NAME" ] && AT91_BOARD_NAME="$name"
  69. [ -z "$AT91_MODEL" ] && AT91_MODEL="$machine"
  70. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  71. echo "$AT91_BOARD_NAME" > /tmp/sysinfo/board_name
  72. echo "$AT91_MODEL" > /tmp/sysinfo/model
  73. }
  74. at91_board_name() {
  75. local name
  76. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  77. [ -n "$name" ] || name="unknown"
  78. echo "$name"
  79. }