helios4.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2018 Dennis Gilmore <dgilmore@redhat.com>
  4. */
  5. #ifndef _CONFIG_HELIOS4_H
  6. #define _CONFIG_HELIOS4_H
  7. #include <linux/stringify.h>
  8. /*
  9. * High Level Configuration Options (easy to change)
  10. */
  11. /*
  12. * TEXT_BASE needs to be below 16MiB, since this area is scrubbed
  13. * for DDR ECC byte filling in the SPL before loading the main
  14. * U-Boot into it.
  15. */
  16. /* USB/EHCI configuration */
  17. #define CONFIG_EHCI_IS_TDI
  18. #define CONFIG_ENV_MIN_ENTRIES 128
  19. /* Environment in MMC */
  20. /*
  21. * For SD - reserve 1 LBA for MBR + 1M for u-boot image. The MMC/eMMC
  22. * boot image starts @ LBA-0.
  23. * As result in MMC/eMMC case it will be a 1 sector gap between u-boot
  24. * image and environment
  25. */
  26. #define PHY_ANEG_TIMEOUT 8000 /* PHY needs a longer aneg time */
  27. /* PCIe support */
  28. #ifndef CONFIG_SPL_BUILD
  29. #define CONFIG_PCI_SCAN_SHOW
  30. #endif
  31. /* SATA support */
  32. #ifdef CONFIG_SCSI
  33. #define CONFIG_SCSI_AHCI_PLAT
  34. #define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
  35. #define CONFIG_SYS_SCSI_MAX_LUN 1
  36. #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
  37. CONFIG_SYS_SCSI_MAX_LUN)
  38. #endif
  39. /* Keep device tree and initrd in lower memory so the kernel can access them */
  40. #define RELOCATION_LIMITS_ENV_SETTINGS \
  41. "fdt_high=0x10000000\0" \
  42. "initrd_high=0x10000000\0"
  43. /* SPL */
  44. /* Defines for SPL */
  45. #define CONFIG_SPL_SIZE (140 << 10)
  46. #define CONFIG_SPL_MAX_SIZE (CONFIG_SPL_SIZE - 0x0030)
  47. #define CONFIG_SPL_BSS_START_ADDR (0x40000000 + CONFIG_SPL_SIZE)
  48. #define CONFIG_SPL_BSS_MAX_SIZE (16 << 10)
  49. #ifdef CONFIG_SPL_BUILD
  50. #define CONFIG_SYS_MALLOC_SIMPLE
  51. #endif
  52. #define CONFIG_SPL_STACK (0x40000000 + ((192 - 16) << 10))
  53. #define CONFIG_SPL_BOOTROM_SAVE (CONFIG_SPL_STACK + 4)
  54. #if defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
  55. /* SPL related MMC defines */
  56. #ifdef CONFIG_SPL_BUILD
  57. #define CONFIG_FIXED_SDHCI_ALIGNED_BUFFER 0x00180000 /* in SDRAM */
  58. #endif
  59. #endif
  60. /*
  61. * mv-common.h should be defined after CMD configs since it used them
  62. * to enable certain macros
  63. */
  64. #include "mv-common.h"
  65. /* Include the common distro boot environment */
  66. #ifndef CONFIG_SPL_BUILD
  67. #ifdef CONFIG_MMC
  68. #define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
  69. #else
  70. #define BOOT_TARGET_DEVICES_MMC(func)
  71. #endif
  72. #ifdef CONFIG_USB_STORAGE
  73. #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
  74. #else
  75. #define BOOT_TARGET_DEVICES_USB(func)
  76. #endif
  77. #ifndef CONFIG_SCSI
  78. #define BOOT_TARGET_DEVICES_SCSI_BUS0(func)
  79. #define BOOT_TARGET_DEVICES_SCSI_BUS1(func)
  80. #define BOOT_TARGET_DEVICES_SCSI_BUS2(func)
  81. #else
  82. /*
  83. * With SCSI enabled, M.2 SATA is always located on bus 0
  84. */
  85. #define BOOT_TARGET_DEVICES_SCSI_BUS0(func) func(SCSI, scsi, 0)
  86. /*
  87. * Either one or both mPCIe slots may be configured as mSATA interfaces. The
  88. * SCSI bus ids are assigned based on sequence of hardware present, not always
  89. * tied to hardware slot ids. As such, use second SCSI bus if either slot is
  90. * set for SATA, and only use third SCSI bus if both slots are SATA enabled.
  91. */
  92. #if defined (CONFIG_HELIOS4_CON2_SATA) || defined (CONFIG_HELIOS4_CON3_SATA)
  93. #define BOOT_TARGET_DEVICES_SCSI_BUS1(func) func(SCSI, scsi, 1)
  94. #else
  95. #define BOOT_TARGET_DEVICES_SCSI_BUS1(func)
  96. #endif
  97. #if defined (CONFIG_HELIOS4_CON2_SATA) && defined (CONFIG_HELIOS4_CON3_SATA)
  98. #define BOOT_TARGET_DEVICES_SCSI_BUS2(func) func(SCSI, scsi, 2)
  99. #else
  100. #define BOOT_TARGET_DEVICES_SCSI_BUS2(func)
  101. #endif
  102. #endif /* CONFIG_SCSI */
  103. /*
  104. * The SCSI buses are attempted in increasing bus order, there is no current
  105. * mechanism to alter the default bus priority order for booting.
  106. */
  107. #define BOOT_TARGET_DEVICES(func) \
  108. BOOT_TARGET_DEVICES_MMC(func) \
  109. BOOT_TARGET_DEVICES_USB(func) \
  110. BOOT_TARGET_DEVICES_SCSI_BUS0(func) \
  111. BOOT_TARGET_DEVICES_SCSI_BUS1(func) \
  112. BOOT_TARGET_DEVICES_SCSI_BUS2(func) \
  113. func(PXE, pxe, na) \
  114. func(DHCP, dhcp, na)
  115. #define KERNEL_ADDR_R __stringify(0x800000)
  116. #define FDT_ADDR_R __stringify(0x100000)
  117. #define RAMDISK_ADDR_R __stringify(0x1800000)
  118. #define SCRIPT_ADDR_R __stringify(0x200000)
  119. #define PXEFILE_ADDR_R __stringify(0x300000)
  120. #define LOAD_ADDRESS_ENV_SETTINGS \
  121. "kernel_addr_r=" KERNEL_ADDR_R "\0" \
  122. "fdt_addr_r=" FDT_ADDR_R "\0" \
  123. "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
  124. "scriptaddr=" SCRIPT_ADDR_R "\0" \
  125. "pxefile_addr_r=" PXEFILE_ADDR_R "\0"
  126. #include <config_distro_bootcmd.h>
  127. #define CONFIG_EXTRA_ENV_SETTINGS \
  128. RELOCATION_LIMITS_ENV_SETTINGS \
  129. LOAD_ADDRESS_ENV_SETTINGS \
  130. "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
  131. "console=ttyS0,115200\0" \
  132. BOOTENV
  133. #endif /* CONFIG_SPL_BUILD */
  134. #endif /* _CONFIG_HELIOS4_H */