bcmstb.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2018 Cisco Systems, Inc.
  4. *
  5. * Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
  6. *
  7. * Configuration settings for the Broadcom BCMSTB SoC family.
  8. */
  9. #ifndef __BCMSTB_H
  10. #define __BCMSTB_H
  11. #include "version.h"
  12. #include <linux/sizes.h>
  13. #include <asm/arch/prior_stage.h>
  14. /*
  15. * Generic board configuration.
  16. */
  17. #define CONFIG_SYS_GENERIC_BOARD
  18. /*
  19. * CPU configuration.
  20. */
  21. #define CONFIG_SKIP_LOWLEVEL_INIT
  22. /*
  23. * Memory configuration.
  24. *
  25. * The prior stage BOLT bootloader sets up memory for us.
  26. *
  27. * An example boot memory layout after loading everything is:
  28. *
  29. * 0x0000 8000 vmlinux.bin.gz
  30. * : [~31 MiB uncompressed max]
  31. * 0x01ef f000 FIT containing signed public key
  32. * : [~2 KiB in size]
  33. * 0x01f0 0000 DTB copied from prior-stage-provided region
  34. * : [~1 MiB max]
  35. * 0x0200 0000 FIT containing ramdisk and device tree
  36. * : initramfs.cpio.gz
  37. * : [~208 MiB uncompressed max, to CMA/bmem low address]
  38. * : [~80 MiB compressed max, to PSB low address]
  39. * : device tree binary
  40. * : [~60 KiB]
  41. * 0x0700 0000 Prior stage bootloader (PSB)
  42. * :
  43. * 0x0761 7000 Prior-stage-provided device tree binary (DTB)
  44. * : [~40 KiB in size]
  45. * 0x0f00 0000 Contiguous memory allocator (CMA/bmem) low address
  46. * :
  47. * 0x8010 0000 U-Boot code at ELF load address
  48. * : [~500 KiB in size, stripped]
  49. * 0xc000 0000 Top of RAM
  50. *
  51. * Setting gd->relocaddr to CONFIG_SYS_TEXT_BASE in dram_init_banksize
  52. * prevents U-Boot from relocating itself when it is run as an ELF
  53. * program by the prior stage bootloader.
  54. *
  55. * We want to keep the ramdisk and FDT in the FIT image in-place, to
  56. * accommodate stblinux's bmem and CMA regions. To accomplish this,
  57. * we set initrd_high and fdt_high to 0xffffffff, and the load and
  58. * entry addresses of the FIT ramdisk entry to 0x0.
  59. *
  60. * Overwriting the prior stage bootloader causes memory instability,
  61. * so the compressed initramfs needs to fit between the load address
  62. * and the PSB low address. In BOLT's default configuration this
  63. * limits the compressed size of the initramfs to approximately 80
  64. * MiB. However, BOLT can be configured to allow loading larger
  65. * initramfs images, in which case this limitation is eliminated.
  66. */
  67. #define CONFIG_NR_DRAM_BANKS 3
  68. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  69. #define CONFIG_SYS_TEXT_BASE 0x80100000
  70. #define CONFIG_SYS_INIT_RAM_ADDR 0x80200000
  71. #define CONFIG_SYS_INIT_RAM_SIZE 0x100000
  72. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  73. CONFIG_SYS_INIT_RAM_SIZE - \
  74. GENERATED_GBL_DATA_SIZE)
  75. #define CONFIG_SYS_MALLOC_LEN ((10 * 1024) << 10) /* 10 MiB */
  76. #define CONFIG_SYS_LOAD_ADDR 0x2000000
  77. /*
  78. * CONFIG_SYS_LOAD_ADDR - 1 MiB.
  79. */
  80. #define CONFIG_SYS_FDT_SAVE_ADDRESS 0x1f00000
  81. #define CONFIG_SYS_CBSIZE 512
  82. #define CONFIG_SYS_MAXARGS 32
  83. /*
  84. * Large kernel image bootm configuration.
  85. */
  86. #define CONFIG_SYS_BOOTM_LEN SZ_64M
  87. /*
  88. * NS16550 configuration.
  89. */
  90. #define V_NS16550_CLK 81000000
  91. #define CONFIG_SYS_NS16550
  92. #define CONFIG_SYS_NS16550_SERIAL
  93. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  94. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  95. /*
  96. * Serial console configuration.
  97. */
  98. #define CONFIG_SERIAL3 3
  99. #define CONFIG_BAUDRATE 115200
  100. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \
  101. 115200}
  102. /*
  103. * Informational display configuration.
  104. */
  105. #define CONFIG_REVISION_TAG
  106. /*
  107. * Command configuration.
  108. */
  109. #define CONFIG_CMD_ASKENV
  110. #define CONFIG_CMD_CACHE
  111. #define CONFIG_CMD_EXT2
  112. #define CONFIG_CMD_SF
  113. #define CONFIG_CMD_SPI
  114. #define CONFIG_CMD_SF_TEST
  115. #define CONFIG_CMD_MMC
  116. /*
  117. * Flash configuration.
  118. */
  119. #define CONFIG_ST_SMI
  120. #define CONFIG_SPI_FLASH_STMICRO
  121. #define CONFIG_SPI_FLASH_MACRONIX
  122. /*
  123. * Filesystem configuration.
  124. */
  125. #define CONFIG_DOS_PARTITION
  126. #define CONFIG_CMD_EXT4
  127. #define CONFIG_FS_EXT4
  128. #define CONFIG_CMD_FS_GENERIC
  129. /*
  130. * Environment configuration.
  131. */
  132. #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  133. #define CONFIG_ENV_IS_IN_SPI_FLASH 1
  134. #define CONFIG_ENV_OFFSET 0x1e0000
  135. #define CONFIG_ENV_SIZE (64 << 10) /* 64 KiB */
  136. #define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
  137. #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
  138. #define CONFIG_ENV_OVERWRITE
  139. /*
  140. * Save the prior stage provided DTB.
  141. */
  142. #define CONFIG_PREBOOT \
  143. "fdt addr ${fdtcontroladdr};" \
  144. "fdt move ${fdtcontroladdr} ${fdtsaveaddr};" \
  145. "fdt addr ${fdtsaveaddr};"
  146. /*
  147. * Enable in-place RFS with this initrd_high setting.
  148. */
  149. #define CONFIG_EXTRA_ENV_SETTINGS \
  150. "fdtsaveaddr=" __stringify(CONFIG_SYS_FDT_SAVE_ADDRESS) "\0" \
  151. "initrd_high=0xffffffff\0" \
  152. "fdt_high=0xffffffff\0"
  153. /*
  154. * Set fdtaddr to prior stage-provided DTB in board_late_init, when
  155. * writeable environment is available.
  156. */
  157. #define CONFIG_BOARD_LATE_INIT
  158. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  159. #define CONFIG_DM_SPI 1
  160. #endif /* __BCMSTB_H */