remoteproc: pru: Add support for PRU specific interrupt configuration
authorGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Tue, 8 Dec 2020 14:09:59 +0000 (15:09 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 10 Dec 2020 16:56:01 +0000 (10:56 -0600)
commitc75c9fdac66efd8b54773368254ef330c276171b
tree14f0c062ad6132c368e9cc6d1574cb839657da78
parentd4ce2de7e4af8b978eb816784d0eafc220336d52
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>
drivers/remoteproc/pru_rproc.c
drivers/remoteproc/pru_rproc.h [new file with mode: 0644]