Files
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

111 lines
3.7 KiB
C

/*
* Copyright (C) 2015 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.
*/
#ifndef __MD_SYS1_PLATFORM_H__
#define __MD_SYS1_PLATFORM_H__
#include <linux/skbuff.h>
#include "ccif_hif_platform.h"
struct ccci_clk_node {
struct clk *clk_ref;
unsigned char *clk_name;
};
struct md_pll_reg {
void __iomem *md_top_clkSW;
void __iomem *md_boot_stats_select;
void __iomem *md_boot_stats;
#ifdef CCCI_PLATFORM_MT6781
void __iomem *md_l2sram_base;
#endif
};
struct md_hw_info {
/* HW info - Register Address */
unsigned long l1_rgu_base;
unsigned long md_boot_slave_Vector;
unsigned long md_boot_slave_Key;
unsigned long md_boot_slave_En;
unsigned long ap_ccif_base;
unsigned long md_ccif_base;
unsigned int sram_size;
void __iomem *md_ccif4_base;
#ifdef CCCI_PLATFORM_MT6781
unsigned long spm_sleep_base;
#endif
/* HW info - Interrutpt ID */
unsigned int ap_ccif_irq0_id;
unsigned int ap_ccif_irq1_id;
unsigned int md_wdt_irq_id;
unsigned int ap2md_bus_timeout_irq_id;
void __iomem *md_pcore_pccif_base;
/* HW info - Interrupt flags */
unsigned long ap_ccif_irq0_flags;
unsigned long ap_ccif_irq1_flags;
unsigned long md_wdt_irq_flags;
void *hif_hw_info;
};
struct cldma_hw_info {
unsigned long cldma_ap_ao_base;
unsigned long cldma_ap_pdn_base;
unsigned int cldma_irq_id;
unsigned long cldma_irq_flags;
};
int ccci_modem_remove(struct platform_device *dev);
void ccci_modem_shutdown(struct platform_device *dev);
int ccci_modem_suspend(struct platform_device *dev, pm_message_t state);
int ccci_modem_resume(struct platform_device *dev);
int ccci_modem_pm_suspend(struct device *device);
int ccci_modem_pm_resume(struct device *device);
int ccci_modem_pm_restore_noirq(struct device *device);
int md_start_platform(struct ccci_modem *md);
int md_cd_power_on(struct ccci_modem *md);
int md_cd_power_off(struct ccci_modem *md, unsigned int timeout);
int md_cd_soft_power_off(struct ccci_modem *md, unsigned int mode);
int md_cd_soft_power_on(struct ccci_modem *md, unsigned int mode);
int md_cd_let_md_go(struct ccci_modem *md);
void md_cd_lock_cldma_clock_src(int locked);
void md_cd_lock_modem_clock_src(int locked);
int md_cd_bootup_cleanup(struct ccci_modem *md, int success);
int md_cd_low_power_notify(struct ccci_modem *md,
enum LOW_POEWR_NOTIFY_TYPE type, int level);
int md_cd_get_modem_hw_info(struct platform_device *dev_ptr,
struct ccci_dev_cfg *dev_cfg, struct md_hw_info *hw_info);
int md_cd_io_remap_md_side_register(struct ccci_modem *md);
void md_cd_dump_debug_register(struct ccci_modem *md);
void md_cd_dump_md_bootup_status(struct ccci_modem *md);
void md_cd_get_md_bootup_status(struct ccci_modem *md,
unsigned int *buff, int length);
void md_cd_check_emi_state(struct ccci_modem *md, int polling);
void md_cldma_hw_reset(unsigned char md_id);
int md_cd_pccif_send(struct ccci_modem *md, int channel_id);
void md_cd_dump_pccif_reg(struct ccci_modem *md);
/* ADD_SYS_CORE */
int ccci_modem_syssuspend(void);
void ccci_modem_sysresume(void);
void ccci_set_clk_by_id(int id, unsigned int on);
extern unsigned long infra_ao_base;
extern unsigned int devapc_check_flag;
extern void ccci_mem_dump(int md_id, void *start_addr, int len);
extern void dump_emi_outstanding(void);
extern void ccif_set_irq_on_poweron(unsigned char hif_id);
extern void ccif_set_irq_on_poweroff(unsigned char hif_id);
#endif /* __MD_SYS1_PLATFORM_H__ */