vcoreiii.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
  2. /*
  3. * Copyright (c) 2018 Microsemi Corporation
  4. */
  5. #ifndef __VCOREIII_H
  6. #define __VCOREIII_H
  7. #include <linux/sizes.h>
  8. /* Onboard devices */
  9. #define CONFIG_SYS_MALLOC_LEN 0x1F0000
  10. #define CONFIG_SYS_LOAD_ADDR 0x00100000
  11. #define CONFIG_SYS_INIT_SP_OFFSET 0x400000
  12. #if defined(CONFIG_SOC_LUTON) || defined(CONFIG_SOC_SERVAL)
  13. #define CPU_CLOCK_RATE 416666666 /* Clock for the MIPS core */
  14. #define CONFIG_SYS_MIPS_TIMER_FREQ 208333333
  15. #else
  16. #define CPU_CLOCK_RATE 500000000 /* Clock for the MIPS core */
  17. #define CONFIG_SYS_MIPS_TIMER_FREQ (CPU_CLOCK_RATE / 2)
  18. #endif
  19. #define CONFIG_SYS_NS16550_CLK CONFIG_SYS_MIPS_TIMER_FREQ
  20. #define CONFIG_BOARD_TYPES
  21. #define CONFIG_SYS_SDRAM_BASE 0x80000000
  22. #if defined(CONFIG_DDRTYPE_H5TQ1G63BFA) || defined(CONFIG_DDRTYPE_MT47H128M8HQ)
  23. #define CONFIG_SYS_SDRAM_SIZE (128 * SZ_1M)
  24. #elif defined(CONFIG_DDRTYPE_MT41J128M16HA) || defined(CONFIG_DDRTYPE_MT41K128M16JT)
  25. #define CONFIG_SYS_SDRAM_SIZE (256 * SZ_1M)
  26. #elif defined(CONFIG_DDRTYPE_H5TQ4G63MFR) || defined(CONFIG_DDRTYPE_MT41K256M16)
  27. #define CONFIG_SYS_SDRAM_SIZE (512 * SZ_1M)
  28. #else
  29. #error Unknown DDR size - please add!
  30. #endif
  31. #define CONFIG_CONS_INDEX 1
  32. #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
  33. #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE - SZ_1M)
  34. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  35. #define CONFIG_BOARD_EARLY_INIT_R
  36. #if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
  37. #define VCOREIII_DEFAULT_MTD_ENV \
  38. "mtdparts="CONFIG_MTDPARTS_DEFAULT"\0" \
  39. "mtdids="CONFIG_MTDIDS_DEFAULT"\0"
  40. #else
  41. #define VCOREIII_DEFAULT_MTD_ENV /* Go away */
  42. #endif
  43. #define CONFIG_SYS_BOOTM_LEN (16 << 20) /* Increase max gunzip size */
  44. #define CONFIG_EXTRA_ENV_SETTINGS \
  45. VCOREIII_DEFAULT_MTD_ENV \
  46. "loadaddr=0x81000000\0" \
  47. "spi_image_off=0x00100000\0" \
  48. "console=ttyS0,115200\0" \
  49. "setup=setenv bootargs console=${console} ${mtdparts}" \
  50. "${bootargs_extra}\0" \
  51. "spiboot=run setup; sf probe; sf read ${loadaddr}" \
  52. "${spi_image_off} 0x600000; bootm ${loadaddr}\0" \
  53. "ubootfile=u-boot.bin\0" \
  54. "update=sf probe;mtdparts;dhcp ${loadaddr} ${ubootfile};" \
  55. "sf erase UBoot 0x100000;" \
  56. "sf write ${loadaddr} UBoot ${filesize}\0" \
  57. "bootcmd=run spiboot\0" \
  58. ""
  59. #endif /* __VCOREIII_H */