stm32mp1.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */
  2. /*
  3. * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
  4. *
  5. * Configuration settings for the STM32MP15x CPU
  6. */
  7. #ifndef __CONFIG_H
  8. #define __CONFIG_H
  9. #include <linux/sizes.h>
  10. #include <asm/arch/stm32.h>
  11. #ifndef CONFIG_TFABOOT
  12. /* PSCI support */
  13. #define CONFIG_ARMV7_PSCI_1_0
  14. #define CONFIG_ARMV7_SECURE_BASE STM32_SYSRAM_BASE
  15. #define CONFIG_ARMV7_SECURE_MAX_SIZE STM32_SYSRAM_SIZE
  16. #endif
  17. /*
  18. * Configuration of the external SRAM memory used by U-Boot
  19. */
  20. #define CONFIG_SYS_SDRAM_BASE STM32_DDR_BASE
  21. #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
  22. /*
  23. * Console I/O buffer size
  24. */
  25. #define CONFIG_SYS_CBSIZE SZ_1K
  26. /*
  27. * default load address used for command tftp, bootm , loadb, ...
  28. */
  29. #define CONFIG_LOADADDR 0xc2000000
  30. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  31. /* ATAGs */
  32. #define CONFIG_CMDLINE_TAG
  33. #define CONFIG_SETUP_MEMORY_TAGS
  34. #define CONFIG_INITRD_TAG
  35. /*
  36. * For booting Linux, use the first 256 MB of memory, since this is
  37. * the maximum mapped by the Linux kernel during initialization.
  38. */
  39. #define CONFIG_SYS_BOOTMAPSZ SZ_256M
  40. /* Extend size of kernel image for uncompression */
  41. #define CONFIG_SYS_BOOTM_LEN SZ_32M
  42. /* SPL support */
  43. #ifdef CONFIG_SPL
  44. /* SPL use DDR */
  45. #define CONFIG_SPL_BSS_START_ADDR 0xC0200000
  46. #define CONFIG_SPL_BSS_MAX_SIZE 0x00100000
  47. #define CONFIG_SYS_SPL_MALLOC_START 0xC0300000
  48. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000
  49. /* limit SYSRAM usage to first 128 KB */
  50. #define CONFIG_SPL_MAX_SIZE 0x00020000
  51. #define CONFIG_SPL_STACK (STM32_SYSRAM_BASE + \
  52. STM32_SYSRAM_SIZE)
  53. #endif /* #ifdef CONFIG_SPL */
  54. /*MMC SD*/
  55. #define CONFIG_SYS_MMC_MAX_DEVICE 3
  56. /* NAND support */
  57. #define CONFIG_SYS_NAND_ONFI_DETECTION
  58. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  59. /* Ethernet need */
  60. #ifdef CONFIG_DWC_ETH_QOS
  61. #define CONFIG_SYS_NONCACHED_MEMORY (1 * SZ_1M) /* 1M */
  62. #define CONFIG_SERVERIP 192.168.1.1
  63. #define CONFIG_BOOTP_SERVERIP
  64. #define CONFIG_SYS_AUTOLOAD "no"
  65. #endif
  66. #ifdef CONFIG_DM_VIDEO
  67. #define CONFIG_VIDEO_BMP_RLE8
  68. #define CONFIG_BMP_16BPP
  69. #define CONFIG_BMP_24BPP
  70. #define CONFIG_BMP_32BPP
  71. #endif
  72. /*****************************************************************************/
  73. #ifdef CONFIG_DISTRO_DEFAULTS
  74. /*****************************************************************************/
  75. #if !defined(CONFIG_SPL_BUILD)
  76. #ifdef CONFIG_CMD_MMC
  77. #define BOOT_TARGET_MMC0(func) func(MMC, mmc, 0)
  78. #define BOOT_TARGET_MMC1(func) func(MMC, mmc, 1)
  79. #define BOOT_TARGET_MMC2(func) func(MMC, mmc, 2)
  80. #else
  81. #define BOOT_TARGET_MMC0(func)
  82. #define BOOT_TARGET_MMC1(func)
  83. #define BOOT_TARGET_MMC2(func)
  84. #endif
  85. #ifdef CONFIG_NET
  86. #define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
  87. #else
  88. #define BOOT_TARGET_PXE(func)
  89. #endif
  90. #ifdef CONFIG_CMD_UBIFS
  91. #define BOOT_TARGET_UBIFS(func) func(UBIFS, ubifs, 0)
  92. #else
  93. #define BOOT_TARGET_UBIFS(func)
  94. #endif
  95. #define BOOT_TARGET_DEVICES(func) \
  96. BOOT_TARGET_MMC1(func) \
  97. BOOT_TARGET_UBIFS(func) \
  98. BOOT_TARGET_MMC0(func) \
  99. BOOT_TARGET_MMC2(func) \
  100. BOOT_TARGET_PXE(func)
  101. /*
  102. * bootcmd for stm32mp1:
  103. * for serial/usb: execute the stm32prog command
  104. * for mmc boot (eMMC, SD card), boot only on the same device
  105. * for nand or spi-nand boot, boot with on ubifs partition on UBI partition
  106. * for nor boot, use SD card = mmc0
  107. */
  108. #define STM32MP_BOOTCMD "bootcmd_stm32mp=" \
  109. "echo \"Boot over ${boot_device}${boot_instance}!\";" \
  110. "if test ${boot_device} = serial || test ${boot_device} = usb;" \
  111. "then stm32prog ${boot_device} ${boot_instance}; " \
  112. "else " \
  113. "run env_check;" \
  114. "if test ${boot_device} = mmc;" \
  115. "then env set boot_targets \"mmc${boot_instance}\"; fi;" \
  116. "if test ${boot_device} = nand ||" \
  117. " test ${boot_device} = spi-nand ;" \
  118. "then env set boot_targets ubifs0; fi;" \
  119. "if test ${boot_device} = nor;" \
  120. "then env set boot_targets mmc0; fi;" \
  121. "run distro_bootcmd;" \
  122. "fi;\0"
  123. #include <config_distro_bootcmd.h>
  124. /*
  125. * memory layout for 32M uncompressed/compressed kernel,
  126. * 1M fdt, 1M script, 1M pxe and 1M for splashimage
  127. * and the ramdisk at the end.
  128. */
  129. #define CONFIG_EXTRA_ENV_SETTINGS \
  130. "bootdelay=1\0" \
  131. "kernel_addr_r=0xc2000000\0" \
  132. "fdt_addr_r=0xc4000000\0" \
  133. "scriptaddr=0xc4100000\0" \
  134. "pxefile_addr_r=0xc4200000\0" \
  135. "splashimage=0xc4300000\0" \
  136. "ramdisk_addr_r=0xc4400000\0" \
  137. "altbootcmd=run bootcmd\0" \
  138. "env_check=if env info -p -d; then env save; fi\0" \
  139. STM32MP_BOOTCMD \
  140. BOOTENV \
  141. "boot_net_usb_start=true\0"
  142. #endif /* ifndef CONFIG_SPL_BUILD */
  143. #endif /* ifdef CONFIG_DISTRO_DEFAULTS*/
  144. #endif /* __CONFIG_H */