at91-sama5_common.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Common part of configuration settings for the AT91 SAMA5 board.
  3. *
  4. * Copyright (C) 2015 Atmel Corporation
  5. * Josh Wu <josh.wu@atmel.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __AT91_SAMA5_COMMON_H
  10. #define __AT91_SAMA5_COMMON_H
  11. #define CONFIG_SYS_TEXT_BASE 0x26f00000
  12. /* ARM asynchronous clock */
  13. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  14. #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
  15. #define CONFIG_ARCH_CPU_INIT
  16. #ifndef CONFIG_SPL_BUILD
  17. #define CONFIG_SKIP_LOWLEVEL_INIT
  18. #endif
  19. #define CONFIG_ENV_VARS_UBOOT_CONFIG
  20. /* general purpose I/O */
  21. #ifndef CONFIG_DM_GPIO
  22. #define CONFIG_AT91_GPIO
  23. #endif
  24. /*
  25. * BOOTP options
  26. */
  27. #define CONFIG_BOOTP_BOOTFILESIZE
  28. #define CONFIG_BOOTP_BOOTPATH
  29. #define CONFIG_BOOTP_GATEWAY
  30. #define CONFIG_BOOTP_HOSTNAME
  31. /*
  32. * Command line configuration.
  33. */
  34. #ifdef CONFIG_SD_BOOT
  35. #ifdef CONFIG_ENV_IS_IN_MMC
  36. /* Use raw reserved sectors to save environment */
  37. #define CONFIG_ENV_OFFSET 0x2000
  38. #define CONFIG_ENV_SIZE 0x1000
  39. #define CONFIG_SYS_MMC_ENV_DEV 0
  40. #else
  41. /* u-boot env in sd/mmc card */
  42. #define CONFIG_ENV_SIZE 0x4000
  43. #endif
  44. #define CONFIG_BOOTCOMMAND "if test ! -n ${dtb_name}; then " \
  45. "setenv dtb_name at91-${board_name}.dtb; " \
  46. "fi; " \
  47. "fatload mmc 0:1 0x21000000 ${dtb_name}; " \
  48. "fatload mmc 0:1 0x22000000 zImage; " \
  49. "bootz 0x22000000 - 0x21000000"
  50. #else
  51. #ifdef CONFIG_NAND_BOOT
  52. /* u-boot env in nand flash */
  53. #define CONFIG_ENV_OFFSET 0xc0000
  54. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  55. #define CONFIG_ENV_SIZE 0x20000
  56. #define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
  57. "nand read 0x22000000 0x200000 0x600000;" \
  58. "bootz 0x22000000 - 0x21000000"
  59. #elif CONFIG_SPI_BOOT
  60. /* u-boot env in serial flash, by default is bus 0 and cs 0 */
  61. #define CONFIG_ENV_OFFSET 0x6000
  62. #define CONFIG_ENV_SIZE 0x2000
  63. #define CONFIG_ENV_SECT_SIZE 0x1000
  64. #define CONFIG_BOOTCOMMAND "sf probe 0; " \
  65. "sf read 0x21000000 0x60000 0xc000; " \
  66. "sf read 0x22000000 0x6c000 0x394000; " \
  67. "bootz 0x22000000 - 0x21000000"
  68. #endif
  69. #endif
  70. #define CONFIG_SYS_LONGHELP
  71. #define CONFIG_CMDLINE_EDITING
  72. #define CONFIG_AUTO_COMPLETE
  73. /* Size of malloc() pool */
  74. #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
  75. #endif