clearfog.h 4.2 KB

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