rev13@wp.pl | fec465a | 2015-03-01 12:44:40 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2015 |
Kamil Lulko | decd33b | 2015-11-29 11:50:53 +0100 | [diff] [blame] | 3 | * Kamil Lulko, <kamil.lulko@gmail.com> |
rev13@wp.pl | fec465a | 2015-03-01 12:44:40 +0100 | [diff] [blame] | 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <asm/io.h> |
Vikas Manocha | a645cba | 2017-05-03 16:38:56 -0700 | [diff] [blame] | 10 | #include <asm/armv7m_mpu.h> |
rev13@wp.pl | fec465a | 2015-03-01 12:44:40 +0100 | [diff] [blame] | 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 | { |
Vikas Manocha | a645cba | 2017-05-03 16:38:56 -0700 | [diff] [blame] | 20 | struct mpu_region_config stm32_region_config[] = { |
| 21 | { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW, |
| 22 | STRONG_ORDER, REGION_4GB }, |
| 23 | }; |
Patrice Chotard | 1cb9372 | 2017-07-28 11:54:14 +0200 | [diff] [blame^] | 24 | int i; |
| 25 | |
rev13@wp.pl | fec465a | 2015-03-01 12:44:40 +0100 | [diff] [blame] | 26 | configure_clocks(); |
rev13@wp.pl | fec465a | 2015-03-01 12:44:40 +0100 | [diff] [blame] | 27 | /* |
| 28 | * Configure the memory protection unit (MPU) to allow full access to |
| 29 | * the whole 4GB address space. |
| 30 | */ |
Vikas Manocha | a645cba | 2017-05-03 16:38:56 -0700 | [diff] [blame] | 31 | disable_mpu(); |
Patrice Chotard | 1cb9372 | 2017-07-28 11:54:14 +0200 | [diff] [blame^] | 32 | for (i = 0; i < ARRAY_SIZE(stm32_region_config); i++) |
Vikas Manocha | a645cba | 2017-05-03 16:38:56 -0700 | [diff] [blame] | 33 | mpu_config(&stm32_region_config[i]); |
| 34 | enable_mpu(); |
rev13@wp.pl | fec465a | 2015-03-01 12:44:40 +0100 | [diff] [blame] | 35 | |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | void s_init(void) |
| 40 | { |
| 41 | } |