162306a36Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * PRUSS Remote Processor specific types
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2014-2020 Texas Instruments Incorporated - https://www.ti.com/
662306a36Sopenharmony_ci *	Suman Anna <s-anna@ti.com>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef _PRU_RPROC_H_
1062306a36Sopenharmony_ci#define _PRU_RPROC_H_
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci/**
1362306a36Sopenharmony_ci * struct pruss_int_map - PRU system events _to_ channel and host mapping
1462306a36Sopenharmony_ci * @event: number of the system event
1562306a36Sopenharmony_ci * @chnl: channel number assigned to a given @event
1662306a36Sopenharmony_ci * @host: host number assigned to a given @chnl
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci * PRU system events are mapped to channels, and these channels are mapped
1962306a36Sopenharmony_ci * to host interrupts. Events can be mapped to channels in a one-to-one or
2062306a36Sopenharmony_ci * many-to-one ratio (multiple events per channel), and channels can be
2162306a36Sopenharmony_ci * mapped to host interrupts in a one-to-one or many-to-one ratio (multiple
2262306a36Sopenharmony_ci * channels per interrupt).
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_cistruct pruss_int_map {
2562306a36Sopenharmony_ci	u8 event;
2662306a36Sopenharmony_ci	u8 chnl;
2762306a36Sopenharmony_ci	u8 host;
2862306a36Sopenharmony_ci};
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/**
3162306a36Sopenharmony_ci * struct pru_irq_rsc - PRU firmware section header for IRQ data
3262306a36Sopenharmony_ci * @type: resource type
3362306a36Sopenharmony_ci * @num_evts: number of described events
3462306a36Sopenharmony_ci * @pru_intc_map: PRU interrupt routing description
3562306a36Sopenharmony_ci *
3662306a36Sopenharmony_ci * The PRU firmware blob can contain optional .pru_irq_map ELF section, which
3762306a36Sopenharmony_ci * provides the PRUSS interrupt mapping description. The pru_irq_rsc struct
3862306a36Sopenharmony_ci * describes resource entry format.
3962306a36Sopenharmony_ci */
4062306a36Sopenharmony_cistruct pru_irq_rsc {
4162306a36Sopenharmony_ci	u8 type;
4262306a36Sopenharmony_ci	u8 num_evts;
4362306a36Sopenharmony_ci	struct pruss_int_map pru_intc_map[];
4462306a36Sopenharmony_ci} __packed;
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#endif	/* _PRU_RPROC_H_ */
47