2016-07-07 16:02:24 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2015
|
|
|
|
* Kamil Lulko, <kamil.lulko@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
2017-05-03 23:38:56 +00:00
|
|
|
#include <asm/armv7m_mpu.h>
|
2016-07-07 16:02:24 +00:00
|
|
|
#include <asm/arch/stm32.h>
|
|
|
|
|
|
|
|
u32 get_cpu_rev(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int arch_cpu_init(void)
|
|
|
|
{
|
2017-07-01 17:06:09 +00:00
|
|
|
int i;
|
|
|
|
|
2017-05-03 23:38:56 +00:00
|
|
|
struct mpu_region_config stm32_region_config[] = {
|
|
|
|
{ 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW,
|
2017-05-03 23:38:57 +00:00
|
|
|
O_I_WB_RD_WR_ALLOC, REGION_4GB },
|
2017-05-03 23:38:56 +00:00
|
|
|
|
2017-05-03 23:38:57 +00:00
|
|
|
{ 0x00000000, REGION_1, XN_DIS, PRIV_RW_USR_RW,
|
|
|
|
STRONG_ORDER, REGION_512MB },
|
|
|
|
|
|
|
|
{ 0x40000000, REGION_2, XN_EN, PRIV_RW_USR_RW,
|
|
|
|
DEVICE_NON_SHARED, REGION_512MB },
|
|
|
|
|
|
|
|
{ 0xA0000000, REGION_3, XN_EN, PRIV_RW_USR_RW,
|
|
|
|
DEVICE_NON_SHARED, REGION_512MB },
|
|
|
|
|
|
|
|
{ 0xE0000000, REGION_4, XN_EN, PRIV_RW_USR_RW,
|
|
|
|
STRONG_ORDER, REGION_512MB },
|
2017-05-03 23:38:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
disable_mpu();
|
2017-07-01 17:06:09 +00:00
|
|
|
for (i = 0; i < ARRAY_SIZE(stm32_region_config); i++)
|
2017-05-03 23:38:56 +00:00
|
|
|
mpu_config(&stm32_region_config[i]);
|
|
|
|
enable_mpu();
|
2016-07-07 16:02:25 +00:00
|
|
|
|
2016-07-07 16:02:24 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void s_init(void)
|
|
|
|
{
|
|
|
|
}
|