at91sam9260ek.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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_CMDLINE_TAG /* enable passing of ATAGs */
  33. #define CONFIG_SETUP_MEMORY_TAGS
  34. #define CONFIG_INITRD_TAG
  35. #define CONFIG_SKIP_LOWLEVEL_INIT
  36. /* general purpose I/O */
  37. #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */
  38. /*
  39. * BOOTP options
  40. */
  41. #define CONFIG_BOOTP_BOOTFILESIZE 1
  42. /*
  43. * SDRAM: 1 bank, min 32, max 128 MB
  44. * Initialized before u-boot gets started.
  45. */
  46. #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1
  47. #define CONFIG_SYS_SDRAM_SIZE 0x04000000
  48. /*
  49. * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
  50. * leaving the correct space for initial global data structure above
  51. * that address while providing maximum stack area below.
  52. */
  53. #ifdef CONFIG_AT91SAM9XE
  54. # define CONFIG_SYS_INIT_SP_ADDR \
  55. (ATMEL_BASE_SRAM + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
  56. #else
  57. # define CONFIG_SYS_INIT_SP_ADDR \
  58. (ATMEL_BASE_SRAM1 + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
  59. #endif
  60. /*
  61. * The (arm)linux board id set by generic code depending on configured board
  62. * (see boards.cfg for different boards)
  63. */
  64. #ifdef CONFIG_AT91SAM9G20
  65. /* the sam9g20 variants have two different board ids */
  66. # ifdef CONFIG_AT91SAM9G20EK_2MMC
  67. /* we may be setup for the 2MMC variant of at91sam9g20ek */
  68. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
  69. # else
  70. /* or the normal at91sam9g20ek */
  71. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
  72. # endif
  73. #else
  74. /* otherwise default to good old at91sam9260ek */
  75. # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
  76. #endif
  77. /* NAND flash */
  78. #ifdef CONFIG_CMD_NAND
  79. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  80. #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3
  81. #define CONFIG_SYS_NAND_DBW_8
  82. #define CONFIG_SYS_NAND_MASK_ALE (1 << 21)
  83. #define CONFIG_SYS_NAND_MASK_CLE (1 << 22)
  84. #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14
  85. #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13
  86. #endif
  87. /* USB */
  88. #define CONFIG_USB_ATMEL
  89. #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
  90. #define CONFIG_USB_OHCI_NEW 1
  91. #define CONFIG_SYS_USB_OHCI_CPU_INIT 1
  92. #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */
  93. #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260"
  94. #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2
  95. #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
  96. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  97. #define CONFIG_SYS_MEMTEST_END 0x23e00000
  98. #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
  99. /* bootstrap + u-boot + env + linux in dataflash on CS0 */
  100. #define CONFIG_BOOTCOMMAND "sf probe 0:0; " \
  101. "sf read 0x22000000 0x84000 0x294000; " \
  102. "bootm 0x22000000"
  103. #elif CONFIG_SYS_USE_DATAFLASH_CS1
  104. #define CONFIG_BOOTCOMMAND "sf probe 0:1; " \
  105. "sf read 0x22000000 0x84000 0x294000; " \
  106. "bootm 0x22000000"
  107. #elif defined(CONFIG_SYS_USE_NANDFLASH)
  108. /* bootstrap + u-boot + env + linux in nandflash */
  109. #define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm"
  110. #else /* CONFIG_SYS_USE_MMC */
  111. /* bootstrap + u-boot + env + linux in mmc */
  112. /* For FAT system, most cases it should be in the reserved sector */
  113. #define CONFIG_SYS_MMC_ENV_DEV 0
  114. #define CONFIG_BOOTCOMMAND \
  115. "fatload mmc 0:1 0x22000000 uImage; bootm"
  116. #endif
  117. /*
  118. * Size of malloc() pool
  119. */
  120. #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
  121. #endif