colibri-imx8x.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2019 Toradex
  4. */
  5. #ifndef __COLIBRI_IMX8X_H
  6. #define __COLIBRI_IMX8X_H
  7. #include <asm/arch/imx-regs.h>
  8. #include <linux/sizes.h>
  9. #include <linux/stringify.h>
  10. #define CONFIG_REMAKE_ELF
  11. #define CONFIG_DISPLAY_BOARDINFO_LATE
  12. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  13. #define USDHC1_BASE_ADDR 0x5b010000
  14. #define USDHC2_BASE_ADDR 0x5b020000
  15. #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
  16. #define CONFIG_ENV_OVERWRITE
  17. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  18. /* Networking */
  19. #define FEC_QUIRK_ENET_MAC
  20. #define CONFIG_TFTP_TSIZE
  21. #define CONFIG_IPADDR 192.168.10.2
  22. #define CONFIG_NETMASK 255.255.255.0
  23. #define CONFIG_SERVERIP 192.168.10.1
  24. #define MEM_LAYOUT_ENV_SETTINGS \
  25. "fdt_addr_r=0x83000000\0" \
  26. "kernel_addr_r=0x81000000\0" \
  27. "ramdisk_addr_r=0x83800000\0" \
  28. "scriptaddr=0x80800000\0"
  29. #ifdef CONFIG_AHAB_BOOT
  30. #define AHAB_ENV "sec_boot=yes\0"
  31. #else
  32. #define AHAB_ENV "sec_boot=no\0"
  33. #endif
  34. /* Boot M4 */
  35. #define M4_BOOT_ENV \
  36. "m4_0_image=m4_0.bin\0" \
  37. "loadm4image_0=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} " \
  38. "${m4_0_image}\0" \
  39. "m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0\0" \
  40. #define MFG_NAND_PARTITION ""
  41. #define BOOT_TARGET_DEVICES(func) \
  42. func(MMC, mmc, 1) \
  43. func(MMC, mmc, 0) \
  44. func(DHCP, dhcp, na)
  45. #include <config_distro_bootcmd.h>
  46. #undef BOOTENV_RUN_NET_USB_START
  47. #define BOOTENV_RUN_NET_USB_START ""
  48. #define CONFIG_MFG_ENV_SETTINGS \
  49. "mfgtool_args=setenv bootargs ${consoleargs} " \
  50. "rdinit=/linuxrc g_mass_storage.stall=0 " \
  51. "g_mass_storage.removable=1 g_mass_storage.idVendor=0x066F " \
  52. "g_mass_storage.idProduct=0x37FF " \
  53. "g_mass_storage.iSerialNumber=\"\" " MFG_NAND_PARTITION \
  54. "${vidargs} clk_ignore_unused\0" \
  55. "initrd_addr=0x83800000\0" \
  56. "initrd_high=0xffffffff\0" \
  57. "bootcmd_mfg=run mfgtool_args;booti ${loadaddr} ${initrd_addr} " \
  58. "${fdt_addr};\0" \
  59. /* Initial environment variables */
  60. #define CONFIG_EXTRA_ENV_SETTINGS \
  61. AHAB_ENV \
  62. BOOTENV \
  63. CONFIG_MFG_ENV_SETTINGS \
  64. M4_BOOT_ENV \
  65. MEM_LAYOUT_ENV_SETTINGS \
  66. "boot_file=Image\0" \
  67. "consoleargs=console=ttyLP3,${baudrate} earlycon\0" \
  68. "fdt_addr=0x83000000\0" \
  69. "fdt_file=fsl-imx8qxp-colibri-dsihdmi-eval-v3.dtb\0" \
  70. "fdtfile=fsl-imx8qxp-colibri-dsihdmi-eval-v3.dtb\0" \
  71. "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
  72. "image=Image\0" \
  73. "initrd_addr=0x83800000\0" \
  74. "initrd_high=0xffffffffffffffff\0" \
  75. "mmcargs=setenv bootargs ${consoleargs} " \
  76. "root=PARTUUID=${uuid} rootwait " \
  77. "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
  78. "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
  79. "netargs=setenv bootargs ${consoleargs} " \
  80. "root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp " \
  81. "${vidargs}\0" \
  82. "nfsboot=run netargs; dhcp ${loadaddr} ${image}; tftp ${fdt_addr} " \
  83. "colibri-imx8x/${fdt_file}; booti ${loadaddr} - " \
  84. "${fdt_addr}\0" \
  85. "panel=NULL\0" \
  86. "script=boot.scr\0" \
  87. "update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; " \
  88. "if test \"$confirm\" = \"y\"; then " \
  89. "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \
  90. "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \
  91. "${blkcnt}; fi\0" \
  92. "vidargs=video=imxdpufb5:off video=imxdpufb6:off video=imxdpufb7:off\0"
  93. /* Link Definitions */
  94. #define CONFIG_LOADADDR 0x80280000
  95. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  96. #define CONFIG_SYS_INIT_SP_ADDR 0x80200000
  97. /* Environment in eMMC, before config block at the end of 1st "boot sector" */
  98. #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 eMMC */
  99. #define CONFIG_SYS_MMC_ENV_PART 1
  100. #define CONFIG_SYS_MMC_IMG_LOAD_PART 1
  101. /* On Colibri iMX8X USDHC1 is eMMC, USDHC2 is 4-bit SD */
  102. #define CONFIG_SYS_FSL_USDHC_NUM 2
  103. #define CONFIG_SYS_BOOTM_LEN SZ_64M /* Increase max gunzip size */
  104. /* Size of malloc() pool */
  105. #define CONFIG_SYS_MALLOC_LEN ((CONFIG_ENV_SIZE + (32 * 1024)) * 1024)
  106. #define CONFIG_SYS_SDRAM_BASE 0x80000000
  107. #define PHYS_SDRAM_1 0x80000000
  108. #define PHYS_SDRAM_2 0x880000000
  109. #define PHYS_SDRAM_1_SIZE SZ_2G /* 2 GB */
  110. #define PHYS_SDRAM_2_SIZE 0x00000000 /* 0 GB */
  111. /* Monitor Command Prompt */
  112. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  113. #define CONFIG_SYS_CBSIZE SZ_2K
  114. #define CONFIG_SYS_MAXARGS 64
  115. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  116. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  117. sizeof(CONFIG_SYS_PROMPT) + 16)
  118. /* Generic Timer Definitions */
  119. #define COUNTER_FREQUENCY 8000000 /* 8MHz */
  120. #define BOOTAUX_RESERVED_MEM_BASE 0x88000000
  121. #define BOOTAUX_RESERVED_MEM_SIZE SZ_128M /* Reserve from second 128MB */
  122. #endif /* __COLIBRI_IMX8X_H */