drivers/net/wwan/iosm/iosm_ipc_mmio.h

Source file repositories/reference/linux-study-clean/drivers/net/wwan/iosm/iosm_ipc_mmio.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wwan/iosm/iosm_ipc_mmio.h
Extension
.h
Size
4983 bytes
Lines
184
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source 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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct mmio_offset {
	int exec_stage;
	int chip_info;
	int rom_exit_code;
	int psi_address;
	int psi_size;
	int ipc_status;
	int context_info;
	int ap_win_base;
	int ap_win_end;
	int cp_version;
	int cp_capability;
};

/**
 * struct iosm_mmio - MMIO region mapped to the doorbell scratchpad.
 * @base:		Base address of MMIO region
 * @dev:		Pointer to device structure
 * @offset:		Start offset
 * @context_info_addr:	Physical base address of context info structure
 * @chip_info_version:	Version of chip info structure
 * @chip_info_size:	Size of chip info structure
 * @mux_protocol:	mux protocol
 * @has_ul_flow_credit:	Ul flow credit support
 * @has_slp_no_prot:	Device sleep no protocol support
 * @has_mcr_support:	Usage of mcr support
 */
struct iosm_mmio {
	unsigned char __iomem *base;
	struct device *dev;
	struct mmio_offset offset;
	phys_addr_t context_info_addr;
	unsigned int chip_info_version;
	unsigned int chip_info_size;
	u32 mux_protocol;
	u8 has_ul_flow_credit:1,
	   has_slp_no_prot:1,
	   has_mcr_support:1;
};

/**
 * ipc_mmio_init - Allocate mmio instance data
 * @mmio_addr:	Mapped AP base address of the MMIO area.
 * @dev:	Pointer to device structure
 *
 * Returns: address of mmio instance data or NULL if fails.
 */
struct iosm_mmio *ipc_mmio_init(void __iomem *mmio_addr, struct device *dev);

/**
 * ipc_mmio_set_psi_addr_and_size - Set start address and size of the
 *				    primary system image (PSI) for the
 *				    FW dowload.
 * @ipc_mmio:	Pointer to mmio instance
 * @addr:	PSI address
 * @size:	PSI immage size
 */
void ipc_mmio_set_psi_addr_and_size(struct iosm_mmio *ipc_mmio, dma_addr_t addr,
				    u32 size);

/**
 * ipc_mmio_set_contex_info_addr - Stores the Context Info Address in
 *				   MMIO instance to share it with CP during
 *				   mmio_init.
 * @ipc_mmio:	Pointer to mmio instance
 * @addr:	64-bit address of AP context information.
 */
void ipc_mmio_set_contex_info_addr(struct iosm_mmio *ipc_mmio,
				   phys_addr_t addr);

/**
 * ipc_mmio_get_cp_version - Get the CP IPC version
 * @ipc_mmio:	Pointer to mmio instance
 *
 * Returns: version number on success and failure value on error.
 */
int ipc_mmio_get_cp_version(struct iosm_mmio *ipc_mmio);

/**
 * ipc_mmio_get_rom_exit_code - Get exit code from CP boot rom download app
 * @ipc_mmio:	Pointer to mmio instance
 *
 * Returns: exit code from CP boot rom download APP
 */
enum rom_exit_code ipc_mmio_get_rom_exit_code(struct iosm_mmio *ipc_mmio);

/**
 * ipc_mmio_get_exec_stage - Query CP execution stage
 * @ipc_mmio:	Pointer to mmio instance
 *

Annotation

Implementation Notes