The `nocache` is not loadable, thus data stored therein cannot be initialized by the startup code. This might be needed in special cases. E.g. One might have a buffer which one wants to DMA into, and which is a member of a struct. Other members of the struct one may want to have initialized by the startup code. The buffer thus should be placed in the `nocache` region, but for the other members of the buffer to be initialized by the startup code, the `nocache` region needs to be loadable. Fix it by making the `nocache` region loadable. Adding a KConfig symbol to do this optionally was considered, but deemed unnecessary during the PR. Signed-off-by: Julian Achatzi <mail@achatzi.pro>
32 lines
692 B
Text
32 lines
692 B
Text
/*
|
|
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
* Copyright (c) 2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/* Copied from linker.ld */
|
|
|
|
/* Non-cached region of RAM */
|
|
SECTION_DATA_PROLOGUE(_NOCACHE_SECTION_NAME,,)
|
|
{
|
|
#if defined(CONFIG_MMU)
|
|
MMU_ALIGN;
|
|
#else
|
|
MPU_ALIGN(_nocache_ram_size);
|
|
#endif
|
|
_nocache_ram_start = .;
|
|
*(.nocache)
|
|
*(".nocache.*")
|
|
|
|
#include <snippets-nocache-section.ld>
|
|
|
|
#if defined(CONFIG_MMU)
|
|
MMU_ALIGN;
|
|
#else
|
|
MPU_ALIGN(_nocache_ram_size);
|
|
#endif
|
|
_nocache_ram_end = .;
|
|
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
|
_nocache_ram_size = _nocache_ram_end - _nocache_ram_start;
|
|
_nocache_load_start = LOADADDR(_NOCACHE_SECTION_NAME);
|