drivers/gpu/drm/imagination/pvr_rogue_fwif.h

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

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/imagination/pvr_rogue_fwif.h
Extension
.h
Size
70972 bytes
Lines
2193
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 rogue_fwif_log_group_map_entry {
	const char *log_group_name;
	u32 log_group_type;
};

/*
 ****************************************************************************
 * ROGUE FW signature checks
 ****************************************************************************
 */
#define ROGUE_FW_SIG_BUFFER_SIZE_MIN (8192)

#define ROGUE_FWIF_TIMEDIFF_ID ((0x1UL << 28) | ROGUE_CR_TIMER)

/*
 ****************************************************************************
 * Trace Buffer
 ****************************************************************************
 */

/* Default size of ROGUE_FWIF_TRACEBUF_SPACE in DWords */
#define ROGUE_FW_TRACE_BUF_DEFAULT_SIZE_IN_DWORDS 12000U
#define ROGUE_FW_TRACE_BUFFER_ASSERT_SIZE 200U
#define ROGUE_FW_THREAD_NUM 1U
#define ROGUE_FW_THREAD_MAX 2U

#define ROGUE_FW_POLL_TYPE_SET 0x80000000U

struct rogue_fwif_file_info_buf {
	char path[ROGUE_FW_TRACE_BUFFER_ASSERT_SIZE];
	char info[ROGUE_FW_TRACE_BUFFER_ASSERT_SIZE];
	u32 line_num;
	u32 padding;
} __aligned(8);

struct rogue_fwif_tracebuf_space {
	u32 trace_pointer;

	u32 trace_buffer_fw_addr;

	/* To be used by host when reading from trace buffer */
	u32 *trace_buffer;

	struct rogue_fwif_file_info_buf assert_buf;
} __aligned(8);

/* Total number of FW fault logs stored */
#define ROGUE_FWIF_FWFAULTINFO_MAX (8U)

struct rogue_fw_fault_info {
	aligned_u64 cr_timer;
	aligned_u64 os_timer;

	u32 data __aligned(8);
	u32 reserved;
	struct rogue_fwif_file_info_buf fault_buf;
} __aligned(8);

enum rogue_fwif_pow_state {
	ROGUE_FWIF_POW_OFF, /* idle and ready to full power down */
	ROGUE_FWIF_POW_ON, /* running HW commands */
	ROGUE_FWIF_POW_FORCED_IDLE, /* forced idle */
	ROGUE_FWIF_POW_IDLE, /* idle waiting for host handshake */
};

/* Firmware HWR states */
/* The HW state is ok or locked up */
#define ROGUE_FWIF_HWR_HARDWARE_OK BIT(0)
/* Tells if a HWR reset is in progress */
#define ROGUE_FWIF_HWR_RESET_IN_PROGRESS BIT(1)
/* A DM unrelated lockup has been detected */
#define ROGUE_FWIF_HWR_GENERAL_LOCKUP BIT(3)
/* At least one DM is running without being close to a lockup */
#define ROGUE_FWIF_HWR_DM_RUNNING_OK BIT(4)
/* At least one DM is close to lockup */
#define ROGUE_FWIF_HWR_DM_STALLING BIT(5)
/* The FW has faulted and needs to restart */
#define ROGUE_FWIF_HWR_FW_FAULT BIT(6)
/* The FW has requested the host to restart it */
#define ROGUE_FWIF_HWR_RESTART_REQUESTED BIT(7)

#define ROGUE_FWIF_PHR_STATE_SHIFT (8U)
/* The FW has requested the host to restart it, per PHR configuration */
#define ROGUE_FWIF_PHR_RESTART_REQUESTED ((1) << ROGUE_FWIF_PHR_STATE_SHIFT)
/* A PHR triggered GPU reset has just finished */
#define ROGUE_FWIF_PHR_RESTART_FINISHED ((2) << ROGUE_FWIF_PHR_STATE_SHIFT)
#define ROGUE_FWIF_PHR_RESTART_MASK \
	(ROGUE_FWIF_PHR_RESTART_REQUESTED | ROGUE_FWIF_PHR_RESTART_FINISHED)

#define ROGUE_FWIF_PHR_MODE_OFF (0UL)

Annotation

Implementation Notes