rpi_b.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. * (C) Copyright 2012 Stephen Warren
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #ifndef __CONFIG_H
  17. #define __CONFIG_H
  18. #include <asm/sizes.h>
  19. /* Architecture, CPU, etc.*/
  20. #define CONFIG_ARM1176
  21. #define CONFIG_BCM2835
  22. #define CONFIG_ARCH_CPU_INIT
  23. #define CONFIG_SYS_DCACHE_OFF
  24. /*
  25. * 2835 is a SKU in a series for which the 2708 is the first or primary SoC,
  26. * so 2708 has historically been used rather than a dedicated 2835 ID.
  27. */
  28. #define CONFIG_MACH_TYPE MACH_TYPE_BCM2708
  29. /* Timer */
  30. #define CONFIG_SYS_HZ 1000
  31. /* Memory layout */
  32. #define CONFIG_NR_DRAM_BANKS 1
  33. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  34. #define CONFIG_SYS_TEXT_BASE 0x00008000
  35. #define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE
  36. /*
  37. * The board really has 256M. However, the VC (VideoCore co-processor) shares
  38. * the RAM, and uses a configurable portion at the top. We tell U-Boot that a
  39. * smaller amount of RAM is present in order to avoid stomping on the area
  40. * the VC uses.
  41. */
  42. #define CONFIG_SYS_SDRAM_SIZE SZ_128M
  43. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + \
  44. CONFIG_SYS_SDRAM_SIZE - \
  45. GENERATED_GBL_DATA_SIZE)
  46. #define CONFIG_SYS_MALLOC_LEN SZ_4M
  47. #define CONFIG_SYS_MEMTEST_START 0x00100000
  48. #define CONFIG_SYS_MEMTEST_END 0x00200000
  49. #define CONFIG_LOADADDR 0x00200000
  50. /* Flash */
  51. #define CONFIG_SYS_NO_FLASH
  52. /* Devices */
  53. /* GPIO */
  54. #define CONFIG_BCM2835_GPIO
  55. /* LCD */
  56. #define CONFIG_LCD
  57. #define CONFIG_LCD_DT_SIMPLEFB
  58. #define LCD_BPP LCD_COLOR16
  59. /*
  60. * Prevent allocation of RAM for FB; the real FB address is queried
  61. * dynamically from the VideoCore co-processor, and comes from RAM
  62. * not owned by the ARM CPU.
  63. */
  64. #define CONFIG_FB_ADDR 0
  65. #define CONFIG_VIDEO_BCM2835
  66. #define CONFIG_SYS_WHITE_ON_BLACK
  67. /* SD/MMC configuration */
  68. #define CONFIG_GENERIC_MMC
  69. #define CONFIG_MMC
  70. #define CONFIG_SDHCI
  71. #define CONFIG_MMC_SDHCI_IO_ACCESSORS
  72. #define CONFIG_BCM2835_SDHCI
  73. /* Console UART */
  74. #define CONFIG_PL011_SERIAL
  75. #define CONFIG_PL011_CLOCK 3000000
  76. #define CONFIG_PL01x_PORTS { (void *)0x20201000 }
  77. #define CONFIG_CONS_INDEX 0
  78. #define CONFIG_BAUDRATE 115200
  79. /* Console configuration */
  80. #define CONFIG_SYS_CBSIZE 1024
  81. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  82. sizeof(CONFIG_SYS_PROMPT) + 16)
  83. /* Environment */
  84. #define CONFIG_ENV_SIZE SZ_16K
  85. #define CONFIG_ENV_IS_NOWHERE
  86. #define CONFIG_ENV_VARS_UBOOT_CONFIG
  87. #define CONFIG_SYS_LOAD_ADDR 0x1000000
  88. #define CONFIG_CONSOLE_MUX
  89. #define CONFIG_SYS_CONSOLE_IS_IN_ENV
  90. /*
  91. * Memory layout for where various images get loaded by boot scripts:
  92. *
  93. * scriptaddr can be pretty much anywhere that doesn't conflict with something
  94. * else. Put it low in memory to avoid conflicts.
  95. *
  96. * kernel_addr_r must be within the first 128M of RAM in order for the
  97. * kernel's CONFIG_AUTO_ZRELADDR option to work. Since the kernel will
  98. * decompress itself to 0x8000 after the start of RAM, kernel_addr_r
  99. * should not overlap that area, or the kernel will have to copy itself
  100. * somewhere else before decompression. Similarly, the address of any other
  101. * data passed to the kernel shouldn't overlap the start of RAM. Pushing
  102. * this up to 16M allows for a sizable kernel to be decompressed below the
  103. * compressed load address.
  104. *
  105. * fdt_addr_r simply shouldn't overlap anything else. Choosing 32M allows for
  106. * the compressed kernel to be up to 16M too.
  107. *
  108. * ramdisk_addr_r simply shouldn't overlap anything else. Choosing 33M allows
  109. * for the FDT/DTB to be up to 1M, which is hopefully plenty.
  110. */
  111. #define CONFIG_EXTRA_ENV_SETTINGS \
  112. "stdin=serial\0" \
  113. "stderr=serial,lcd\0" \
  114. "stdout=serial,lcd\0" \
  115. "scriptaddr=0x00000000\0" \
  116. "kernel_addr_r=0x01000000\0" \
  117. "fdt_addr_r=0x02000000\0" \
  118. "ramdisk_addr_r=0x02100000\0" \
  119. "boot_targets=mmc0\0" \
  120. \
  121. "script_boot=" \
  122. "if fatload ${devtype} ${devnum}:1 " \
  123. "${scriptaddr} boot.scr.uimg; then " \
  124. "source ${scriptaddr}; " \
  125. "fi;\0" \
  126. \
  127. "mmc_boot=" \
  128. "setenv devtype mmc; " \
  129. "if mmc dev ${devnum}; then " \
  130. "run script_boot; " \
  131. "fi\0" \
  132. \
  133. "bootcmd_mmc0=setenv devnum 0; run mmc_boot\0" \
  134. #define CONFIG_BOOTCOMMAND \
  135. "for target in ${boot_targets}; do run bootcmd_${target}; done"
  136. #define CONFIG_BOOTDELAY 2
  137. /* Shell */
  138. #define CONFIG_SYS_HUSH_PARSER
  139. #define CONFIG_SYS_MAXARGS 8
  140. #define CONFIG_SYS_PROMPT "U-Boot> "
  141. #define CONFIG_SYS_LONGHELP
  142. #define CONFIG_CMDLINE_EDITING
  143. #define CONFIG_COMMAND_HISTORY
  144. #define CONFIG_AUTO_COMPLETE
  145. /* Commands */
  146. #include <config_cmd_default.h>
  147. #define CONFIG_CMD_BOOTZ
  148. #define CONFIG_CMD_GPIO
  149. #define CONFIG_CMD_MMC
  150. #define CONFIG_DOS_PARTITION
  151. #define CONFIG_PARTITION_UUIDS
  152. #define CONFIG_CMD_PART
  153. #define CONFIG_CMD_FS_GENERIC
  154. #define CONFIG_CMD_FAT
  155. #define CONFIG_CMD_EXT
  156. /* Some things don't make sense on this HW or yet */
  157. #undef CONFIG_CMD_FPGA
  158. #undef CONFIG_CMD_NET
  159. #undef CONFIG_CMD_NFS
  160. #undef CONFIG_CMD_SAVEENV
  161. /* Device tree support for bootm/bootz */
  162. #define CONFIG_OF_LIBFDT
  163. #define CONFIG_OF_BOARD_SETUP
  164. /* ATAGs support for bootm/bootz */
  165. #define CONFIG_SETUP_MEMORY_TAGS
  166. #define CONFIG_CMDLINE_TAG
  167. #define CONFIG_INITRD_TAG
  168. #endif