]> git.sur5r.net Git - u-boot/blob - arch/arm/mach-stm32/stm32f7/soc.c
stm32: use armv7m MPU configuration support
[u-boot] / arch / arm / mach-stm32 / stm32f7 / soc.c
1 /*
2  * (C) Copyright 2015
3  * Kamil Lulko, <kamil.lulko@gmail.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <asm/io.h>
10 #include <asm/armv7m_mpu.h>
11 #include <asm/arch/stm32.h>
12
13 u32 get_cpu_rev(void)
14 {
15         return 0;
16 }
17
18 int arch_cpu_init(void)
19 {
20         struct mpu_region_config stm32_region_config[] = {
21                 { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
22                 STRONG_ORDER, REGION_4GB },
23
24                 { 0xC0000000, REGION_1, XN_DIS, PRIV_RW_USR_RW,
25                 O_I_WB_RD_WR_ALLOC, REGION_8MB },
26         };
27
28         disable_mpu();
29         for (int i = 0; i < ARRAY_SIZE(stm32_region_config); i++)
30                 mpu_config(&stm32_region_config[i]);
31         enable_mpu();
32
33         return 0;
34 }
35
36 void s_init(void)
37 {
38 }