s32v234evb.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /*
  2. * (C) Copyright 2015-2016 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. *
  6. * Configuration settings for the Freescale S32V234 EVB board.
  7. */
  8. #ifndef __CONFIG_H
  9. #define __CONFIG_H
  10. #ifndef CONFIG_SPL_BUILD
  11. #include <config_distro_defaults.h>
  12. #endif
  13. #include <asm/arch/imx-regs.h>
  14. #define CONFIG_S32V234
  15. #define CONFIG_DM
  16. /* Config GIC */
  17. #define CONFIG_GICV2
  18. #define GICD_BASE 0x7D001000
  19. #define GICC_BASE 0x7D002000
  20. #define CONFIG_REMAKE_ELF
  21. #undef CONFIG_RUN_FROM_IRAM_ONLY
  22. #define CONFIG_RUN_FROM_DDR1
  23. #undef CONFIG_RUN_FROM_DDR0
  24. /* Run by default from DDR1 */
  25. #ifdef CONFIG_RUN_FROM_DDR0
  26. #define DDR_BASE_ADDR 0x80000000
  27. #else
  28. #define DDR_BASE_ADDR 0xC0000000
  29. #endif
  30. #define CONFIG_MACH_TYPE 4146
  31. #define CONFIG_SKIP_LOWLEVEL_INIT
  32. /* Config CACHE */
  33. #define CONFIG_CMD_CACHE
  34. #define CONFIG_SYS_FULL_VA
  35. /* Enable passing of ATAGs */
  36. #define CONFIG_CMDLINE_TAG
  37. /* SMP Spin Table Definitions */
  38. #define CPU_RELEASE_ADDR (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
  39. /* Generic Timer Definitions */
  40. #define COUNTER_FREQUENCY (1000000000) /* 1000MHz */
  41. #define CONFIG_SYS_FSL_ERRATUM_A008585
  42. /* Size of malloc() pool */
  43. #ifdef CONFIG_RUN_FROM_IRAM_ONLY
  44. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 1 * 1024 * 1024)
  45. #else
  46. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
  47. #endif
  48. #define CONFIG_BOARD_EARLY_INIT_F
  49. #define CONFIG_DM_SERIAL
  50. #define CONFIG_FSL_LINFLEXUART
  51. #define LINFLEXUART_BASE LINFLEXD0_BASE_ADDR
  52. #define CONFIG_DEBUG_UART_LINFLEXUART
  53. #define CONFIG_DEBUG_UART_BASE LINFLEXUART_BASE
  54. /* Allow to overwrite serial and ethaddr */
  55. #define CONFIG_ENV_OVERWRITE
  56. #define CONFIG_SYS_UART_PORT (1)
  57. #define CONFIG_BAUDRATE 115200
  58. #undef CONFIG_CMD_IMLS
  59. #define CONFIG_FSL_ESDHC
  60. #define CONFIG_FSL_USDHC
  61. #define CONFIG_SYS_FSL_ESDHC_ADDR USDHC_BASE_ADDR
  62. #define CONFIG_SYS_FSL_ESDHC_NUM 1
  63. #define CONFIG_CMD_MMC
  64. #define CONFIG_GENERIC_MMC
  65. /* #define CONFIG_CMD_EXT2 EXT2 Support */
  66. #define CONFIG_DOS_PARTITION
  67. #if 0
  68. /* Ethernet config */
  69. #define CONFIG_CMD_PING
  70. #define CONFIG_CMD_MII
  71. #define CONFIG_FEC_MXC
  72. #define CONFIG_MII
  73. #define IMX_FEC_BASE ENET_BASE_ADDR
  74. #define CONFIG_FEC_XCV_TYPE RMII
  75. #define CONFIG_FEC_MXC_PHYADDR 0
  76. #define CONFIG_PHYLIB
  77. #define CONFIG_PHY_MICREL
  78. #endif
  79. #if 0 /* Disable until the I2C driver will be updated */
  80. /* I2C Configs */
  81. #define CONFIG_CMD_I2C
  82. #define CONFIG_HARD_I2C
  83. #define CONFIG_I2C_MXC
  84. #define CONFIG_SYS_I2C_BASE I2C0_BASE_ADDR
  85. #define CONFIG_SYS_I2C_SPEED 100000
  86. #endif
  87. #if 0 /* Disable until the FLASH will be implemented */
  88. #define CONFIG_SYS_USE_NAND
  89. #endif
  90. #ifdef CONFIG_SYS_USE_NAND
  91. /* Nand Flash Configs */
  92. #define CONFIG_CMD_NAND
  93. #define CONFIG_JFFS2_NAND
  94. #define MTD_NAND_FSL_NFC_SWECC 1
  95. #define CONFIG_NAND_FSL_NFC
  96. #define CONFIG_SYS_NAND_BASE 0x400E0000
  97. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  98. #define NAND_MAX_CHIPS CONFIG_SYS_MAX_NAND_DEVICE
  99. #define CONFIG_SYS_NAND_SELECT_DEVICE
  100. #define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
  101. #endif
  102. #define CONFIG_LOADADDR 0xC307FFC0
  103. #define CONFIG_BOOTARGS "console=ttyLF0 root=/dev/ram rw"
  104. #define CONFIG_CMD_ENV
  105. #define CONFIG_EXTRA_ENV_SETTINGS \
  106. "boot_scripts=boot.scr.uimg boot.scr\0" \
  107. "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
  108. "console=ttyLF0,115200\0" \
  109. "fdt_file=s32v234-evb.dtb\0" \
  110. "fdt_high=0xffffffff\0" \
  111. "initrd_high=0xffffffff\0" \
  112. "fdt_addr_r=0xC2000000\0" \
  113. "kernel_addr_r=0xC307FFC0\0" \
  114. "ramdisk_addr_r=0xC4000000\0" \
  115. "ramdisk=rootfs.uimg\0"\
  116. "ip_dyn=yes\0" \
  117. "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
  118. "update_sd_firmware_filename=u-boot.imx\0" \
  119. "update_sd_firmware=" \
  120. "if test ${ip_dyn} = yes; then " \
  121. "setenv get_cmd dhcp; " \
  122. "else " \
  123. "setenv get_cmd tftp; " \
  124. "fi; " \
  125. "if mmc dev ${mmcdev}; then " \
  126. "if ${get_cmd} ${update_sd_firmware_filename}; then " \
  127. "setexpr fw_sz ${filesize} / 0x200; " \
  128. "setexpr fw_sz ${fw_sz} + 1; " \
  129. "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
  130. "fi; " \
  131. "fi\0" \
  132. "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr} ${ramdisk}\0" \
  133. "jtagboot=echo Booting using jtag...; " \
  134. "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
  135. "jtagsdboot=echo Booting loading Linux with ramdisk from SD...; " \
  136. "run loaduimage; run loadramdisk; run loadfdt;"\
  137. "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
  138. "boot_net_usb_start=true\0" \
  139. BOOTENV
  140. #define BOOT_TARGET_DEVICES(func) \
  141. func(MMC, mmc, 1) \
  142. func(MMC, mmc, 0) \
  143. func(DHCP, dhcp, na)
  144. #define CONFIG_BOOTCOMMAND \
  145. "run distro_bootcmd"
  146. #include <config_distro_bootcmd.h>
  147. /* Miscellaneous configurable options */
  148. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  149. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  150. #define CONFIG_SYS_PROMPT "=> "
  151. #undef CONFIG_AUTO_COMPLETE
  152. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  153. #define CONFIG_SYS_PBSIZE \
  154. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  155. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  156. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  157. #define CONFIG_CMDLINE_EDITING
  158. #define CONFIG_CMD_MEMTEST
  159. #define CONFIG_SYS_MEMTEST_START (DDR_BASE_ADDR)
  160. #define CONFIG_SYS_MEMTEST_END (DDR_BASE_ADDR + 0x7C00000)
  161. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  162. #define CONFIG_SYS_HZ 1000
  163. #define CONFIG_SYS_TEXT_BASE 0x3E800000 /* SDRAM */
  164. #ifdef CONFIG_RUN_FROM_IRAM_ONLY
  165. #define CONFIG_SYS_MALLOC_BASE (DDR_BASE_ADDR)
  166. #endif
  167. /*
  168. * Stack sizes
  169. * The stack sizes are set up in start.S using the settings below
  170. */
  171. #define CONFIG_STACKSIZE (128 * 1024) /* regular stack */
  172. #if 0
  173. /* Configure PXE */
  174. #define CONFIG_BOOTP_PXE
  175. #define CONFIG_BOOTP_PXE_CLIENTARCH 0x100
  176. #endif
  177. /* Physical memory map */
  178. /* EVB board has 2x256 MB DDR chips, DDR0 and DDR1, u-boot is using just one */
  179. #define CONFIG_NR_DRAM_BANKS 1
  180. #define PHYS_SDRAM (DDR_BASE_ADDR)
  181. #define PHYS_SDRAM_SIZE (256 * 1024 * 1024)
  182. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
  183. #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
  184. #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
  185. #define CONFIG_SYS_INIT_SP_OFFSET \
  186. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  187. #define CONFIG_SYS_INIT_SP_ADDR \
  188. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  189. /* FLASH and environment organization */
  190. #define CONFIG_SYS_NO_FLASH
  191. #define CONFIG_ENV_SIZE (8 * 1024)
  192. #define CONFIG_ENV_IS_IN_MMC
  193. #define CONFIG_ENV_OFFSET (12 * 64 * 1024)
  194. #define CONFIG_SYS_MMC_ENV_DEV 0
  195. #define CONFIG_BOOTP_BOOTFILESIZE
  196. #define CONFIG_BOOTP_BOOTPATH
  197. #define CONFIG_BOOTP_GATEWAY
  198. #define CONFIG_BOOTP_HOSTNAME
  199. #endif