drivers/accel/ethosu/ethosu_device.h

Source file repositories/reference/linux-study-clean/drivers/accel/ethosu/ethosu_device.h

File Facts

System
Linux kernel
Corpus path
drivers/accel/ethosu/ethosu_device.h
Extension
.h
Size
5421 bytes
Lines
198
Domain
Driver Families
Bucket
drivers/accel
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 ethosu_device {
	/** @base: Base drm_device. */
	struct drm_device base;

	/** @iomem: CPU mapping of the registers. */
	void __iomem *regs;

	void __iomem *sram;
	struct gen_pool *srampool;
	dma_addr_t sramphys;

	struct clk_bulk_data *clks;
	int num_clks;
	int irq;

	struct drm_ethosu_npu_info npu_info;

	struct ethosu_job *in_flight_job;
	/* For in_flight_job and ethosu_job_hw_submit() */
	struct mutex job_lock;

	/* For dma_fence */
	spinlock_t fence_lock;

	struct drm_gpu_scheduler sched;
	/* For ethosu_job_do_push() */
	struct mutex sched_lock;
	u64 fence_context;
	u64 emit_seqno;
};

#define to_ethosu_device(drm_dev) \
	((struct ethosu_device *)container_of(drm_dev, struct ethosu_device, base))

static inline bool ethosu_is_u65(const struct ethosu_device *ethosudev)
{
	return FIELD_GET(ID_ARCH_MAJOR_MASK, ethosudev->npu_info.id) == 1;
}

#endif

Annotation

Implementation Notes