2022-06-07 22:11:13 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-09-23 08:14:54 +08:00
|
|
|
/*
|
|
|
|
* TI Wakeup M3 for AMx3 SoCs Power Management Routines
|
|
|
|
*
|
2020-08-12 09:34:19 +08:00
|
|
|
* Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
|
2015-09-23 08:14:54 +08:00
|
|
|
* Dave Gerlach <d-gerlach@ti.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_WKUP_M3_IPC_H
|
|
|
|
#define _LINUX_WKUP_M3_IPC_H
|
|
|
|
|
|
|
|
#define WKUP_M3_DEEPSLEEP 1
|
|
|
|
#define WKUP_M3_STANDBY 2
|
|
|
|
#define WKUP_M3_IDLE 3
|
|
|
|
|
|
|
|
#include <linux/mailbox_client.h>
|
|
|
|
|
|
|
|
struct wkup_m3_ipc_ops;
|
|
|
|
|
|
|
|
struct wkup_m3_ipc {
|
|
|
|
struct rproc *rproc;
|
|
|
|
|
|
|
|
void __iomem *ipc_mem_base;
|
|
|
|
struct device *dev;
|
|
|
|
|
|
|
|
int mem_type;
|
|
|
|
unsigned long resume_addr;
|
2022-04-10 05:12:15 +08:00
|
|
|
int vtt_conf;
|
2022-04-15 03:27:24 +08:00
|
|
|
int isolation_conf;
|
2015-09-23 08:14:54 +08:00
|
|
|
int state;
|
2022-05-02 11:32:12 +08:00
|
|
|
u32 halt;
|
2015-09-23 08:14:54 +08:00
|
|
|
|
2022-04-27 04:07:44 +08:00
|
|
|
unsigned long volt_scale_offsets;
|
|
|
|
const char *sd_fw_name;
|
|
|
|
|
2015-09-23 08:14:54 +08:00
|
|
|
struct completion sync_complete;
|
|
|
|
struct mbox_client mbox_client;
|
|
|
|
struct mbox_chan *mbox;
|
|
|
|
|
|
|
|
struct wkup_m3_ipc_ops *ops;
|
2018-07-05 11:19:06 +08:00
|
|
|
int is_rtc_only;
|
2022-05-02 11:32:12 +08:00
|
|
|
struct dentry *dbg_path;
|
2015-09-23 08:14:54 +08:00
|
|
|
};
|
|
|
|
|
2018-07-05 11:19:06 +08:00
|
|
|
struct wkup_m3_wakeup_src {
|
|
|
|
int irq_nr;
|
|
|
|
char src[10];
|
|
|
|
};
|
|
|
|
|
2022-04-27 04:07:44 +08:00
|
|
|
struct wkup_m3_scale_data_header {
|
|
|
|
u16 magic;
|
|
|
|
u8 sleep_offset;
|
|
|
|
u8 wake_offset;
|
|
|
|
} __packed;
|
|
|
|
|
2015-09-23 08:14:54 +08:00
|
|
|
struct wkup_m3_ipc_ops {
|
|
|
|
void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
|
|
|
|
void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
|
|
|
|
int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
|
|
|
|
int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
|
|
|
|
int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
|
2018-07-05 11:19:06 +08:00
|
|
|
const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc);
|
2018-07-05 11:19:06 +08:00
|
|
|
void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
|
2015-09-23 08:14:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wkup_m3_ipc *wkup_m3_ipc_get(void);
|
|
|
|
void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
|
2018-07-05 11:19:06 +08:00
|
|
|
void wkup_m3_set_rtc_only_mode(void);
|
2015-09-23 08:14:54 +08:00
|
|
|
#endif /* _LINUX_WKUP_M3_IPC_H */
|