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

+46
View File
@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2019 MediaTek Inc.
* Author: Anthony Huang <anthony.huang@mediatek.com>
*/
#ifndef MTK_MMQOS_H
#define MTK_MMQOS_H
enum hrt_type {
HRT_MD,
HRT_CAM,
HRT_DISP,
HRT_TYPE_NUM
};
enum {
BW_THROTTLE_START = 1,
BW_THROTTLE_START_RECOVER,
BW_THROTTLE_END
};
#if IS_ENABLED(CONFIG_INTERCONNECT_MTK_MMQOS_COMMON)
void mtk_mmqos_wait_throttle_done(void);
s32 mtk_mmqos_set_hrt_bw(enum hrt_type type, u32 bw);
s32 mtk_mmqos_get_avail_hrt_bw(enum hrt_type type);
s32 mtk_mmqos_register_bw_throttle_notifier(struct notifier_block *nb);
s32 mtk_mmqos_unregister_bw_throttle_notifier(struct notifier_block *nb);
#else
static inline void
mtk_mmqos_wait_throttle_done(void) { return; }
static inline s32
mtk_mmqos_set_hrt_bw(enum hrt_type type, u32 bw) { return 0; }
static inline s32
mtk_mmqos_get_avail_hrt_bw(enum hrt_type type) { return -1; }
static inline s32
mtk_mmqos_register_bw_throttle_notifier(struct notifier_block *nb) { return 0; }
static inline s32
mtk_mmqos_unregister_bw_throttle_notifier(struct notifier_block *nb)
{ return 0; }
#endif
#endif /* MTK_MMQOS_H */
+80
View File
@@ -0,0 +1,80 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2020 MediaTek Inc.
*/
#ifndef MTK_IOMMU_SMI_H
#define MTK_IOMMU_SMI_H
#include <linux/bitops.h>
#include <linux/device.h>
#ifdef CONFIG_MTK_SMI
#define MTK_LARB_NR_MAX 32
#define MTK_SMI_MMU_EN(port) BIT(port)
#define RESET_CELL_NUM (2)
#define MAX_LARB_FOR_CLAMP (6)
#define MAX_COMMON_FOR_CLAMP (3)
struct mtk_smi_larb_iommu {
struct device *dev;
unsigned int mmu;
};
struct mtk_smi_iommu {
unsigned int larb_nr;
struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
};
#endif
#if IS_ENABLED(CONFIG_MTK_SMI_EXT)
#include <linux/platform_device.h>
struct mtk_smi_pair {
u32 off;
u32 val;
};
struct mtk_smi_dev {
u32 id;
struct device *dev;
void __iomem *base;
u32 *mmu;
u32 nr_clks;
struct clk **clks;
atomic_t clk_cnts;
u32 nr_conf_pairs;
struct mtk_smi_pair *conf_pairs;
u32 nr_scen_pairs;
struct mtk_smi_pair **scen_pairs;
u32 power_reset_pa[MAX_LARB_FOR_CLAMP];
void __iomem *power_reset_reg[MAX_LARB_FOR_CLAMP];
u32 power_reset_value[MAX_LARB_FOR_CLAMP];
u32 comm_reset_pa[MAX_LARB_FOR_CLAMP];
void __iomem *comm_reset_reg[MAX_LARB_FOR_CLAMP];
u32 comm_reset_value[MAX_LARB_FOR_CLAMP];
bool comm_reset;
bool comm_clamp_enable;
u32 comm_clamp_value[MAX_LARB_FOR_CLAMP];
};
s32 mtk_smi_clk_enable(struct mtk_smi_dev *smi);
void mtk_smi_clk_disable(struct mtk_smi_dev *smi);
struct mtk_smi_dev *mtk_smi_dev_get(const u32 id);
s32 mtk_smi_conf_set(const struct mtk_smi_dev *smi, const u32 scen_id);
s32 smi_register(void);
s32 smi_get_dev_num(void);
s32 smi_larb_port_check(void);
#endif
#endif