at91sam9260ek.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2007-2008
  4. * Stelian Pop <stelian@popies.net>
  5. * Lead Tech Design <www.leadtechdesign.com>
  6. *
  7. * Configuation settings for the AT91SAM9260EK & AT91SAM9G20EK boards.
  8. */
  9. #ifndef __CONFIG_H
  10. #define __CONFIG_H
  11. /*
  12. * SoC must be defined first, before hardware.h is included.
  13. * In this case SoC is defined in boards.cfg.
  14. */
  15. #include <asm/hardware.h>
  16. /*
  17. * Warning: changing CONFIG_SYS_TEXT_BASE requires
  18. * adapting the initial boot program.
  19. * Since the linker has to swallow that define, we must use a pure
  20. * hex number here!
  21. */
  22. /* ARM asynchronous clock */
  23. #define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */
  24. #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 /* main clock xtal */
  25. /* Define actual evaluation board type from used processor type */
  26. #ifdef CONFIG_AT91SAM9G20
  27. # define CONFIG_AT91SAM9G20EK /* It's an Atmel AT91SAM9G20 EK */
  28. #else
  29. # define CONFIG_AT91SAM9260EK /* It's an Atmel AT91SAM9260 EK */
  30. #endif
  31. /* Misc CPU related */
  32. #define CONFIG_ARCH_CPU_INIT
  33. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  34. #define CONFIG_SETUP_MEMORY_TAGS
  35. #define CONFIG_INITRD_TAG
  36. #define CONFIG_SKIP_LOWLEVEL_INIT
  37. /* general purpose I/O */
  38. #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */
  39. /*
  40. * BOOTP options
  41. */
  42. #define CONFIG_BOOTP_BOOTFILESIZE 1
  43. /*
  44. * SDRAM: 1 bank, min 32, max 128 MB
  45. * Initialized before u-boot gets started.
  46. */
  47. #define CONFIG_NR_DRAM_BANKS 1
  48. #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1
  49. #define CONFIG_SYS_SDRAM_SIZE 0x04000000
  50. /*
  51. * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
  52. * leaving the correct space for initial global data structure above
  53. * that address while providing maximum stack area below.
  54. */
  55. #ifdef CONFIG_AT91SAM9XE
  56. # define CONFIG_SYS_INIT_SP_ADDR \
  57. (ATMEL_BASE_SRAM + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
  58. #else
  59. # define CONFIG_SYS_INIT_SP_ADDR \
  60. (ATMEL_BASE_SRAM1 + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
  61. #endif
  62. /*
  63. * The (arm)linux board id set by generic code depending on configured board
  64. * (see boards.cfg for different boards)
  65. */
  66. #ifdef CONFIG_AT91SAM9G20
  67. /* the sam9g20 variants have two different board ids */
  68. # ifdef CONFIG_AT91SAM9G20EK_2MMC
  69. /* we may be setup for the 2MMC variant of at91sam9g20ek */
  70. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
  71. # else
  72. /* or the normal at91sam9g20ek */
  73. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
  74. # endif
  75. #else
  76. /* otherwise default to good old at91sam9260ek */
  77. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
  78. #endif
  79. /* NAND flash */
  80. #ifdef CONFIG_CMD_NAND
  81. #define CONFIG_NAND_ATMEL
  82. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  83. #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
  84. #define CONFIG_SYS_NAND_DBW_8
  85. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  86. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  87. #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14
  88. #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13
  89. #endif
  90. /* USB */
  91. #define CONFIG_USB_ATMEL
  92. #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
  93. #define CONFIG_USB_OHCI_NEW 1
  94. #define CONFIG_SYS_USB_OHCI_CPU_INIT 1
  95. #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */
  96. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
  97. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
  98. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  99. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  100. #define CONFIG_SYS_MEMTEST_END 0x23e00000
  101. #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
  102. /* bootstrap + u-boot + env + linux in dataflash on CS0 */
  103. #define CONFIG_ENV_OFFSET 0x4200
  104. #define CONFIG_ENV_SIZE 0x4200
  105. #define CONFIG_ENV_SECT_SIZE 0x210
  106. #define CONFIG_ENV_SPI_MAX_HZ 15000000
  107. #define CONFIG_BOOTCOMMAND "sf probe 0:0; " \
  108. "sf read 0x22000000 0x84000 0x294000; " \
  109. "bootm 0x22000000"
  110. #elif CONFIG_SYS_USE_DATAFLASH_CS1
  111. #define CONFIG_ENV_OFFSET 0x4200
  112. #define CONFIG_ENV_SIZE 0x4200
  113. #define CONFIG_ENV_SECT_SIZE 0x210
  114. #define CONFIG_ENV_SPI_MAX_HZ 15000000
  115. #define CONFIG_BOOTCOMMAND "sf probe 0:1; " \
  116. "sf read 0x22000000 0x84000 0x294000; " \
  117. "bootm 0x22000000"
  118. #elif defined(CONFIG_SYS_USE_NANDFLASH)
  119. /* bootstrap + u-boot + env + linux in nandflash */
  120. #define CONFIG_ENV_OFFSET 0x120000
  121. #define CONFIG_ENV_OFFSET_REDUND 0x100000
  122. #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
  123. #define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm"
  124. #else /* CONFIG_SYS_USE_MMC */
  125. /* bootstrap + u-boot + env + linux in mmc */
  126. /* For FAT system, most cases it should be in the reserved sector */
  127. #define CONFIG_ENV_OFFSET 0x2000
  128. #define CONFIG_ENV_SIZE 0x1000
  129. #define CONFIG_SYS_MMC_ENV_DEV 0
  130. #define CONFIG_BOOTCOMMAND \
  131. "fatload mmc 0:1 0x22000000 uImage; bootm"
  132. #endif
  133. /*
  134. * Size of malloc() pool
  135. */
  136. #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
  137. #endif