blob: 0f73cf1dc0ed2c5d155d889adf4c9bc26b32745e [file] [log] [blame]
Vikas Manocha29645ec2017-05-03 16:38:55 -07001/*
Patrice Chotard789ee0e2017-10-23 09:53:58 +02002 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
3 * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
Vikas Manocha29645ec2017-05-03 16:38:55 -07004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8enum region_number {
9 REGION_0 = 0,
10 REGION_1,
11 REGION_2,
12 REGION_3,
13 REGION_4,
14 REGION_5,
15 REGION_6,
16 REGION_7,
17};
18
19enum ap {
20 NO_ACCESS = 0,
21 PRIV_RW_USR_NO,
22 PRIV_RW_USR_RO,
23 PRIV_RW_USR_RW,
24 UNPREDICTABLE,
25 PRIV_RO_USR_NO,
26 PRIV_RO_USR_RO,
27};
28
29enum mr_attr {
30 STRONG_ORDER = 0,
31 SHARED_WRITE_BUFFERED,
32 O_I_WT_NO_WR_ALLOC,
33 O_I_WB_NO_WR_ALLOC,
34 O_I_NON_CACHEABLE,
35 O_I_WB_RD_WR_ALLOC,
36 DEVICE_NON_SHARED,
37};
38enum size {
39 REGION_8MB = 22,
40 REGION_16MB,
41 REGION_32MB,
42 REGION_64MB,
43 REGION_128MB,
44 REGION_256MB,
45 REGION_512MB,
46 REGION_1GB,
47 REGION_2GB,
48 REGION_4GB,
49};
50
51enum xn {
52 XN_DIS = 0,
53 XN_EN,
54};
55
56struct mpu_region_config {
57 uint32_t start_addr;
58 enum region_number region_no;
59 enum xn xn;
60 enum ap ap;
61 enum mr_attr mr_attr;
62 enum size reg_size;
63};
64
65void disable_mpu(void);
66void enable_mpu(void);
67void mpu_config(struct mpu_region_config *reg_config);