tianhuo-c810.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (C) 2017-2020 Alibaba Group Holding Limited
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __CONFIG_H
  7. #define __CONFIG_H
  8. #include <linux/sizes.h>
  9. // #define DEBUG
  10. #define SPL_SSEG0_BASEADDRESS 0x80000000
  11. #define SSEG0_BASEADDRESS 0x80000000
  12. #define SSEG1_BASEADDRESS 0xe0000000
  13. #define CONFIG_NR_DRAM_BANKS 1
  14. #define CONFIG_BOARD_EARLY_INIT_R
  15. #define CONFIG_BOARD_EARLY_INIT_F
  16. #define CONFIG_SYS_HZ 1000
  17. #define CPU_DEFAULT_FREQ 50000000
  18. #define LSP_DEFAULT_FREQ 50000000
  19. #define HSP_DEFAULT_FREQ 25000000
  20. #define LSP_CLOCK (LSP_DEFAULT_FREQ / 1000000)
  21. #define CONFIG_SYS_CLK_FREQ CPU_DEFAULT_FREQ
  22. /* Physical Memory Map */
  23. #define PHYS_SRAM_1 0xff800000
  24. #define PHYS_SDRAM_1 0x80000000
  25. #define PHYS_SDRAM_1_SIZE 0x18000000 /* 384M */
  26. #define CONFIG_SYS_TEXT_BASE 0x97800000
  27. #define CONFIG_SYS_LOAD_ADDR 0x80000000
  28. #define CONFIG_SYS_SRAM_BASE PHYS_SRAM_1
  29. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_TEXT_BASE + 0x80000 - 0x8)
  30. #define CONFIG_SYS_MALLOC_LEN SZ_2M
  31. #define CONFIG_SYS_BOOTM_LEN SZ_32M
  32. #define CONFIG_SYS_MEMTEST_START 0x30000000 /* memtest works on */
  33. #define CONFIG_SYS_MEMTEST_END 0x33F00000 /* 63 MB in DRAM */
  34. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  35. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  36. #define CONFIG_SPL_STACK (CONFIG_SYS_SRAM_BASE + 0x8000 - 0x8)
  37. #define CONFIG_SPL_MAX_FOOTPRINT 0x4000
  38. #ifdef CONFIG_SPL_BUILD
  39. #define INTC_BASEADDRESS 0xffc10000
  40. #define TIMER_BASEADDRESS 0xffc33000
  41. #define ERAGON_MMC0_BASE 0xf7080000
  42. #else
  43. #define INTC_BASEADDRESS 0xbfc10000
  44. #define TIMER_BASEADDRESS 0xbfc33000
  45. #define ERAGON_MMC0_BASE 0xb7080000
  46. #endif
  47. #define UBOOT_INTERNAL_VERSION "0.1"
  48. #define CONFIG_C810_CSKY
  49. #define CONFIG_BOARD_PRINTF_SUPPORT
  50. #define CONFIG_BOARD_CONSOLE_SUPPORT
  51. #define CONFIG_BOARD_MMC_SUPPORT
  52. #define CONFIG_BOARD_SPIFLASH_SUPPORT
  53. #define CONFIG_SUPPORT_EMMC_BOOT
  54. #define HAVE_BLOCK_DEVICE
  55. #define TIMER_ID 0
  56. #define TIME_IRQ 4
  57. #define CONFIG_BAUDRATE 115200
  58. #define TIMEOUT_COUNT_TIMER TIMER0
  59. #define TIMEOUT_VALUE 500
  60. #define CONFIG_SYS_CBSIZE 256 /* This is Console Buffer size */
  61. #define CONFIG_SYS_MAXARGS 16
  62. /* NAND configuration */
  63. #ifdef CONFIG_CMD_NAND
  64. #define CONFIG_NAND_ERAGON 1
  65. #define CONFIG_SYS_ERAGON_NAND_HWECC
  66. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  67. #define CONFIG_SYS_NAND_BASE 0x4E000000
  68. #endif
  69. /* Network Configuration */
  70. #define CONFIG_DW_ALTDESCRIPTOR
  71. #define CONFIG_MII 1
  72. #define CONFIG_PHY_MARVELL 1
  73. #define CONFIG_NET_RETRY_COUNT 20
  74. #define PHYS_FLASH_1 0x00200000 /* Flash Bank #0 */
  75. #define CONFIG_SYS_FLASH_BASE PHYS_FLASH_1
  76. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  77. #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x070000)
  78. #define CONFIG_SYS_MMC_ENV_DEV 0
  79. /* Image address in Flash */
  80. #define FLASH_SPL_READ_ADDR 0x100000 /* 1M */
  81. #define FLASH_SPL_SIZE 0x010000 /* 64K */
  82. #define FLASH_FDT_READ_ADDR 0x130000 /* 1M+192K */
  83. #define FLASH_FDT_SIZE 0x010000
  84. #define FLASH_UBOOT_READ_ADDR 0x140000 /* 1M+256K */
  85. #define FLASH_UBOOT_SIZE 0x080000
  86. /* Environment options */
  87. #define CONFIG_EXTRA_ENV_SETTINGS \
  88. "dtb_start_sector=0x21000\0" /* dtb start sector */ \
  89. "dtb_size_sectors=0x1000\0" /* dtb size in sectors */ \
  90. "linux_start_sector=0x22000\0" /* linux start sector */ \
  91. "linux_size_sectors=0xa000\0" /* linux size in sectors */ \
  92. "dtb_load_addr_virt=0x8f000000\0" \
  93. "dtb_load_addr_phys=0x8f000000\0" \
  94. "linux_load_addr_virt=0x90000000\0" \
  95. "linux_load_addr_phys=0x90000000\0"
  96. #undef CONFIG_BOOTCOMMAND
  97. #define CONFIG_BOOTCOMMAND \
  98. "mmc read ${dtb_load_addr_phys} ${dtb_start_sector} ${dtb_size_sectors} ; " \
  99. "mmc read ${linux_load_addr_phys} ${linux_start_sector} ${linux_size_sectors} ; " \
  100. "bootm ${linux_load_addr_virt} "
  101. #endif /* __CONFIG_H */