mvebu 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #
  2. # Copyright (C) 2014-2016 OpenWrt.org
  3. # Copyright (C) 2016 LEDE-Project.org
  4. #
  5. [ -e /etc/config/ubootenv ] && exit 0
  6. touch /etc/config/ubootenv
  7. . /lib/uboot-envtools.sh
  8. . /lib/functions.sh
  9. board=$(board_name)
  10. case "$board" in
  11. buffalo,ls220de|\
  12. buffalo,ls421de)
  13. ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
  14. ;;
  15. cznic,turris-omnia)
  16. idx="$(find_mtd_index u-boot-env)"
  17. if [ -n "$idx" ]; then
  18. ubootenv_add_uci_config "/dev/mtd${idx}" "0x0" "0x10000" "0x10000"
  19. elif grep -q 'U-Boot 2015.10-rc2' /dev/mtd0; then
  20. ubootenv_add_uci_config "/dev/mtd0" "0xc0000" "0x10000" "0x40000"
  21. else
  22. ubootenv_add_uci_config "/dev/mtd0" "0xf0000" "0x10000" "0x10000"
  23. fi
  24. ;;
  25. glinet,gl-mv1000)
  26. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x8000" "1"
  27. ;;
  28. globalscale,espressobin|\
  29. globalscale,espressobin-emmc|\
  30. globalscale,espressobin-ultra|\
  31. globalscale,espressobin-v7|\
  32. globalscale,espressobin-v7-emmc|\
  33. globalscale,mochabin)
  34. idx="$(find_mtd_index u-boot-env)"
  35. if [ -n "$idx" ]; then
  36. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
  37. else
  38. ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
  39. fi
  40. ;;
  41. marvell,armada8040-mcbin-doubleshot|\
  42. marvell,armada8040-mcbin-singleshot)
  43. ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
  44. ;;
  45. linksys,wrt1200ac|\
  46. linksys,wrt1900ac-v2|\
  47. linksys,wrt1900acs)
  48. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
  49. ;;
  50. linksys,wrt1900ac-v1)
  51. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
  52. ;;
  53. linksys,wrt3200acm|\
  54. linksys,wrt32x)
  55. ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
  56. ;;
  57. methode,udpu|\
  58. methode,edpu)
  59. idx="$(find_mtd_index u-boot-env)"
  60. if [ -n "$idx" ]; then
  61. ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" "1"
  62. else
  63. ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
  64. fi
  65. ;;
  66. esac
  67. config_load ubootenv
  68. config_foreach ubootenv_add_app_config ubootenv
  69. exit 0