blob: 3f45a25cea48f80bfadc40d94a3aebfc1162edbd [file] [log] [blame]
rev13@wp.plfec465a2015-03-01 12:44:40 +01001/*
2 * (C) Copyright 2015
Kamil Lulkodecd33b2015-11-29 11:50:53 +01003 * Kamil Lulko, <kamil.lulko@gmail.com>
rev13@wp.plfec465a2015-03-01 12:44:40 +01004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <asm/io.h>
Vikas Manochaa645cba2017-05-03 16:38:56 -070010#include <asm/armv7m_mpu.h>
rev13@wp.plfec465a2015-03-01 12:44:40 +010011#include <asm/arch/stm32.h>
12
13u32 get_cpu_rev(void)
14{
15 return 0;
16}
17
18int arch_cpu_init(void)
19{
Vikas Manochaa645cba2017-05-03 16:38:56 -070020 struct mpu_region_config stm32_region_config[] = {
21 { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
22 STRONG_ORDER, REGION_4GB },
23 };
rev13@wp.plfec465a2015-03-01 12:44:40 +010024 configure_clocks();
rev13@wp.plfec465a2015-03-01 12:44:40 +010025 /*
26 * Configure the memory protection unit (MPU) to allow full access to
27 * the whole 4GB address space.
28 */
Vikas Manochaa645cba2017-05-03 16:38:56 -070029 disable_mpu();
30 for (int i = 0; i < ARRAY_SIZE(stm32_region_config); i++)
31 mpu_config(&stm32_region_config[i]);
32 enable_mpu();
rev13@wp.plfec465a2015-03-01 12:44:40 +010033
34 return 0;
35}
36
37void s_init(void)
38{
39}