cl-som-imx7.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2015 CompuLab, Ltd.
  4. *
  5. * Configuration settings for the CompuLab CL-SOM-iMX7 System-on-Module.
  6. */
  7. #ifndef __CL_SOM_IMX7_CONFIG_H
  8. #define __CL_SOM_IMX7_CONFIG_H
  9. #include "mx7_common.h"
  10. #define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
  11. /* Size of malloc() pool */
  12. #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
  13. /* Network */
  14. #define CONFIG_FEC_MXC
  15. #define CONFIG_FEC_XCV_TYPE RGMII
  16. #define CONFIG_ETHPRIME "FEC"
  17. #define CONFIG_FEC_MXC_PHYADDR 0
  18. /* ENET1 */
  19. #define IMX_FEC_BASE ENET_IPS_BASE_ADDR
  20. /* PMIC */
  21. #define CONFIG_POWER
  22. #define CONFIG_POWER_I2C
  23. #define CONFIG_POWER_PFUZE3000
  24. #define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08
  25. /* I2C configs */
  26. #define CONFIG_SYS_I2C
  27. #define CONFIG_SYS_I2C_MXC
  28. #define CONFIG_SYS_I2C_MXC_I2C2 /* Enable I2C bus 2 */
  29. #define CONFIG_SYS_I2C_SPEED 100000
  30. #define SYS_I2C_BUS_SOM 0
  31. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
  32. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  33. #define CONFIG_SYS_I2C_EEPROM_BUS SYS_I2C_BUS_SOM
  34. #define CONFIG_PCA953X
  35. #define CONFIG_SYS_I2C_PCA953X_ADDR 0x20
  36. #define CONFIG_SYS_I2C_PCA953X_WIDTH { {0x20, 16} }
  37. #undef CONFIG_SYS_AUTOLOAD
  38. #undef CONFIG_EXTRA_ENV_SETTINGS
  39. #undef CONFIG_BOOTCOMMAND
  40. #define CONFIG_SYS_AUTOLOAD "no"
  41. #define CONFIG_EXTRA_ENV_SETTINGS \
  42. "autoload=off\0" \
  43. "script=boot.scr\0" \
  44. "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0" \
  45. "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0" \
  46. "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${fdtfile};\0" \
  47. "bootscript=echo Running bootscript from ${storagetype} ...; source ${loadaddr};\0" \
  48. "storagebootcmd=echo Booting from ${storagetype} ...; run ${storagetype}args; run doboot;\0" \
  49. "kernel=zImage\0" \
  50. "console=ttymxc0\0" \
  51. "fdt_high=0xffffffff\0" \
  52. "initrd_high=0xffffffff\0" \
  53. "fdtfile=imx7d-sbc-imx7.dtb\0" \
  54. "fdtaddr=0x83000000\0" \
  55. "mmcdev_def="__stringify(CONFIG_SYS_MMC_DEV)"\0" \
  56. "usbdev_def="__stringify(CONFIG_SYS_USB_DEV)"\0" \
  57. "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
  58. "usbpart=" __stringify(CONFIG_SYS_USB_IMG_LOAD_PART) "\0" \
  59. "doboot=bootz ${loadaddr} - ${fdtaddr}\0" \
  60. "mmc_config=mmc dev ${mmcdev}; mmc rescan\0" \
  61. "mmcargs=setenv bootargs console=${console},${baudrate} " \
  62. "root=/dev/mmcblk${mmcblk}p2 rootwait rw\0" \
  63. "mmcbootscript=" \
  64. "if run mmc_config; then " \
  65. "setenv storagetype mmc;" \
  66. "setenv storagedev ${mmcdev}:${mmcpart};" \
  67. "if run loadscript; then " \
  68. "run bootscript; " \
  69. "fi; " \
  70. "fi;\0" \
  71. "mmcboot=" \
  72. "if run mmc_config; then " \
  73. "setenv storagetype mmc;" \
  74. "setenv storagedev ${mmcdev}:${mmcpart};" \
  75. "if run loadkernel; then " \
  76. "if run loadfdt; then " \
  77. "run storagebootcmd;" \
  78. "fi; " \
  79. "fi; " \
  80. "fi;\0" \
  81. "sdbootscript=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; " \
  82. "run mmcbootscript\0" \
  83. "usbbootscript=setenv usbdev ${usbdev_def}; " \
  84. "setenv storagetype usb;" \
  85. "setenv storagedev ${usbdev}:${usbpart};" \
  86. "if run loadscript; then " \
  87. "run bootscript; " \
  88. "fi; " \
  89. "sdboot=setenv mmcdev ${mmcdev_def}; setenv mmcblk 0; run mmcboot\0" \
  90. "emmcbootscript=setenv mmcdev 1; setenv mmcblk 2; run mmcbootscript\0" \
  91. "emmcboot=setenv mmcdev 1; setenv mmcblk 2; run mmcboot\0" \
  92. #define CONFIG_BOOTCOMMAND \
  93. "echo SD boot attempt ...; run sdbootscript; run sdboot; " \
  94. "echo eMMC boot attempt ...; run emmcbootscript; run emmcboot; " \
  95. "echo USB boot attempt ...; run usbbootscript; "
  96. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  97. #define CONFIG_SYS_HZ 1000
  98. /* Physical Memory Map */
  99. #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
  100. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  101. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  102. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  103. #define CONFIG_SYS_INIT_SP_OFFSET \
  104. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  105. #define CONFIG_SYS_INIT_SP_ADDR \
  106. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  107. /* SPI Flash support */
  108. /* FLASH and environment organization */
  109. /* MMC Config*/
  110. #ifdef CONFIG_FSL_USDHC
  111. #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR
  112. #define CONFIG_SYS_FSL_USDHC_NUM 2
  113. #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
  114. #endif
  115. /* USB Configs */
  116. #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
  117. #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  118. #define CONFIG_MXC_USB_FLAGS 0
  119. #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
  120. /* SPL */
  121. #include "imx7_spl.h"
  122. #endif /* __CONFIG_H */