zephyr/soc/intel/intel_adsp/common/boot_complete.c
Anas Nashif 810f978bed Revert parts of "soc: intel: move init code from SYS_INIT to hooks"
This reverts parts of commit c344771d8b
related to intel_adsp soc.

There is a dependency on device initialization that was missed.

Reverting until we have a proper way for migrating to hooks.

Fixes #78880

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-23 18:13:17 -04:00

32 lines
777 B
C

/* Copyright(c) 2022 Intel Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/arch/xtensa/arch.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/init.h>
#include <errno.h>
#include <zephyr/cache.h>
#include <mem_window.h>
int boot_complete(void)
{
uint32_t *win;
const struct mem_win_config *config;
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(mem_window0));
if (!device_is_ready(dev)) {
return -ENODEV;
}
config = dev->config;
win = sys_cache_uncached_ptr_get((__sparse_force void __sparse_cache *)config->mem_base);
/* Software protocol: "firmware entered" has the value 5 */
win[0] = 5;
return 0;
}
SYS_INIT(boot_complete, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);