starfive-jh7100.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2018 Microsemi Corporation.
  4. * Padmarao Begari, Microsemi Corporation <padmarao.begari@microsemi.com>
  5. * Copyright (C) 2018 SiFive Inc
  6. * Troy Benjegerdes, <troy.benjegerdes@sifive.com>
  7. */
  8. #ifndef __CONFIG_H
  9. #define __CONFIG_H
  10. #include <version.h>
  11. #include <linux/sizes.h>
  12. #ifdef CONFIG_SPL
  13. #define CONFIG_SPL_MAX_SIZE 0x00100000
  14. #define CONFIG_SPL_BSS_START_ADDR 0x85000000
  15. #define CONFIG_SPL_BSS_MAX_SIZE 0x00100000
  16. #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + \
  17. CONFIG_SPL_BSS_MAX_SIZE)
  18. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000
  19. #define CONFIG_SPL_STACK (0x08000000 + 0x001D0000 - \
  20. GENERATED_GBL_DATA_SIZE)
  21. #endif
  22. #define CONFIG_SYS_CACHELINE_SIZE 64
  23. /*
  24. * CPU and Board Configuration Options
  25. */
  26. #define CONFIG_BOOTP_SERVERIP
  27. /*
  28. * Miscellaneous configurable options
  29. */
  30. #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
  31. #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64MB */
  32. /*
  33. * Print Buffer Size
  34. */
  35. #define CONFIG_SYS_PBSIZE \
  36. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  37. /*
  38. * max number of command args
  39. */
  40. #define CONFIG_SYS_MAXARGS 16
  41. /*
  42. * Boot Argument Buffer Size
  43. */
  44. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  45. #define PHYS_SDRAM_0 0x80000000 /* SDRAM Bank #1 */
  46. //#define PHYS_SDRAM_0_SIZE 0x80000000 /* 2 GB */
  47. #define PHYS_SDRAM_0_SIZE 0x200000000 /* 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 0xa0000000
  52. #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
  53. #define CONFIG_STANDALONE_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
  54. #define SIFIVE_BASE_ETHERNET 0x10020000 //GMAC
  55. #define SIFIVE_BASE_GPIO 0x10060000
  56. #define SIFIVE_BASE_SPI 0xA3100000
  57. #define CONFIG_SYS_SPI_BASE SIFIVE_BASE_SPI
  58. #define CONFIG_SYS_SPI_CLK (CONFIG_SYS_CLK_FREQ / 2)
  59. #define CONFIG_ENV_SPI_MAX_HZ 25000000
  60. #define CONFIG_BOOTFILE "vmlinuz"
  61. /*mac addr offset in otp*/
  62. #define STARFIVE_OTP_MAC_OFFSET 0x28
  63. /*
  64. * Ethernet
  65. */
  66. #ifdef CONFIG_CMD_NET
  67. #define CONFIG_DW_ALTDESCRIPTOR
  68. #define CONFIG_ARP_TIMEOUT 0x5000
  69. #define CONFIG_NETMASK 255.255.255.0
  70. #define CONFIG_IPADDR 192.168.120.200
  71. #endif
  72. /* HACK these should have '#if defined (stuff) around them like zynqp*/
  73. #define BOOT_TARGET_DEVICES(func) func(DHCP, dhcp, na) \
  74. func(MMC, mmc, 0)
  75. #include <config_distro_bootcmd.h>
  76. #include <environment/distro/sf.h>
  77. #define TYPE_GUID_LOADER1 "5B193300-FC78-40CD-8002-E86C45580B47"
  78. #define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985"
  79. #define TYPE_GUID_SYSTEM "0FC63DAF-8483-4772-8E79-3D69D8477DE4"
  80. #define PARTS_DEFAULT \
  81. "name=loader1,start=17K,size=1M,type=${type_guid_gpt_loader1};" \
  82. "name=loader2,size=4MB,type=${type_guid_gpt_loader2};" \
  83. "name=system,size=-,bootable,type=${type_guid_gpt_system};"
  84. #define CONFIG_EXTRA_ENV_SETTINGS \
  85. "fdt_high=0xffffffffffffffff\0" \
  86. "initrd_high=0xffffffffffffffff\0" \
  87. "kernel_addr_r=0x84000000\0" \
  88. "fdt_addr_r=0x88000000\0" \
  89. "scriptaddr=0x88100000\0" \
  90. "script_offset_f=0x1fff000\0" \
  91. "script_size_f=0x1000\0" \
  92. "pxefile_addr_r=0x88200000\0" \
  93. "ramdisk_addr_r=0x88300000\0" \
  94. "kernel_comp_addr_r=0x90000000\0" \
  95. "kernel_comp_size=0x10000000\0" \
  96. "type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \
  97. "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \
  98. "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \
  99. "partitions=" PARTS_DEFAULT "\0" \
  100. BOOTENV \
  101. BOOTENV_SF
  102. #define CONFIG_SYS_MAX_FLASH_SECT 0
  103. #define CONFIG_SYS_MAX_FLASH_BANKS 0
  104. #define CONFIG_SYS_BAUDRATE_TABLE {9600,19200,38400,57600,115200,230400,460800,921600}
  105. #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */
  106. /* 6.25MHz RTC clock, SiFive FU740 Manual ?? */
  107. #define CONFIG_SYS_HZ_CLOCK 6250000
  108. /*
  109. + * QSPI support
  110. + */
  111. #ifdef CONFIG_OF_CONTROL /* QSPI is controlled via DT */
  112. #define CONFIG_CQSPI_REF_CLK (250000000)
  113. #endif
  114. #define __io
  115. #endif /* __CONFIG_H */