linux/drivers/remoteproc/pru_rproc.h
Grzegorz Jaszczyk c75c9fdac6 remoteproc: pru: Add support for PRU specific interrupt configuration
The firmware blob can contain optional ELF sections: .resource_table
section and .pru_irq_map one. The second one contains the PRUSS
interrupt mapping description, which needs to be setup before powering
on the PRU core. To avoid RAM wastage this ELF section is not mapped to
any ELF segment (by the firmware linker) and therefore is not loaded to
PRU memory.

The PRU interrupt configuration is handled within the PRUSS INTC irqchip
driver and leverages the system events to interrupt channels and host
interrupts mapping configuration. Relevant irq routing information is
passed through a special .pru_irq_map ELF section (for interrupts routed
to and used by PRU cores) or via the PRU application's device tree node
(for interrupts routed to and used by the main CPU). The mappings are
currently programmed during the booting/shutdown of the PRU.

The interrupt configuration passed through .pru_irq_map ELF section is
optional. It varies on specific firmware functionality and therefore
have to be unwinded during PRU stop and performed again during
PRU start.

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Co-developed-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Link: https://lore.kernel.org/r/20201208141002.17777-4-grzegorz.jaszczyk@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2020-12-10 10:56:01 -06:00

47 lines
1.3 KiB
C

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/*
* PRUSS Remote Processor specific types
*
* Copyright (C) 2014-2020 Texas Instruments Incorporated - https://www.ti.com/
* Suman Anna <s-anna@ti.com>
*/
#ifndef _PRU_RPROC_H_
#define _PRU_RPROC_H_
/**
* struct pruss_int_map - PRU system events _to_ channel and host mapping
* @event: number of the system event
* @chnl: channel number assigned to a given @event
* @host: host number assigned to a given @chnl
*
* PRU system events are mapped to channels, and these channels are mapped
* to host interrupts. Events can be mapped to channels in a one-to-one or
* many-to-one ratio (multiple events per channel), and channels can be
* mapped to host interrupts in a one-to-one or many-to-one ratio (multiple
* channels per interrupt).
*/
struct pruss_int_map {
u8 event;
u8 chnl;
u8 host;
};
/**
* struct pru_irq_rsc - PRU firmware section header for IRQ data
* @type: resource type
* @num_evts: number of described events
* @pru_intc_map: PRU interrupt routing description
*
* The PRU firmware blob can contain optional .pru_irq_map ELF section, which
* provides the PRUSS interrupt mapping description. The pru_irq_rsc struct
* describes resource entry format.
*/
struct pru_irq_rsc {
u8 type;
u8 num_evts;
struct pruss_int_map pru_intc_map[];
} __packed;
#endif /* _PRU_RPROC_H_ */