bcmstb.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. #ifndef __ASSEMBLY__
  14. #include <linux/stringify.h>
  15. #include <linux/types.h>
  16. struct bcmstb_boot_parameters {
  17. u32 r0;
  18. u32 r1;
  19. u32 r2;
  20. u32 r3;
  21. u32 sp;
  22. u32 lr;
  23. };
  24. extern struct bcmstb_boot_parameters bcmstb_boot_parameters;
  25. extern phys_addr_t prior_stage_fdt_address;
  26. #endif /* __ASSEMBLY__ */
  27. /*
  28. * CPU configuration.
  29. */
  30. #define CONFIG_SKIP_LOWLEVEL_INIT
  31. /*
  32. * Memory configuration.
  33. *
  34. * The prior stage BOLT bootloader sets up memory for us.
  35. *
  36. * An example boot memory layout after loading everything is:
  37. *
  38. * 0x0000 8000 vmlinux.bin.gz
  39. * : [~31 MiB uncompressed max]
  40. * 0x01ef f000 FIT containing signed public key
  41. * : [~2 KiB in size]
  42. * 0x01f0 0000 DTB copied from prior-stage-provided region
  43. * : [~1 MiB max]
  44. * 0x0200 0000 FIT containing ramdisk and device tree
  45. * : initramfs.cpio.gz
  46. * : [~208 MiB uncompressed max, to CMA/bmem low address]
  47. * : [~80 MiB compressed max, to PSB low address]
  48. * : device tree binary
  49. * : [~60 KiB]
  50. * 0x0700 0000 Prior stage bootloader (PSB)
  51. * :
  52. * 0x0761 7000 Prior-stage-provided device tree binary (DTB)
  53. * : [~40 KiB in size]
  54. * 0x0f00 0000 Contiguous memory allocator (CMA/bmem) low address
  55. * :
  56. * 0x8010 0000 U-Boot code at ELF load address
  57. * : [~500 KiB in size, stripped]
  58. * 0xc000 0000 Top of RAM
  59. *
  60. * Setting gd->relocaddr to CONFIG_SYS_TEXT_BASE in dram_init_banksize
  61. * prevents U-Boot from relocating itself when it is run as an ELF
  62. * program by the prior stage bootloader.
  63. *
  64. * We want to keep the ramdisk and FDT in the FIT image in-place, to
  65. * accommodate stblinux's bmem and CMA regions. To accomplish this,
  66. * we set initrd_high and fdt_high to 0xffffffff, and the load and
  67. * entry addresses of the FIT ramdisk entry to 0x0.
  68. *
  69. * Overwriting the prior stage bootloader causes memory instability,
  70. * so the compressed initramfs needs to fit between the load address
  71. * and the PSB low address. In BOLT's default configuration this
  72. * limits the compressed size of the initramfs to approximately 80
  73. * MiB. However, BOLT can be configured to allow loading larger
  74. * initramfs images, in which case this limitation is eliminated.
  75. */
  76. #define CONFIG_SYS_SDRAM_BASE 0x00000000
  77. #define CONFIG_SYS_INIT_RAM_SIZE 0x100000
  78. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  79. CONFIG_SYS_INIT_RAM_SIZE - \
  80. GENERATED_GBL_DATA_SIZE)
  81. #define CONFIG_SYS_LOAD_ADDR 0x2000000
  82. /*
  83. * CONFIG_SYS_LOAD_ADDR - 1 MiB.
  84. */
  85. #define CONFIG_SYS_FDT_SAVE_ADDRESS 0x1f00000
  86. #define CONFIG_SYS_CBSIZE 512
  87. #define CONFIG_SYS_MAXARGS 32
  88. /*
  89. * Large kernel image bootm configuration.
  90. */
  91. #define CONFIG_SYS_BOOTM_LEN SZ_64M
  92. /*
  93. * NS16550 configuration.
  94. */
  95. #define V_NS16550_CLK 81000000
  96. #define CONFIG_SYS_NS16550
  97. #define CONFIG_SYS_NS16550_SERIAL
  98. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  99. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  100. /*
  101. * Serial console configuration.
  102. */
  103. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, \
  104. 115200}
  105. /*
  106. * Informational display configuration.
  107. */
  108. #define CONFIG_REVISION_TAG
  109. /*
  110. * Command configuration.
  111. */
  112. /*
  113. * Flash configuration.
  114. */
  115. #define CONFIG_SPI_FLASH_STMICRO
  116. #define CONFIG_SPI_FLASH_MACRONIX
  117. /*
  118. * Filesystem configuration.
  119. */
  120. #define CONFIG_DOS_PARTITION
  121. /*
  122. * Environment configuration.
  123. */
  124. /*
  125. * Save the prior stage provided DTB.
  126. */
  127. /*
  128. * Enable in-place RFS with this initrd_high setting.
  129. */
  130. #define CONFIG_EXTRA_ENV_SETTINGS \
  131. "fdtsaveaddr=" __stringify(CONFIG_SYS_FDT_SAVE_ADDRESS) "\0" \
  132. "initrd_high=0xffffffff\0" \
  133. "fdt_high=0xffffffff\0"
  134. /*
  135. * Set fdtaddr to prior stage-provided DTB in board_late_init, when
  136. * writeable environment is available.
  137. */
  138. #endif /* __BCMSTB_H */