add cache driver for NXP SYSCON LPCAC controller, this driver provides instruction cache management with enable/disable and invalidation support. Signed-off-by: Holt Sun <holt.sun@nxp.com>
59 lines
871 B
C
59 lines
871 B
C
/*
|
|
* Copyright 2025 NXP
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/kernel.h>
|
|
#include <zephyr/drivers/cache.h>
|
|
#include <zephyr/logging/log.h>
|
|
#include <fsl_cache_lpcac.h>
|
|
|
|
void cache_instr_enable(void)
|
|
{
|
|
L1CACHE_EnableCodeCache();
|
|
}
|
|
|
|
void cache_instr_disable(void)
|
|
{
|
|
L1CACHE_DisableCodeCache();
|
|
}
|
|
|
|
int cache_instr_flush_all(void)
|
|
{
|
|
return -ENOTSUP;
|
|
}
|
|
|
|
int cache_instr_invd_all(void)
|
|
{
|
|
L1CACHE_InvalidateCodeCache();
|
|
|
|
return 0;
|
|
}
|
|
|
|
int cache_instr_flush_and_invd_all(void)
|
|
{
|
|
return -ENOTSUP;
|
|
}
|
|
|
|
int cache_instr_flush_range(void *addr, size_t size)
|
|
{
|
|
ARG_UNUSED(addr);
|
|
ARG_UNUSED(size);
|
|
return -ENOTSUP;
|
|
}
|
|
|
|
int cache_instr_invd_range(void *addr, size_t size)
|
|
{
|
|
ARG_UNUSED(addr);
|
|
ARG_UNUSED(size);
|
|
return -ENOTSUP;
|
|
}
|
|
|
|
int cache_instr_flush_and_invd_range(void *addr, size_t size)
|
|
{
|
|
ARG_UNUSED(addr);
|
|
ARG_UNUSED(size);
|
|
return -ENOTSUP;
|
|
}
|