You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
soc: ti: Add wkup_m3_ipc driver
Introduce a wkup_m3_ipc driver to handle communication between the MPU and Cortex M3 wkup_m3 present on am335x. This driver is responsible for actually booting the wkup_m3_rproc and also handling all IPC which is done using the IPC registers in the control module, a mailbox, and a separate interrupt back from the wkup_m3. A small API is exposed for executing specific power commands, which include configuring for low power mode, request a transition to a low power mode, and status info on a previous transition. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
committed by
Tony Lindgren
parent
fe9b867d24
commit
cdd5de500b
@@ -28,4 +28,14 @@ config KEYSTONE_NAVIGATOR_DMA
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config WKUP_M3_IPC
|
||||
tristate "TI AMx3 Wkup-M3 IPC Driver"
|
||||
depends on WKUP_M3_RPROC
|
||||
depends on OMAP2PLUS_MBOX
|
||||
help
|
||||
TI AM33XX and AM43XX have a Cortex M3, the Wakeup M3, to handle
|
||||
low power transitions. This IPC driver provides the necessary API
|
||||
to communicate and use the Wakeup M3 for PM features like suspend
|
||||
resume and boots it using wkup_m3_rproc driver.
|
||||
|
||||
endif # SOC_TI
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
obj-$(CONFIG_KEYSTONE_NAVIGATOR_QMSS) += knav_qmss.o
|
||||
knav_qmss-y := knav_qmss_queue.o knav_qmss_acc.o
|
||||
obj-$(CONFIG_KEYSTONE_NAVIGATOR_DMA) += knav_dma.o
|
||||
obj-$(CONFIG_WKUP_M3_IPC) += wkup_m3_ipc.o
|
||||
|
||||
508
drivers/soc/ti/wkup_m3_ipc.c
Normal file
508
drivers/soc/ti/wkup_m3_ipc.c
Normal file
File diff suppressed because it is too large
Load Diff
55
include/linux/wkup_m3_ipc.h
Normal file
55
include/linux/wkup_m3_ipc.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* TI Wakeup M3 for AMx3 SoCs Power Management Routines
|
||||
*
|
||||
* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
|
||||
* Dave Gerlach <d-gerlach@ti.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation version 2.
|
||||
*
|
||||
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
|
||||
* kind, whether express or implied; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#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;
|
||||
int state;
|
||||
|
||||
struct completion sync_complete;
|
||||
struct mbox_client mbox_client;
|
||||
struct mbox_chan *mbox;
|
||||
|
||||
struct wkup_m3_ipc_ops *ops;
|
||||
};
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
struct wkup_m3_ipc *wkup_m3_ipc_get(void);
|
||||
void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
|
||||
#endif /* _LINUX_WKUP_M3_IPC_H */
|
||||
Reference in New Issue
Block a user