drivers/gpu/drm/imagination/pvr_fw.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imagination/pvr_fw.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/imagination/pvr_fw.h
Extension
.h
Size
14049 bytes
Lines
500
Domain
Driver Families
Bucket
drivers/gpu
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 pvr_fw_object {
	/** @ref_count: FW object reference counter. */
	struct kref ref_count;

	/** @gem: GEM object backing the FW object. */
	struct pvr_gem_object *gem;

	/**
	 * @fw_mm_node: Node representing mapping in FW address space. @pvr_obj->lock must
	 *              be held when writing.
	 */
	struct drm_mm_node fw_mm_node;

	/**
	 * @fw_addr_offset: Virtual address offset of firmware mapping. Only
	 *                  valid if @flags has %PVR_GEM_OBJECT_FLAGS_FW_MAPPED
	 *                  set.
	 */
	u32 fw_addr_offset;

	/**
	 * @init: Initialisation callback. Will be called on object creation and FW hard reset.
	 *        Object will have been zeroed before this is called.
	 */
	void (*init)(void *cpu_ptr, void *priv);

	/** @init_priv: Private data for initialisation callback. */
	void *init_priv;

	/** @node: Node for firmware object list. */
	struct list_head node;
};

/**
 * struct pvr_fw_defs - FW processor function table and static definitions
 */
struct pvr_fw_defs {
	/**
	 * @init:
	 *
	 * FW processor specific initialisation.
	 * @pvr_dev: Target PowerVR device.
	 *
	 * This function must call pvr_fw_heap_calculate() to initialise the firmware heap for this
	 * FW processor.
	 *
	 * This function is mandatory.
	 *
	 * Returns:
	 *  * 0 on success, or
	 *  * Any appropriate error on failure.
	 */
	int (*init)(struct pvr_device *pvr_dev);

	/**
	 * @fini:
	 *
	 * FW processor specific finalisation.
	 * @pvr_dev: Target PowerVR device.
	 *
	 * This function is optional.
	 */
	void (*fini)(struct pvr_device *pvr_dev);

	/**
	 * @fw_process:
	 *
	 * Load and process firmware image.
	 * @pvr_dev: Target PowerVR device.
	 * @fw: Pointer to firmware image.
	 * @fw_code_ptr: Pointer to firmware code section.
	 * @fw_data_ptr: Pointer to firmware data section.
	 * @fw_core_code_ptr: Pointer to firmware core code section. May be %NULL.
	 * @fw_core_data_ptr: Pointer to firmware core data section. May be %NULL.
	 * @core_code_alloc_size: Total allocation size of core code section.
	 *
	 * This function is mandatory.
	 *
	 * Returns:
	 *  * 0 on success, or
	 *  * Any appropriate error on failure.
	 */
	int (*fw_process)(struct pvr_device *pvr_dev, const u8 *fw,
			  u8 *fw_code_ptr, u8 *fw_data_ptr, u8 *fw_core_code_ptr,
			  u8 *fw_core_data_ptr, u32 core_code_alloc_size);

	/**
	 * @vm_map:
	 *
	 * Map FW object into FW processor address space.

Annotation

Implementation Notes