drivers/soc/ti/wkup_m3_ipc.c
Source file repositories/reference/linux-study-clean/drivers/soc/ti/wkup_m3_ipc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/ti/wkup_m3_ipc.c- Extension
.c- Size
- 18648 bytes
- Lines
- 769
- Domain
- Driver Families
- Bucket
- drivers/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/err.hlinux/firmware.hlinux/kernel.hlinux/kthread.hlinux/interrupt.hlinux/irq.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/remoteproc.hlinux/suspend.hlinux/wkup_m3_ipc.h
Detected Declarations
function wkup_m3_copy_aux_datafunction wkup_m3_scale_data_fw_cbfunction wkup_m3_init_scale_datafunction wkup_m3_set_halt_latefunction option_getfunction option_setfunction wkup_m3_ipc_dbg_initfunction wkup_m3_ipc_dbg_destroyfunction wkup_m3_ipc_dbg_initfunction wkup_m3_ipc_dbg_destroyfunction am33xx_txev_enablefunction wkup_m3_ctrl_ipc_writefunction wkup_m3_ctrl_ipc_readfunction wkup_m3_fw_version_readfunction wkup_m3_txev_handlerfunction wkup_m3_pingfunction wkup_m3_ping_noirqfunction wkup_m3_is_availablefunction wkup_m3_set_vtt_gpiofunction wkup_m3_set_io_isolationfunction wkup_m3_set_mem_typefunction wkup_m3_set_resume_addressfunction wkup_m3_request_pm_statusfunction wkup_m3_prepare_low_powerfunction wkup_m3_finish_low_powerfunction wkup_m3_set_rtc_onlyfunction wkup_m3_ipc_putfunction wkup_m3_rproc_boot_threadfunction wkup_m3_ipc_probefunction wkup_m3_ipc_removefunction wkup_m3_ipc_suspendfunction wkup_m3_ipc_resumeexport wkup_m3_ipc_getexport wkup_m3_ipc_put
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* AMx3 Wkup M3 IPC driver
*
* Copyright (C) 2015 Texas Instruments, Inc.
*
* Dave Gerlach <d-gerlach@ti.com>
*/
#include <linux/debugfs.h>
#include <linux/err.h>
#include <linux/firmware.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/remoteproc.h>
#include <linux/suspend.h>
#include <linux/wkup_m3_ipc.h>
#define AM33XX_CTRL_IPC_REG_COUNT 0x8
#define AM33XX_CTRL_IPC_REG_OFFSET(m) (0x4 + 4 * (m))
/* AM33XX M3_TXEV_EOI register */
#define AM33XX_CONTROL_M3_TXEV_EOI 0x00
#define AM33XX_M3_TXEV_ACK (0x1 << 0)
#define AM33XX_M3_TXEV_ENABLE (0x0 << 0)
#define IPC_CMD_DS0 0x4
#define IPC_CMD_STANDBY 0xc
#define IPC_CMD_IDLE 0x10
#define IPC_CMD_RESET 0xe
#define DS_IPC_DEFAULT 0xffffffff
#define M3_VERSION_UNKNOWN 0x0000ffff
#define M3_BASELINE_VERSION 0x191
#define M3_STATUS_RESP_MASK (0xffff << 16)
#define M3_FW_VERSION_MASK 0xffff
#define M3_WAKE_SRC_MASK 0xff
#define IPC_MEM_TYPE_SHIFT (0x0)
#define IPC_MEM_TYPE_MASK (0x7 << 0)
#define IPC_VTT_STAT_SHIFT (0x3)
#define IPC_VTT_STAT_MASK (0x1 << 3)
#define IPC_VTT_GPIO_PIN_SHIFT (0x4)
#define IPC_VTT_GPIO_PIN_MASK (0x3f << 4)
#define IPC_IO_ISOLATION_STAT_SHIFT (10)
#define IPC_IO_ISOLATION_STAT_MASK (0x1 << 10)
#define IPC_DBG_HALT_SHIFT (11)
#define IPC_DBG_HALT_MASK (0x1 << 11)
#define M3_STATE_UNKNOWN 0
#define M3_STATE_RESET 1
#define M3_STATE_INITED 2
#define M3_STATE_MSG_FOR_LP 3
#define M3_STATE_MSG_FOR_RESET 4
#define WKUP_M3_SD_FW_MAGIC 0x570C
#define WKUP_M3_DMEM_START 0x80000
#define WKUP_M3_AUXDATA_OFFSET 0x1000
#define WKUP_M3_AUXDATA_SIZE 0xFF
static struct wkup_m3_ipc *m3_ipc_state;
static const struct wkup_m3_wakeup_src wakeups[] = {
{.irq_nr = 16, .src = "PRCM"},
{.irq_nr = 35, .src = "USB0_PHY"},
{.irq_nr = 36, .src = "USB1_PHY"},
{.irq_nr = 40, .src = "I2C0"},
{.irq_nr = 41, .src = "RTC Timer"},
{.irq_nr = 42, .src = "RTC Alarm"},
{.irq_nr = 43, .src = "Timer0"},
{.irq_nr = 44, .src = "Timer1"},
{.irq_nr = 45, .src = "UART"},
{.irq_nr = 46, .src = "GPIO0"},
{.irq_nr = 48, .src = "MPU_WAKE"},
{.irq_nr = 49, .src = "WDT0"},
{.irq_nr = 50, .src = "WDT1"},
{.irq_nr = 51, .src = "ADC_TSC"},
{.irq_nr = 0, .src = "Unknown"},
};
/**
* wkup_m3_copy_aux_data - Copy auxiliary data to special region of m3 dmem
* @data - pointer to data
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/err.h`, `linux/firmware.h`, `linux/kernel.h`, `linux/kthread.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/module.h`.
- Detected declarations: `function wkup_m3_copy_aux_data`, `function wkup_m3_scale_data_fw_cb`, `function wkup_m3_init_scale_data`, `function wkup_m3_set_halt_late`, `function option_get`, `function option_set`, `function wkup_m3_ipc_dbg_init`, `function wkup_m3_ipc_dbg_destroy`, `function wkup_m3_ipc_dbg_init`, `function wkup_m3_ipc_dbg_destroy`.
- Atlas domain: Driver Families / drivers/soc.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.