at91-sama5_common.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #include <asm/hardware.h>
  12. #define CONFIG_SYS_TEXT_BASE 0x26f00000
  13. /* ARM asynchronous clock */
  14. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  15. #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
  16. #define CONFIG_ARCH_CPU_INIT
  17. #ifndef CONFIG_SPL_BUILD
  18. #define CONFIG_SKIP_LOWLEVEL_INIT
  19. #endif
  20. #define CONFIG_BOARD_EARLY_INIT_F
  21. #define CONFIG_ENV_VARS_UBOOT_CONFIG
  22. /* general purpose I/O */
  23. #define CONFIG_AT91_GPIO
  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_SYS_USE_MMC
  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_IS_IN_FAT
  43. #define CONFIG_FAT_WRITE
  44. #define FAT_ENV_INTERFACE "mmc"
  45. #define FAT_ENV_DEVICE_AND_PART "0"
  46. #define FAT_ENV_FILE "uboot.env"
  47. #define CONFIG_ENV_SIZE 0x4000
  48. #endif
  49. #define CONFIG_BOOTCOMMAND "if test ! -n ${dtb_name}; then " \
  50. "setenv dtb_name at91-${board_name}.dtb; " \
  51. "fi; " \
  52. "fatload mmc 0:1 0x21000000 ${dtb_name}; " \
  53. "fatload mmc 0:1 0x22000000 zImage; " \
  54. "bootz 0x22000000 - 0x21000000"
  55. #define CONFIG_BOOTARGS \
  56. "console=ttyS0,115200 earlyprintk " \
  57. "root=/dev/mmcblk0p2 rw rootwait"
  58. #else
  59. #define CONFIG_BOOTARGS \
  60. "console=ttyS0,115200 earlyprintk " \
  61. "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \
  62. "256K(env),256k(env_redundant),256k(spare)," \
  63. "512k(dtb),6M(kernel)ro,-(rootfs) " \
  64. "rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
  65. #ifdef CONFIG_SYS_USE_NANDFLASH
  66. /* u-boot env in nand flash */
  67. #define CONFIG_ENV_IS_IN_NAND
  68. #define CONFIG_ENV_OFFSET 0xc0000
  69. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  70. #define CONFIG_ENV_SIZE 0x20000
  71. #define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
  72. "nand read 0x22000000 0x200000 0x600000;" \
  73. "bootz 0x22000000 - 0x21000000"
  74. #elif CONFIG_SYS_USE_SERIALFLASH
  75. /* u-boot env in serial flash, by default is bus 0 and cs 0 */
  76. #define CONFIG_ENV_IS_IN_SPI_FLASH
  77. #define CONFIG_ENV_OFFSET 0x6000
  78. #define CONFIG_ENV_SIZE 0x2000
  79. #define CONFIG_ENV_SECT_SIZE 0x1000
  80. #define CONFIG_BOOTCOMMAND "sf probe 0; " \
  81. "sf read 0x21000000 0x60000 0xc000; " \
  82. "sf read 0x22000000 0x6c000 0x394000; " \
  83. "bootz 0x22000000 - 0x21000000"
  84. #endif
  85. #endif
  86. #define CONFIG_BAUDRATE 115200
  87. #define CONFIG_SYS_CBSIZE 256
  88. #define CONFIG_SYS_MAXARGS 16
  89. #define CONFIG_SYS_LONGHELP
  90. #define CONFIG_CMDLINE_EDITING
  91. #define CONFIG_AUTO_COMPLETE
  92. /* Size of malloc() pool */
  93. #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
  94. #endif