blob: b5d06dbe8333cfca804ea845b338bb9d1e3161a3 [file] [log] [blame]
rev13@wp.pleaaa4f72015-03-01 12:44:40 +01001/*
2 * (C) Copyright 2015
Kamil Lulko5be93562015-11-29 11:50:53 +01003 * Kamil Lulko, <kamil.lulko@gmail.com>
rev13@wp.pleaaa4f72015-03-01 12:44:40 +01004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <asm/io.h>
10#include <asm/armv7m.h>
11#include <asm/arch/stm32.h>
12
13u32 get_cpu_rev(void)
14{
15 return 0;
16}
17
18int arch_cpu_init(void)
19{
20 configure_clocks();
21
22 /*
23 * Configure the memory protection unit (MPU) to allow full access to
24 * the whole 4GB address space.
25 */
26 writel(0, &V7M_MPU->rnr);
27 writel(0, &V7M_MPU->rbar);
28 writel((V7M_MPU_RASR_AP_RW_RW | V7M_MPU_RASR_SIZE_4GB
29 | V7M_MPU_RASR_EN), &V7M_MPU->rasr);
30 writel(V7M_MPU_CTRL_ENABLE | V7M_MPU_CTRL_HFNMIENA, &V7M_MPU->ctrl);
31
32 return 0;
33}
34
35void s_init(void)
36{
37}