]> rtime.felk.cvut.cz Git - arc.git/blob - boards/mpc5606b_xpc560s/config/Fls_Cfg.h
added 5606b support(5607b should be mostly the exact same so added that for linkfile...
[arc.git] / boards / mpc5606b_xpc560s / config / Fls_Cfg.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 /** @addtogroup Fls Flash Driver\r
17  *  @{ */\r
18 \r
19 /** @file Fls_Cfg.h\r
20  *  Definitions of configuration parameters for Flash Driver.\r
21  */\r
22 \r
23 \r
24 \r
25 #ifndef FLS_CFG_H_\r
26 #define FLS_CFG_H_\r
27 \r
28 #define USE_FLS_INFO            STD_ON\r
29 \r
30 \r
31 /* STD container : Fls\r
32  * FlsConfigSet                         1..*\r
33  * FlsGeneral                           1\r
34  * FlsPublishedInformation      1\r
35  */\r
36 \r
37 #include "MemIf_Types.h"\r
38 \r
39 /* FlsGeneral, 3.0 OK */\r
40 #define FLS_VARIANT_PB                          STD_OFF\r
41 #define FLS_AC_LOAD_ON_JOB_START        STD_OFF                 /* NO SUPPORT */\r
42 #define FLS_BASE_ADDRESS                        0x00000000\r
43 #define FLS_CANCEL_API                          STD_OFF                 /* NO SUPPORT */\r
44 #define FLS_COMPARE_API                         STD_ON\r
45 #define FLS_DEV_ERROR_DETECT            STD_ON\r
46 #define FLS_DRIVER_INDEX                        0                               /* NO SUPPORT */\r
47 #define FLS_GET_JOB_RESULT_API          STD_ON\r
48 #define FLS_GET_STATUS_API                      STD_ON\r
49 #define FLS_SET_MODE_API                        STD_OFF                 /* NO SUPPORT */\r
50 //#define FLS_TOTAL_SIZE\r
51 #define FLS_USE_INTERRUPTS                      STD_OFF                 /* NO SUPPORT */\r
52 #define FLS_VERSION_INFO_API            STD_ON\r
53 \r
54 /* FlsPublishedInformation, 3.0 OK */\r
55 #define FLS_AC_LOCATION_ERASE           0                               /* NO SUPPORT */\r
56 #define FLS_AC_LOCATION_WRITE           0                               /* NO SUPPORT */\r
57 #define FLS_AC_SIZE_ERASE                       0                               /* NO SUPPORT */\r
58 #define FLS_AC_SIZE_WRITE                       0                               /* NO SUPPORT */\r
59 #define FLS_ERASE_TIME                          0                               /* NO SUPPORT */\r
60 #define FLS_ERASED_VALUE                        0xff                    /* NO SUPPORT */\r
61 #define FLS_EXPECTED_HW_ID                      0                               /* NO SUPPORT */\r
62 #define FLS_SPECIFIED_ERASE_CYCLES      0                               /* NO SUPPORT */\r
63 #define FLS_WRITE_TIME                          0                               /* NO SUPPORT */\r
64 \r
65 /* MCU Specific */\r
66 #if defined(CFG_MPC5606S)\r
67 \r
68 #define FLASH_BANK_CNT                          3\r
69 #define FLASH_PAGE_SIZE                         8\r
70 #define FLASH_MAX_SECTORS                       16\r
71 #define FLS_TOTAL_SIZE              ((16*4+512+512)*1024)\r
72 \r
73 #else\r
74 #error CPU not supported\r
75 #endif\r
76 \r
77 #if (USE_FLS_INFO==STD_ON)\r
78 \r
79 typedef struct Flash {\r
80     uint32_t size;\r
81     uint32_t sectCnt;\r
82     uint32_t bankSize;\r
83     uint32_t regBase;\r
84     uint32_t sectAddr[FLASH_MAX_SECTORS+1];\r
85     uint16_t addrSpace[FLASH_MAX_SECTORS+1];\r
86 } FlashType;\r
87 \r
88 \r
89 #else\r
90 typedef struct {\r
91   Fls_LengthType FlsNumberOfSectors;\r
92   Fls_LengthType FlsPageSize;\r
93   Fls_LengthType FlsSectorSize;\r
94   Fls_AddressType FlsSectorStartaddress;\r
95 } Fls_SectorType;\r
96 #endif\r
97 \r
98 \r
99 struct Flash;\r
100 \r
101 typedef struct {\r
102         void (*FlsAcErase)();                                   /* NO SUPPORT */\r
103         void (*FlsAcWrite)();                                   /* NO SUPPORT */\r
104         // FlsCallCycle N/A in core.\r
105         void (*FlsJobEndNotification)();\r
106         void (*FlsJobErrorNotification)();\r
107         uint32_t FlsMaxReadFastMode;                            /* NO SUPPORT */\r
108         uint32_t FlsMaxReadNormalMode;                  /* NO SUPPORT */\r
109         uint32_t FlsMaxWriteFastMode;                           /* NO SUPPORT */\r
110         uint32_t FlsMaxWriteNormalMode;                 /* NO SUPPORT */\r
111         uint32_t FlsProtection;                                 /* NO SUPPORT */\r
112 #if (USE_FLS_INFO==STD_ON)\r
113         const struct Flash *FlsInfo;\r
114 #else\r
115         const Fls_SectorType *FlsSectorList;\r
116 #endif\r
117 //      const uint32 FlsSectorListSize;                 /* NO SUPPORT */\r
118 } Fls_ConfigSetType;\r
119 \r
120 typedef Fls_ConfigSetType Fls_ConfigType;\r
121 \r
122 extern const Fls_ConfigSetType FlsConfigSet[];\r
123 \r
124 #endif /*FLS_CFG_H_*/\r
125 /** @} */\r