mkconfig 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh -e
  2. # Script to create header files and links to configure
  3. # U-Boot for a specific board.
  4. #
  5. # Parameters: Target Architecture CPU Board [VENDOR] [SOC]
  6. #
  7. # (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
  8. #
  9. APPEND=no # Default: Create new config file
  10. BOARD_NAME="" # Name to print in make output
  11. while [ $# -gt 0 ] ; do
  12. case "$1" in
  13. --) shift ; break ;;
  14. -a) shift ; APPEND=yes ;;
  15. -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
  16. *) break ;;
  17. esac
  18. done
  19. [ "${BOARD_NAME}" ] || BOARD_NAME="$1"
  20. [ $# -lt 4 ] && exit 1
  21. [ $# -gt 6 ] && exit 1
  22. echo "Configuring for ${BOARD_NAME} board..."
  23. cd ./include
  24. #
  25. # Create link to architecture specific headers
  26. #
  27. rm -f asm
  28. ln -s asm-$2 asm
  29. rm -f asm-$2/arch
  30. if [ -z "$6" -o "$6" = "NULL" ] ; then
  31. ln -s arch-$3 asm-$2/arch
  32. else
  33. ln -s arch-$6 asm-$2/arch
  34. fi
  35. if [ "$2" = "arm" ] ; then
  36. rm -f asm-$2/proc
  37. ln -s proc-armv asm-$2/proc
  38. fi
  39. #
  40. # Create include file for Make
  41. #
  42. echo "ARCH = $2" > config.mk
  43. echo "CPU = $3" >> config.mk
  44. echo "BOARD = $4" >> config.mk
  45. [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
  46. [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
  47. #
  48. # Create board specific header file
  49. #
  50. if [ "$APPEND" = "yes" ] # Append to existing config file
  51. then
  52. echo >> config.h
  53. else
  54. > config.h # Create new config file
  55. fi
  56. echo "/* Automatically generated - do not edit */" >>config.h
  57. echo "#include <configs/$1.h>" >>config.h
  58. exit 0