mx53cx9020.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2015 Beckhoff Automation GmbH & Co. KG
  4. * Patrick Bruenn <p.bruenn@beckhoff.com>
  5. *
  6. * Configuration settings for Beckhoff CX9020.
  7. *
  8. * Based on Freescale's Linux i.MX mx53loco.h file:
  9. * Copyright (C) 2010-2011 Freescale Semiconductor.
  10. */
  11. #ifndef __CONFIG_H
  12. #define __CONFIG_H
  13. #include <asm/arch/imx-regs.h>
  14. #define CONFIG_CMDLINE_TAG
  15. #define CONFIG_SETUP_MEMORY_TAGS
  16. #define CONFIG_INITRD_TAG
  17. #define CONFIG_SYS_FSL_CLK
  18. /* Size of malloc() pool */
  19. #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
  20. #define CONFIG_REVISION_TAG
  21. #define CONFIG_MXC_UART_BASE UART2_BASE
  22. #define CONFIG_FPGA_COUNT 1
  23. /* MMC Configs */
  24. #define CONFIG_SYS_FSL_ESDHC_ADDR 0
  25. #define CONFIG_SYS_FSL_ESDHC_NUM 2
  26. /* bootz: zImage/initrd.img support */
  27. /* Eth Configs */
  28. #define IMX_FEC_BASE FEC_BASE_ADDR
  29. #define CONFIG_ETHPRIME "FEC0"
  30. #define CONFIG_FEC_MXC_PHYADDR 0x1F
  31. /* USB Configs */
  32. #define CONFIG_MXC_USB_PORT 1
  33. #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  34. #define CONFIG_MXC_USB_FLAGS 0
  35. /* allow to overwrite serial and ethaddr */
  36. #define CONFIG_ENV_OVERWRITE
  37. /* Command definition */
  38. #define CONFIG_LOADADDR 0x70010000 /* loadaddr env var */
  39. #define CONFIG_EXTRA_ENV_SETTINGS \
  40. "fdt_addr_r=0x71ff0000\0" \
  41. "pxefile_addr_r=0x73000000\0" \
  42. "ramdisk_addr_r=0x72000000\0" \
  43. "console=ttymxc1,115200\0" \
  44. "uenv=/boot/uEnv.txt\0" \
  45. "optargs=\0" \
  46. "cmdline=\0" \
  47. "mmcdev=0\0" \
  48. "mmcpart=1\0" \
  49. "mmcrootfstype=ext4 rootwait fixrtc\0" \
  50. "mmcargs=setenv bootargs console=${console} " \
  51. "${optargs} " \
  52. "root=/dev/mmcblk${mmcdev}p${mmcpart} ro " \
  53. "rootfstype=${mmcrootfstype} " \
  54. "${cmdline}\0" \
  55. "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  56. "loadpxe=dhcp;setenv kernel_addr_r ${loadaddr};pxe get;pxe boot;\0" \
  57. "loadrd=load mmc ${bootpart} ${ramdisk_addr_r} ${bootdir}/${rdfile};" \
  58. "setenv rdsize ${filesize}\0" \
  59. "loadfdt=echo loading ${fdt_path} ...;" \
  60. "load mmc ${bootpart} ${fdt_addr_r} ${fdt_path}\0" \
  61. "mmcboot=mmc dev ${mmcdev}; " \
  62. "if mmc rescan; then " \
  63. "echo SD/MMC found on device ${mmcdev};" \
  64. "echo Checking for: ${uenv} ...;" \
  65. "setenv bootpart ${mmcdev}:${mmcpart};" \
  66. "if test -e mmc ${bootpart} ${uenv}; then " \
  67. "load mmc ${bootpart} ${loadaddr} ${uenv};" \
  68. "env import -t ${loadaddr} ${filesize};" \
  69. "echo Loaded environment from ${uenv};" \
  70. "if test -n ${dtb}; then " \
  71. "setenv fdt_file ${dtb};" \
  72. "echo Using: dtb=${fdt_file} ...;" \
  73. "fi;" \
  74. "echo Checking for uname_r in ${uenv}...;" \
  75. "if test -n ${uname_r}; then " \
  76. "echo Running uname_boot ...;" \
  77. "run uname_boot;" \
  78. "fi;" \
  79. "fi;" \
  80. "fi;\0" \
  81. "uname_boot="\
  82. "setenv bootdir /boot; " \
  83. "setenv bootfile vmlinuz-${uname_r}; " \
  84. "setenv ccatfile /boot/ccat.rbf; " \
  85. "echo loading CCAT firmware from ${ccatfile}; " \
  86. "load mmc ${bootpart} ${loadaddr} ${ccatfile}; " \
  87. "fpga load 0 ${loadaddr} ${filesize}; " \
  88. "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
  89. "echo loading ${bootdir}/${bootfile} ...; " \
  90. "run loadimage;" \
  91. "setenv fdt_path /boot/dtbs/${uname_r}/${fdt_file}; " \
  92. "if test -e mmc ${bootpart} ${fdt_path}; then " \
  93. "run loadfdt;" \
  94. "else " \
  95. "echo; echo unable to find ${fdt_file} ...;" \
  96. "echo booting legacy ...;"\
  97. "run mmcargs;" \
  98. "echo debug: [${bootargs}] ... ;" \
  99. "echo debug: [bootz ${loadaddr}] ... ;" \
  100. "bootz ${loadaddr}; " \
  101. "fi;" \
  102. "run mmcargs;" \
  103. "echo debug: [${bootargs}] ... ;" \
  104. "echo debug: [bootz ${loadaddr} - ${fdt_addr_r}];" \
  105. "bootz ${loadaddr} - ${fdt_addr_r}; " \
  106. "else " \
  107. "echo loading from dhcp ...; " \
  108. "run loadpxe; " \
  109. "fi;\0"
  110. #define CONFIG_BOOTCOMMAND \
  111. "run mmcboot;"
  112. #define CONFIG_ARP_TIMEOUT 200UL
  113. /* Miscellaneous configurable options */
  114. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  115. #define CONFIG_SYS_MEMTEST_START 0x70000000
  116. #define CONFIG_SYS_MEMTEST_END 0x70010000
  117. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  118. /* Physical Memory Map */
  119. #define PHYS_SDRAM_1 CSD0_BASE_ADDR
  120. #define PHYS_SDRAM_1_SIZE (gd->bd->bi_dram[0].size)
  121. #define PHYS_SDRAM_2 CSD1_BASE_ADDR
  122. #define PHYS_SDRAM_2_SIZE (gd->bd->bi_dram[1].size)
  123. #define PHYS_SDRAM_SIZE (gd->ram_size)
  124. #define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
  125. #define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
  126. #define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
  127. #define CONFIG_SYS_INIT_SP_OFFSET \
  128. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  129. #define CONFIG_SYS_INIT_SP_ADDR \
  130. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  131. /* environment organization */
  132. #define CONFIG_SYS_MMC_ENV_DEV 0
  133. /* Framebuffer and LCD */
  134. #define CONFIG_IMX_VIDEO_SKIP
  135. #endif /* __CONFIG_H */