socfpga_dbm_soc1.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2018 Marek Vasut <marex@denx.de>
  4. */
  5. #ifndef __CONFIG_DEVBOARDS_DBM_SOC1_H__
  6. #define __CONFIG_DEVBOARDS_DBM_SOC1_H__
  7. #include <asm/arch/base_addr_ac5.h>
  8. /* Memory configurations */
  9. #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1GiB */
  10. /* Booting Linux */
  11. #define CONFIG_BOOTFILE "fitImage"
  12. #define CONFIG_BOOTCOMMAND "run mmc_mmc"
  13. #define CONFIG_LOADADDR 0x01000000
  14. #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
  15. /* Environment is in MMC */
  16. #define CONFIG_ENV_OVERWRITE
  17. /* Extra Environment */
  18. #define CONFIG_EXTRA_ENV_SETTINGS \
  19. "consdev=ttyS0\0" \
  20. "baudrate=115200\0" \
  21. "bootscript=boot.scr\0" \
  22. "bootdev=/dev/mmcblk0p2\0" \
  23. "rootdev=/dev/mmcblk0p3\0" \
  24. "netdev=eth0\0" \
  25. "hostname=dbm_soc1\0" \
  26. "kernel_addr_r=0x10000000\0" \
  27. "dfu_alt_info=mmc raw 0 3867148288\0" \
  28. "update_filename=u-boot-with-spl.sfp\0" \
  29. "update_sd_offset=0x800\0" \
  30. "update_sd=" /* Update the SD firmware partition */ \
  31. "if mmc rescan ; then " \
  32. "if tftp ${update_filename} ; then " \
  33. "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \
  34. "setexpr fw_sz ${fw_sz} + 1 ; " \
  35. "mmc write ${loadaddr} ${update_sd_offset} ${fw_sz} ; " \
  36. "fi ; " \
  37. "fi\0" \
  38. "fpga_filename=output_file.rbf\0" \
  39. "load_fpga=" /* Load FPGA bitstream */ \
  40. "if tftp ${fpga_filename} ; then " \
  41. "fpga load 0 $loadaddr $filesize ; " \
  42. "bridge enable ; " \
  43. "fi\0" \
  44. "addcons=" \
  45. "setenv bootargs ${bootargs} " \
  46. "console=${consdev},${baudrate}\0" \
  47. "addip=" \
  48. "setenv bootargs ${bootargs} " \
  49. "ip=${ipaddr}:${serverip}:${gatewayip}:" \
  50. "${netmask}:${hostname}:${netdev}:off\0" \
  51. "addmisc=" \
  52. "setenv bootargs ${bootargs} ${miscargs}\0" \
  53. "addargs=run addcons addmisc\0" \
  54. "mmcload=" \
  55. "mmc rescan ; " \
  56. "load mmc 0:2 ${kernel_addr_r} ${bootfile}\0" \
  57. "netload=" \
  58. "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \
  59. "miscargs=nohlt panic=1\0" \
  60. "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \
  61. "nfsargs=" \
  62. "setenv bootargs root=/dev/nfs rw " \
  63. "nfsroot=${serverip}:${rootpath},v3,tcp\0" \
  64. "mmc_mmc=" \
  65. "run mmcload mmcargs addargs ; " \
  66. "bootm ${kernel_addr_r}\0" \
  67. "mmc_nfs=" \
  68. "run mmcload nfsargs addip addargs ; " \
  69. "bootm ${kernel_addr_r}\0" \
  70. "net_mmc=" \
  71. "run netload mmcargs addargs ; " \
  72. "bootm ${kernel_addr_r}\0" \
  73. "net_nfs=" \
  74. "run netload nfsargs addip addargs ; " \
  75. "bootm ${kernel_addr_r}\0" \
  76. "try_bootscript=" \
  77. "mmc rescan;" \
  78. "if test -e mmc 0:2 ${bootscript} ; then " \
  79. "if load mmc 0:2 ${kernel_addr_r} ${bootscript};" \
  80. "then ; " \
  81. "echo Running bootscript... ; " \
  82. "source ${kernel_addr_r} ; " \
  83. "fi ; " \
  84. "fi\0" \
  85. "socfpga_legacy_reset_compat=1\0"
  86. /* The rest of the configuration is shared */
  87. #include <configs/socfpga_common.h>
  88. #endif /* __CONFIG_DEVBOARDS_DBM_SOC1_H__ */