Initial commit: Linux kernel 4.19 for Unplugged OS

This commit is contained in:
ziv committed 2025-10-06 13:52:42 +00:00
commit d30235b04c
80519 files changed
+35800681

No files matched your search

@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef _BOOST_CTRL_H
#define _BOOST_CTRL_H
/*boost controller parent*/
int init_boostctrl(struct proc_dir_entry *parent);
/*cpu controller*/
int cpu_ctrl_init(struct proc_dir_entry *parent);
void cpu_ctrl_exit(void);
/*dram controller*/
int dram_ctrl_init(struct proc_dir_entry *parent);
/*eas controller*/
int uclamp_ctrl_init(struct proc_dir_entry *parent);
int eas_ctrl_init(struct proc_dir_entry *parent);
/*topology controller*/
int topo_ctrl_init(struct proc_dir_entry *parent);
void topo_ctrl_exit(void);
int get_min_clstr_cap(void);
int get_max_clstr_cap(void);
#endif /* _BOOST_CTRL_H */
@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef CPU_CTRL_CFP_H
#define CPU_CTRL_CFP_H
#include <mt-plat/cpu_ctrl.h>
extern void cpu_ctrl_cfp(struct ppm_limit_data *desired_freq);
extern int cpu_ctrl_cfp_init(struct proc_dir_entry *parent);
extern void cpu_ctrl_cfp_exit(void);
#endif
@@ -0,0 +1,23 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef _EAS_CTRL_PLAT_H_
#define _EAS_CTRL_PLAT_H_
/* control migration cost */
extern unsigned int sysctl_sched_migration_cost;
extern unsigned int sysctl_sched_sync_hint_enable;
/* EAS */
extern int uclamp_min_for_perf_idx(int group_idx, int min_value);
extern void set_sched_rotation_enable(bool enable);
extern int set_sched_boost_type(int type);
extern int get_sched_boost_type(void);
extern int sched_set_cpuprefer(pid_t pid, unsigned int prefer_type);
/* Isolation */
extern struct cpumask __cpu_isolated_mask;
extern int sched_isolate_cpu(int cpu);
extern int sched_unisolate_cpu(int cpu);
#endif /* _EAS_CTRL_PLAT_H_ */
@@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef _IO_CTRL_H
#define _IO_CTRL_H
/*perf_ioctl*/
int init_perfctl(struct proc_dir_entry *parent);
#endif /* _IO_CTRL_H */
@@ -0,0 +1,77 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef LOAD_TRACK_H
#define LOAD_TRACK_H
#include <linux/cpumask.h>
#ifdef CONFIG_MTK_LOAD_TRACKER
/**
* DESCRIPTION:
* This function MIGHT SLEEP.
* Register a Loading Tracking callback function fn of polling
* time polling_ms. Callback function fn will be called per
* polling_ms with loading value.
* Callback function fn: loading may get -EOVERFLOW if idle/wall
* counter overflowed, otherwise loading will be between 0~100.
*
* RETURN VALUE:
* On Success zero is returned.
*
* ERRORS:
* ENOMEM Out of memory, registration fail.
* EINVAL a. Duplicated registration. reg_loading_tracking and
* unreg_loading_tracking must be paired.
* b. fn == NULL or polling_ms == 0 or load_track_init fail
* c. Function not implemented. Please check kernel config
* CONFIG_MTK_LOAD_TRACKER
*/
#define reg_loading_tracking(p_fn, polling_ms, cpu_mask) \
reg_loading_tracking_sp(p_fn, polling_ms, cpu_mask, __func__)
extern int reg_loading_tracking_sp(void (*fn)(int mask_loading, int loading),
unsigned long polling_ms, const struct cpumask *cpu_mask, const char *caller);
/**
* DESCRIPTION:
* This function MIGHT SLEEP.
* Unregister a Loading Tracking callback function fn.
* Loading Tracker will disable callback and free related memory.
* For resource saving, please make sure to call unreg_loading_tracking
* if you don't need to be informed.
*
* RETURN VALUE:
* On Success zero is returned.
*
* ERRORS:
* EINVAL a. Duplicated unregistration. reg_loading_tracking and
* unreg_loading_tracking must be paired.
* b. fn == NULL or load_track_init fail
* c. Function not implemented. Please check kernel config
* CONFIG_MTK_LOAD_TRACKER
*/
#define unreg_loading_tracking(p_fn) \
unreg_loading_tracking_sp(p_fn, __func__)
extern int unreg_loading_tracking_sp(void (*fn)(int mask_loading, int loading),
const char *caller);
#else
#define reg_loading_tracking(p_fn, polling_ms, cpu_mask) \
reg_loading_tracking_sp(p_fn, polling_ms, cpu_mask, __func__)
static inline int reg_loading_tracking_sp(void (*fn)(int mask_loading, int loading),
unsigned long polling_ms, const struct cpumask *cpu_mask, const char *caller)
{ return -EINVAL; }
#define reg_loading_tracking(p_fn, polling_ms, cpu_mask) \
reg_loading_tracking_sp(p_fn, polling_ms, cpu_mask, __func__)
static inline int unreg_loading_tracking_sp(void (*fn)(int mask_loading, int loading),
const char *caller)
{ return -EINVAL; }
#endif
#endif
@@ -0,0 +1,67 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef _MTK_PERFMGR_INTERNAL_H
#define _MTK_PERFMGR_INTERNAL_H
/* PROCFS */
#define PROC_FOPS_RW(name) \
static int perfmgr_ ## name ## _proc_open(\
struct inode *inode, struct file *file) \
{ \
return single_open(file,\
perfmgr_ ## name ## _proc_show, PDE_DATA(inode));\
} \
static const struct file_operations perfmgr_ ## name ## _proc_fops = { \
.owner = THIS_MODULE, \
.open = perfmgr_ ## name ## _proc_open, \
.read = seq_read, \
.llseek = seq_lseek,\
.release = single_release,\
.write = perfmgr_ ## name ## _proc_write,\
}
#define PROC_FOPS_RO(name) \
static int perfmgr_ ## name ## _proc_open(\
struct inode *inode, struct file *file) \
{ \
return single_open(file,\
perfmgr_ ## name ## _proc_show, PDE_DATA(inode));\
} \
static const struct file_operations perfmgr_ ## name ## _proc_fops = { \
.owner = THIS_MODULE, \
.open = perfmgr_ ## name ## _proc_open, \
.read = seq_read, \
.llseek = seq_lseek,\
.release = single_release, \
}
#define PROC_ENTRY(name) {__stringify(name), &perfmgr_ ## name ## _proc_fops}
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define for_each_perfmgr_clusters(i) \
for (i = 0; i < topo_cluster_num; i++)
#define perfmgr_clusters topo_cluster_num
#define LOG_BUF_SIZE (128)
extern int topo_cluster_num;
extern int powerhal_tid;
extern char *perfmgr_copy_from_user_for_proc(const char __user *buffer,
size_t count);
extern int check_proc_write(int *data, const char *ubuf, size_t cnt);
extern int check_group_proc_write(int *cgroup, int *data,
const char *ubuf, size_t cnt);
extern void perfmgr_trace_count(int val, const char *fmt, ...);
extern void perfmgr_trace_end(void);
extern void perfmgr_trace_begin(char *name, int id, int a, int b);
extern void perfmgr_trace_printk(char *module, char *string);
extern void perfmgr_trace_log(char *module, const char *fmt, ...);
#endif /* _MTK_PERFMGR_INTERNAL_H */
@@ -0,0 +1,16 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef SYSLIMITER_H
#define SYSLIMITER_H
#include <linux/proc_fs.h>
extern void syslimiter_update_dfrc_fps(int fps);
extern void syslimiter_update_fpsgo_state(int state);
extern int syslimiter_init(struct proc_dir_entry *parent);
extern void syslimiter_exit(void);
#endif
@@ -0,0 +1,45 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef _TCHBST_H
#define _TCHBST_H
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/string.h>
#include <linux/notifier.h>
#include <linux/hrtimer.h>
#include <linux/workqueue.h>
#include <mt-plat/cpu_ctrl.h>
#include <mt-plat/eas_ctrl.h>
#include "perf_ioctl.h"
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
/*tchbst 100 ms*/
#define TOUCH_TIMEOUT_NSEC 100000000
#define TOUCH_BOOST_EAS 80
#define TOUCH_BOOST_OPP 2
#define TOUCH_FSTB_ACTIVE_US 100000
#define TOUCH_TIME_TO_LAST_TOUCH_MS 600000
/*touch boost parent*/
int init_tchbst(struct proc_dir_entry *parent);
/*user*/
void switch_usrtch(int enable);
long usrtch_ioctl(unsigned int cmd, unsigned long arg);
int init_utch(struct proc_dir_entry *parent);
int notify_touch(int action);
/*kernel*/
int init_ktch(struct proc_dir_entry *parent);
int ktch_suspend(void);
#endif /* _TCHBST_H */
@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef TOPO_CTRL_H
#define TOPO_CTRL_H
extern int topo_ctrl_get_nr_clusters(void);
extern int topo_ctrl_get_cluster_cpu_id(int id);
#endif
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
*/
#ifndef DURASPEED_IND_H
#define DURASPEED_IND_H
#ifdef CONFIG_MTK_LOAD_TRACKER
extern int init_uload_ind(struct proc_dir_entry *parent);
#else
static inline int init_uload_ind(struct proc_dir_entry *parent)
{ return -EINVAL; }
#endif
#endif