<commit_before>/*
 * Copyright (c) 2017 Synopsys
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <generated_dts_board.h>
#include <soc.h>
#include <arch/arc/v2/mpu/arc_mpu.h>
#include <linker/linker-defs.h>

#ifdef CONFIG_USERSPACE
static struct arc_mpu_region mpu_regions[] = {
#if CONFIG_ARC_MPU_VER == 3 && defined(CONFIG_APPLICATION_MEMORY)
	/* Region ICCM */
	MPU_REGION_ENTRY("IMAGE ROM",
			 (u32_t) _image_rom_start,
			 (u32_t) _image_rom_size,
			 REGION_FLASH_ATTR),
	MPU_REGION_ENTRY("APP MEMORY",
			 (u32_t) __app_ram_start,
			 (u32_t) __app_ram_size,
			 REGION_RAM_ATTR),
	MPU_REGION_ENTRY("KERNEL MEMORY",
			 (u32_t) __kernel_ram_start,
			 (u32_t) __kernel_ram_size,
			 AUX_MPU_RDP_KW | AUX_MPU_RDP_KR),

#else
#if CONFIG_ICCM_SIZE > 0
	/* Region ICCM */
	MPU_REGION_ENTRY("ICCM",
			 CONFIG_ICCM_BASE_ADDRESS,
			 CONFIG_ICCM_SIZE * 1024,
			 REGION_FLASH_ATTR),
#endif
#if CONFIG_DCCM_SIZE > 0
	/* Region DCCM */
	MPU_REGION_ENTRY("DCCM",
			 CONFIG_DCCM_BASE_ADDRESS,
			 CONFIG_DCCM_SIZE * 1024,
			 AUX_MPU_RDP_KW | AUX_MPU_RDP_KR),
#endif
	/* Region Peripheral */
	MPU_REGION_ENTRY("PERIPHERAL",
			 0xF0000000,
			 64 * 1024,
			 REGION_IO_ATTR),
#endif /* ARC_MPU_VER == 3 */
};
#else /* CONFIG_USERSPACE */
static struct arc_mpu_region mpu_regions[] = {
#if CONFIG_ICCM_SIZE > 0
	/* Region ICCM */
	MPU_REGION_ENTRY("ICCM",
			 CONFIG_ICCM_BASE_ADDRESS,
			 CONFIG_ICCM_SIZE * 1024,
			 REGION_FLASH_ATTR),
#endif
#if CONFIG_DCCM_SIZE > 0
	/* Region DCCM */
	MPU_REGION_ENTRY("DCCM",
			 CONFIG_DCCM_BASE_ADDRESS,
			 CONFIG_DCCM_SIZE * 1024,
			 REGION_RAM_ATTR),
#endif
	/* Region Peripheral */
	MPU_REGION_ENTRY("PERIPHERAL",
			 0xF0000000,
			 64 * 1024,
			 REGION_IO_ATTR),
};
#endif

struct arc_mpu_config mpu_config = {
	.num_regions = ARRAY_SIZE(mpu_regions),
	.mpu_regions = mpu_regions,<commit_msg>boards: arc: fix the wrong mpu configuration of nsim board<commit_after>/*
 * Copyright (c) 2017 Synopsys
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <generated_dts_board.h>
#include <soc.h>
#include <arch/arc/v2/mpu/arc_mpu.h>
#include <linker/linker-defs.h>

#ifdef CONFIG_USERSPACE
static struct arc_mpu_region mpu_regions[] = {
#if CONFIG_ARC_MPU_VER == 3 && defined(CONFIG_APPLICATION_MEMORY)
	/* Region ICCM */
	MPU_REGION_ENTRY("IMAGE ROM",
			 (u32_t) _image_rom_start,
			 (u32_t) _image_rom_size,
			 REGION_FLASH_ATTR),
	MPU_REGION_ENTRY("APP MEMORY",
			 (u32_t) __app_ram_start,
			 (u32_t) __app_ram_size,
			 REGION_RAM_ATTR),
	MPU_REGION_ENTRY("KERNEL MEMORY",
			 (u32_t) __kernel_ram_start,
			 (u32_t) __kernel_ram_size,
			 AUX_MPU_RDP_KW | AUX_MPU_RDP_KR),

#else
#if CONFIG_ICCM_SIZE > 0
	/* Region ICCM */
	MPU_REGION_ENTRY("ICCM",
			 CONFIG_ICCM_BASE_ADDRESS,
			 CONFIG_ICCM_SIZE * 1024,
			 REGION_FLASH_ATTR),
#endif
#if CONFIG_DCCM_SIZE > 0
	/* Region DCCM */
	MPU_REGION_ENTRY("DCCM",
			 CONFIG_DCCM_BASE_ADDRESS,
			 CONFIG_DCCM_SIZE * 1024,
			 AUX_MPU_RDP_KW | AUX_MPU_RDP_KR),
#endif
#endif /* ARC_MPU_VER == 3 */
	/* Region Peripheral */
	MPU_REGION_ENTRY("PERIPHERAL",
			 0xF0000000,
			 64 * 1024,
			 AUX_MPU_RDP_KW | AUX_MPU_RDP_KR),
};
#else /* CONFIG_USERSPACE */
static struct arc_mpu_region mpu_regions[] = {
#if CONFIG_ICCM_SIZE > 0
	/* Region ICCM */
	MPU_REGION_ENTRY("ICCM",
			 CONFIG_ICCM_BASE_ADDRESS,
			 CONFIG_ICCM_SIZE * 1024,
			 REGION_FLASH_ATTR),
#endif
#if CONFIG_DCCM_SIZE > 0
	/* Region DCCM */
	MPU_REGION_ENTRY("DCCM",
			 CONFIG_DCCM_BASE_ADDRESS,
			 CONFIG_DCCM_SIZE * 1024,
			 REGION_RAM_ATTR),
#endif
	/* Region Peripheral */
	MPU_REGION_ENTRY("PERIPHERAL",
			 0xF0000000,
			 64 * 1024,
			 REGION_IO_ATTR),
};
#endif

struct arc_mpu_config mpu_config = {
	.num_regions = ARRAY_SIZE(mpu_regions),
	.mpu_regions = mpu_regions,
{'fraction_non_alphanumeric': 0.11522086216072379, 'fraction_numerical': 0.036721660457690264, 'mean_word_length': 4.400862068965517, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6184160', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1567, 'n_words': 261}