summaryrefslogtreecommitdiff
path: root/bsp/smartfusion2/CMSIS/startup_arm/low_level_init.c
blob: e350509927883a3146d350049c149f382b972b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*******************************************************************************
 * (c) Copyright 2014 Microsemi SoC Products Group. All rights reserved.
 *
 *  Keil-MDK specific system initialization.
 *
 * SVN $Revision: 7375 $
 * SVN $Date: 2015-05-01 14:57:40 +0100 (Fri, 01 May 2015) $
 */
#ifdef MSCC_NO_RELATIVE_PATHS
#include "m2sxxx.h"
#else
#include "..\m2sxxx.h"
#endif

#define ENVM_BASE_ADDRESS       0x60000000U
#define MDDR_BASE_ADDRESS       0xA0000000U

//extern unsigned int Image$$ER_RW$$Base;
//extern unsigned int Image$$ER_RO$$Base;

/*==============================================================================
 * The __low_level_init() function is called after SystemInit. Therefore, the
 * external RAM should be configured at this stage if it is used.
 */
/* void low_level_init(void)
{
    volatile unsigned int rw_region_base;
    volatile unsigned int readonly_region_base;
    
    rw_region_base = (unsigned int)&Image$$ER_RW$$Base;
    if (rw_region_base >= MDDR_BASE_ADDRESS)
    {
        / --------------------------------------------------------------------------
         * Remap MDDR to address 0x00000000.
         /
        SYSREG->ESRAM_CR = 0u;
        SYSREG->ENVM_REMAP_BASE_CR = 0u;
        SYSREG->DDR_CR = 1u;
    }
    
    readonly_region_base = (unsigned int)&Image$$ER_RO$$Base;
    SCB->VTOR = readonly_region_base;
}  */