blob: 2de5d28aebf99805b58ddcf0d7a6effe2c724664 [file] [log] [blame]
Lokesh Vutlac1e60e82018-11-02 19:51:03 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * K3: R5 MPU region definitions
4 *
Nishanth Menoneaa39c62023-11-01 15:56:03 -05005 * Copyright (C) 2017-2018 Texas Instruments Incorporated - https://www.ti.com/
Lokesh Vutlac1e60e82018-11-02 19:51:03 +05306 * Lokesh Vutla <lokeshvutla@ti.com>
7 */
8
Lokesh Vutlac1e60e82018-11-02 19:51:03 +05309#include <asm/io.h>
10#include <linux/kernel.h>
11#include "common.h"
12
13struct mpu_region_config k3_mpu_regions[16] = {
14 /*
15 * Make all 4GB as Device Memory and not executable. We are overriding
16 * it with next region for any requirement.
17 */
18 {0x00000000, REGION_0, XN_EN, PRIV_RW_USR_RW, SHARED_WRITE_BUFFERED,
19 REGION_4GB},
20
21 /* SPL code area marking it as WB and Write allocate. */
22 {CONFIG_SPL_TEXT_BASE, REGION_1, XN_DIS, PRIV_RW_USR_RW,
23 O_I_WB_RD_WR_ALLOC, REGION_8MB},
24
25 /* U-Boot's code area marking it as WB and Write allocate */
Tom Rinibb4dd962022-11-16 13:10:37 -050026 {CFG_SYS_SDRAM_BASE, REGION_2, XN_DIS, PRIV_RW_USR_RW,
Lokesh Vutlac1e60e82018-11-02 19:51:03 +053027 O_I_WB_RD_WR_ALLOC, REGION_2GB},
Keerthy305b92c2020-02-12 13:55:05 +053028 /* mcu_r5fss0_core0 BTCM area marking it as WB and Write allocate. */
29 {0x41010000, 3, XN_DIS, PRIV_RW_USR_RW, O_I_WB_RD_WR_ALLOC,
30 REGION_8MB},
Lokesh Vutlac1e60e82018-11-02 19:51:03 +053031 {0x0, 4, 0x0, 0x0, 0x0, 0x0},
32 {0x0, 5, 0x0, 0x0, 0x0, 0x0},
33 {0x0, 6, 0x0, 0x0, 0x0, 0x0},
34 {0x0, 7, 0x0, 0x0, 0x0, 0x0},
35 {0x0, 8, 0x0, 0x0, 0x0, 0x0},
36 {0x0, 9, 0x0, 0x0, 0x0, 0x0},
37 {0x0, 10, 0x0, 0x0, 0x0, 0x0},
38 {0x0, 11, 0x0, 0x0, 0x0, 0x0},
39 {0x0, 12, 0x0, 0x0, 0x0, 0x0},
40 {0x0, 13, 0x0, 0x0, 0x0, 0x0},
41 {0x0, 14, 0x0, 0x0, 0x0, 0x0},
42 {0x0, 15, 0x0, 0x0, 0x0, 0x0},
43};
44
45void setup_k3_mpu_regions(void)
46{
47 setup_mpu_regions(k3_mpu_regions, ARRAY_SIZE(k3_mpu_regions));
48}