aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/SAMA/SAMA5D2x/sama_matrix.h
blob: 52a3bb3f18d2333c81ee0637b725a4abeb66ee07 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

/**
 * @file    SAMA5D2x/sama_matrix.h
 * @brief   SAMA MATRIX support macros and structures.
 *
 * @addtogroup SAMA5D2x_MATRIX
 * @{
 */

#ifndef SAMA_MATRIX_H
#define SAMA_MATRIX_H

/*===========================================================================*/
/* Driver constants.                                                         */
/*===========================================================================*/

#define LOWER_AREA_SECURABLE     0x0u
#define UPPER_AREA_SECURABLE     0x1u

#define SECURE_READ              0x0u
#define SECURE_WRITE             0x0u
#define NOT_SECURE_READ          0x1u
#define NOT_SECURE_WRITE         0x1u

#define NO_DEFAULT_MASTER        0x0u
#define LAST_DEFAULT_MASTER      0x1u
#define FIXED_DEFAULT_MASTER     0x2u

#define REGION_0                 (0x1u << 0)
#define REGION_1                 (0x1u << 1)
#define REGION_2                 (0x1u << 2)
#define REGION_3                 (0x1u << 3)
#define REGION_4                 (0x1u << 4)
#define REGION_5                 (0x1u << 5)
#define REGION_6                 (0x1u << 6)
#define REGION_7                 (0x1u << 7)

#define MATRIX_AREA_SIZE_4K      0x0u
#define MATRIX_AREA_SIZE_8K      0x1u
#define MATRIX_AREA_SIZE_16K     0x2u
#define MATRIX_AREA_SIZE_32K     0x3u
#define MATRIX_AREA_SIZE_64K     0x4u
#define MATRIX_AREA_SIZE_128K    0x5u
#define MATRIX_AREA_SIZE_256K    0x6u
#define MATRIX_AREA_SIZE_512K    0x7u
#define MATRIX_AREA_SIZE_1M      0x8u
#define MATRIX_AREA_SIZE_2M      0x9u
#define MATRIX_AREA_SIZE_4M      0xAu
#define MATRIX_AREA_SIZE_8M      0xBu
#define MATRIX_AREA_SIZE_16M     0xCu
#define MATRIX_AREA_SIZE_32M     0xDu
#define MATRIX_AREA_SIZE_64M     0xEu
#define MATRIX_AREA_SIZE_128M    0xFu

/*===========================================================================*/
/* Driver pre-compile time settings.                                         */
/*===========================================================================*/

/*===========================================================================*/
/* Derived constants and error checks.                                       */
/*===========================================================================*/

/*===========================================================================*/
/* Driver data structures and types.                                         */
/*===========================================================================*/

/*===========================================================================*/
/* Driver macros.                                                            */
/*===========================================================================*/

/*===========================================================================*/
/* External declarations.                                                    */
/*===========================================================================*/

#ifdef __cplusplus
extern "C" {
#endif
 void mtxConfigDefaultMaster(Matrix *mtxp, uint8_t slaveID,
                             uint8_t type, uint8_t masterID);
 void mtxConfigSlaveSec(Matrix *mtxp, uint8_t slaveID,
                        uint8_t selMask, uint8_t readMask,
                        uint8_t writeMask);
 void mtxSetSlaveSplitAddr(Matrix *mtxp, uint8_t slaveID,
                           uint8_t area, uint8_t mask);
 void mtxSetSlaveRegionSize(Matrix *mtxp, uint8_t slaveID,
                            uint8_t areaSize, uint8_t mask);
 void mtxRemapRom(void);
 void mtxRemapRam(void);
#ifdef __cplusplus
}
#endif

#endif /* SAMA_MATRIX_H */

/** @} */