Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * TI Wakeup M3 for AMx3 SoCs Power Management Routines
0004  *
0005  * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
0006  * Dave Gerlach <d-gerlach@ti.com>
0007  */
0008 
0009 #ifndef _LINUX_WKUP_M3_IPC_H
0010 #define _LINUX_WKUP_M3_IPC_H
0011 
0012 #define WKUP_M3_DEEPSLEEP   1
0013 #define WKUP_M3_STANDBY     2
0014 #define WKUP_M3_IDLE        3
0015 
0016 #include <linux/mailbox_client.h>
0017 
0018 struct wkup_m3_ipc_ops;
0019 
0020 struct wkup_m3_ipc {
0021     struct rproc *rproc;
0022 
0023     void __iomem *ipc_mem_base;
0024     struct device *dev;
0025 
0026     int mem_type;
0027     unsigned long resume_addr;
0028     int vtt_conf;
0029     int isolation_conf;
0030     int state;
0031     u32 halt;
0032 
0033     unsigned long volt_scale_offsets;
0034     const char *sd_fw_name;
0035 
0036     struct completion sync_complete;
0037     struct mbox_client mbox_client;
0038     struct mbox_chan *mbox;
0039 
0040     struct wkup_m3_ipc_ops *ops;
0041     int is_rtc_only;
0042     struct dentry *dbg_path;
0043 };
0044 
0045 struct wkup_m3_wakeup_src {
0046     int irq_nr;
0047     char src[10];
0048 };
0049 
0050 struct wkup_m3_scale_data_header {
0051     u16 magic;
0052     u8 sleep_offset;
0053     u8 wake_offset;
0054 } __packed;
0055 
0056 struct wkup_m3_ipc_ops {
0057     void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
0058     void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
0059     int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
0060     int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
0061     int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
0062     const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc);
0063     void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
0064 };
0065 
0066 struct wkup_m3_ipc *wkup_m3_ipc_get(void);
0067 void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
0068 void wkup_m3_set_rtc_only_mode(void);
0069 #endif /* _LINUX_WKUP_M3_IPC_H */