iot_devkit.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2018 Synopsys, Inc. All rights reserved.
  4. */
  5. #ifndef _CONFIG_IOT_DEVKIT_H_
  6. #define _CONFIG_IOT_DEVKIT_H_
  7. #include <linux/sizes.h>
  8. /*
  9. * MEMORY MAP
  10. *
  11. * eFlash: 0x0000_0000 - 0x0008_0000 (512K)
  12. * ICCM: 0x2000_0000 - 0x2004_0000 (256K)
  13. * SRAM: 0x3000_0000 - 0x3002_0000 (128K)
  14. * DCCM: 0x8000_0000 - 0x8002_0000 (128K)
  15. * Note: only data goes here, as IFQ cannot fetch instructions from DCCM
  16. *
  17. *
  18. * RAM PARTITIONING
  19. *
  20. * +-----------+----------+---------------------+-------------+
  21. * | <-- Stack | .data | Malloc | Environment |
  22. * +-----------+----------+---------------------+-------------+
  23. * : : : :\___________/
  24. * : : : : |
  25. * : : : : CONFIG_ENV_SIZE
  26. * : : \____________________/
  27. * : : |
  28. * : : CONFIG_SYS_MALLOC_LEN
  29. * : :
  30. * : Specified explicitly by CONFIG_SYS_INIT_SP_ADDR
  31. * :
  32. * Specified explicitly by CONFIG_SYS_SDRAM_BASE
  33. *
  34. * NOTES:
  35. * - Stack starts from CONFIG_SYS_INIT_SP_ADDR and grows down,
  36. * i.e. towards CONFIG_SYS_SDRAM_BASE but nothing stops it from crossing
  37. * that CONFIG_SYS_SDRAM_BASE in which case data won't be really saved on
  38. * stack any longer and values popped from stack will contain garbage
  39. * leading to unexpected behavior, typically but not limited to:
  40. * - "Returning" back to bogus caller function
  41. * - Reading data from weird addresses
  42. */
  43. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  44. #define SRAM_BASE 0x30000000
  45. #define SRAM_SIZE SZ_128K
  46. #define DCCM_BASE 0x80000000
  47. #define DCCM_SIZE SZ_128K
  48. #define CONFIG_SYS_SDRAM_BASE DCCM_BASE
  49. #define CONFIG_SYS_SDRAM_SIZE DCCM_SIZE
  50. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_32K)
  51. #define CONFIG_SYS_MALLOC_LEN SZ_64K
  52. #define CONFIG_SYS_BOOTM_LEN SZ_128K
  53. #define CONFIG_SYS_LOAD_ADDR SRAM_BASE
  54. #define ROM_BASE CONFIG_SYS_MONITOR_BASE
  55. #define ROM_SIZE SZ_256K
  56. #define RAM_DATA_BASE CONFIG_SYS_INIT_SP_ADDR
  57. #define RAM_DATA_SIZE CONFIG_SYS_SDRAM_SIZE - \
  58. (CONFIG_SYS_INIT_SP_ADDR - \
  59. CONFIG_SYS_SDRAM_BASE) - \
  60. CONFIG_SYS_MALLOC_LEN - \
  61. CONFIG_ENV_SIZE
  62. /*
  63. * Environment
  64. */
  65. #define CONFIG_BOOTFILE "app.bin"
  66. #define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
  67. #endif /* _CONFIG_IOT_DEVKIT_H_ */