Files
android/drivers/misc/mediatek/fiq_cache/mtk-fiq-cache.c
T
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

55 lines
1.4 KiB
C

/*
* Copyright (C) 2016 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/printk.h>
#include <linux/kernel.h>
#include <mt-plat/mtk_secure_api.h>
unsigned long *aee_rr_rec_fiq_cache_step_pa(void);
#ifdef CONFIG_MACH_MT6763
DEFINE_SPINLOCK(cache_lock);
#else
static DEFINE_MUTEX(cache_mutex);
#endif
void mt_fiq_cache_flush_all(void)
{
#ifdef CONFIG_MACH_MT6763
unsigned long flags;
trace_printk("[FIQ_CACHE] starts\n");
spin_lock_irqsave(&cache_lock, flags);
mt_secure_call(MTK_SIP_KERNEL_CACHE_FLUSH_FIQ, 0, 0, 0);
spin_unlock_irqrestore(&cache_lock, flags);
trace_printk("[FIQ_CACHE] done\n");
#else
mutex_lock(&cache_mutex);
trace_printk("[FIQ_CACHE] starts\n");
mt_secure_call(MTK_SIP_KERNEL_CACHE_FLUSH_FIQ, 0, 0, 0);
trace_printk("[FIQ_CACHE] done\n");
mutex_unlock(&cache_mutex);
#endif
}
static int __init fiq_cache_init(void)
{
mt_secure_call(MTK_SIP_KERNEL_CACHE_FLUSH_INIT,
(unsigned long)aee_rr_rec_fiq_cache_step_pa(), 0, 0);
return 0;
}
module_init(fiq_cache_init);