Matt Porter | 884ea7b | 2015-05-05 15:00:24 -0400 | [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> |
Matt Porter | 884ea7b | 2015-05-05 15:00:24 -0400 | [diff] [blame] | 4 | * |
| 5 | * Copyright 2015 ATS Advanced Telematics Systems GmbH |
| 6 | * Copyright 2015 Konsulko Group, Matt Porter <mporter@konsulko.com> |
| 7 | * |
| 8 | * SPDX-License-Identifier: GPL-2.0+ |
| 9 | */ |
| 10 | |
| 11 | #include <common.h> |
| 12 | #include <asm/io.h> |
| 13 | #include <asm/armv7m.h> |
| 14 | #include <asm/arch/stm32.h> |
| 15 | |
| 16 | u32 get_cpu_rev(void) |
| 17 | { |
| 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | int arch_cpu_init(void) |
| 22 | { |
| 23 | configure_clocks(); |
| 24 | |
| 25 | /* |
| 26 | * Configure the memory protection unit (MPU) to allow full access to |
| 27 | * the whole 4GB address space. |
| 28 | */ |
| 29 | writel(0, &V7M_MPU->rnr); |
| 30 | writel(0, &V7M_MPU->rbar); |
| 31 | writel((V7M_MPU_RASR_AP_RW_RW | V7M_MPU_RASR_SIZE_4GB |
| 32 | | V7M_MPU_RASR_EN), &V7M_MPU->rasr); |
| 33 | writel(V7M_MPU_CTRL_ENABLE | V7M_MPU_CTRL_HFNMIENA, &V7M_MPU->ctrl); |
| 34 | |
| 35 | return 0; |
| 36 | } |