low_level_init.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*******************************************************************************
  2. * (c) Copyright 2014 Microsemi SoC Products Group. All rights reserved.
  3. *
  4. * Keil-MDK specific system initialization.
  5. *
  6. * SVN $Revision: 7375 $
  7. * SVN $Date: 2015-05-01 14:57:40 +0100 (Fri, 01 May 2015) $
  8. */
  9. #ifdef MSCC_NO_RELATIVE_PATHS
  10. #include "m2sxxx.h"
  11. #else
  12. #include "..\m2sxxx.h"
  13. #endif
  14. #define ENVM_BASE_ADDRESS 0x60000000U
  15. #define MDDR_BASE_ADDRESS 0xA0000000U
  16. //extern unsigned int Image$$ER_RW$$Base;
  17. //extern unsigned int Image$$ER_RO$$Base;
  18. /*==============================================================================
  19. * The __low_level_init() function is called after SystemInit. Therefore, the
  20. * external RAM should be configured at this stage if it is used.
  21. */
  22. /* void low_level_init(void)
  23. {
  24. volatile unsigned int rw_region_base;
  25. volatile unsigned int readonly_region_base;
  26. rw_region_base = (unsigned int)&Image$$ER_RW$$Base;
  27. if (rw_region_base >= MDDR_BASE_ADDRESS)
  28. {
  29. / --------------------------------------------------------------------------
  30. * Remap MDDR to address 0x00000000.
  31. /
  32. SYSREG->ESRAM_CR = 0u;
  33. SYSREG->ENVM_REMAP_BASE_CR = 0u;
  34. SYSREG->DDR_CR = 1u;
  35. }
  36. readonly_region_base = (unsigned int)&Image$$ER_RO$$Base;
  37. SCB->VTOR = readonly_region_base;
  38. } */