starfive-visionfive.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2021-2023 StarFive Technology Co., Ltd.
  4. * YanHong Wang <yanhong.wang@starfivetech.com>
  5. */
  6. #ifndef _STARFIVE_VISIONFIVE_H
  7. #define _STARFIVE_VISIONFIVE_H
  8. #include <version.h>
  9. #include <linux/sizes.h>
  10. #ifdef CONFIG_SPL
  11. #define CONFIG_SPL_MAX_SIZE 0x00040000
  12. #define CONFIG_SPL_BSS_START_ADDR 0x08040000
  13. #define CONFIG_SPL_BSS_MAX_SIZE 0x00010000
  14. #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \
  15. CONFIG_SPL_BSS_MAX_SIZE)
  16. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000
  17. #define CONFIG_SPL_STACK (0x08000000 + 0x00180000 - \
  18. GENERATED_GBL_DATA_SIZE)
  19. #define STARFIVE_SPL_BOOT_LOAD_ADDR 0xa0000000
  20. #endif
  21. #define CONFIG_SYS_CACHELINE_SIZE 64
  22. /*
  23. * Miscellaneous configurable options
  24. */
  25. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  26. #define CONFIG_SYS_BOOTM_LEN (32 << 20) /* 32MB */
  27. /*
  28. * Print Buffer Size
  29. */
  30. #define CONFIG_SYS_PBSIZE \
  31. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  32. /*
  33. * max number of command args
  34. */
  35. #define CONFIG_SYS_MAXARGS 16
  36. /*
  37. * Boot Argument Buffer Size
  38. */
  39. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  40. /*
  41. * Size of malloc() pool
  42. * 512kB is suggested, (CONFIG_ENV_SIZE + 128 * 1024) was not enough
  43. */
  44. #define CONFIG_SYS_MALLOC_LEN SZ_8M
  45. #define CONFIG_NR_DRAM_BANKS 1
  46. #define PHYS_SDRAM_0 0x40000000 /* SDRAM Bank #1 */
  47. #define PHYS_SDRAM_0_SIZE 0x100000000 /* 8 GB */
  48. #define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_0)
  49. /* Init Stack Pointer */
  50. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
  51. #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_16M)
  52. #define CONFIG_STANDALONE_LOAD_ADDR 0x41000000
  53. /*
  54. * Ethernet
  55. */
  56. #ifdef CONFIG_CMD_NET
  57. #define CONFIG_DW_ALTDESCRIPTOR
  58. #define DWC_NET_PHYADDR 0
  59. #define CONFIG_ARP_TIMEOUT 500
  60. #define CONFIG_NETMASK 255.255.255.0
  61. #define CONFIG_IPADDR 192.168.120.230
  62. #define CONFIG_IP_DEFRAG
  63. #ifndef CONFIG_NET_MAXDEFRAG
  64. #define CONFIG_NET_MAXDEFRAG 16384
  65. #endif
  66. #endif
  67. /* allow to overwrite serial and ethaddr */
  68. #define CONFIG_ENV_OVERWRITE
  69. /* HACK these should have '#if defined (stuff) around them like zynqp*/
  70. #define BOOT_TARGET_DEVICES(func) func(DHCP, dhcp, na) func(MMC, mmc, 0)
  71. #include <config_distro_bootcmd.h>
  72. #include <environment/distro/sf.h>
  73. #define TYPE_GUID_LOADER1 "5B193300-FC78-40CD-8002-E86C45580B47"
  74. #define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985"
  75. #define TYPE_GUID_SYSTEM "0FC63DAF-8483-4772-8E79-3D69D8477DE4"
  76. #define PARTS_DEFAULT \
  77. "name=loader1,start=17K,size=1M,type=${type_guid_gpt_loader1};" \
  78. "name=loader2,size=4MB,type=${type_guid_gpt_loader2};" \
  79. "name=system,size=-,bootable,type=${type_guid_gpt_system};"
  80. #define CONFIG_EXTRA_ENV_SETTINGS \
  81. "fdt_high=0xffffffffffffffff\0" \
  82. "initrd_high=0xffffffffffffffff\0" \
  83. "kernel_addr_r=0x44000000\0" \
  84. "fdt_addr_r=0x46000000\0" \
  85. "scriptaddr=0x88100000\0" \
  86. "script_offset_f=0x1fff000\0" \
  87. "script_size_f=0x1000\0" \
  88. "pxefile_addr_r=0x88200000\0" \
  89. "ramdisk_addr_r=0x88300000\0" \
  90. "type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
  91. "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
  92. "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \
  93. "partitions=" PARTS_DEFAULT "\0" \
  94. BOOTENV \
  95. BOOTENV_SF
  96. /*
  97. * memtest works on 1.9 MB in DRAM
  98. */
  99. #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_0
  100. #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE)
  101. #define CONFIG_SYS_BAUDRATE_TABLE {9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600}
  102. #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  103. /* 6.25MHz RTC clock, StarFive JH7110*/
  104. #define CONFIG_SYS_HZ_CLOCK 4000000
  105. #define __io
  106. #define memset_io(c, v, l) memset((c), (v), (l))
  107. #define memcpy_fromio(a, c, l) memcpy((a), (c), (l))
  108. #define memcpy_toio(c, a, l) memcpy((c), (a), (l))
  109. #define CONFIG_VIDEO_BMP_LOGO
  110. #define CONFIG_VIDEO_LOGO
  111. #define CONFIG_BMP_16BPP
  112. #define CONFIG_BMP_24BPP
  113. #define CONFIG_BMP_32BPP
  114. #endif /* _STARFIVE_EVB_H */