Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Feb 14, 2023
    • Hari Nagalla's avatar
      remoteproc: k3-m4: extend stop to send shutdown message to m4 core · 99cff963
      Hari Nagalla authored
      
      This patch adds support for graceful shutdown of the K3 M4F remoteproc
      driver on a stop command. On K3 SoCs, the remote processor needs to be
      in a quiescent state, before a reset is asserted by the remoteproc
      driver. This patch introduces a mailbox handshake mechanism between the
      MPU and the remote processor to allow the remote processor to gracefully
      shutdown its peripheral drivers and applications before entering a
      quiescent state, which is typically entering 'wfi' with interrupts
      disabled.
      
      Signed-off-by: default avatarHari Nagalla <hnagalla@ti.com>
      99cff963
    • Hari Nagalla's avatar
      remoteproc/omap: Add support for graceful shutdown · 36d6485f
      Hari Nagalla authored
      
      This patch adds support for graceful shutdown of the TI remoteproc
      driver on a stop command. On some TI SoCs, the remote processor
      (ex: M4F on AM64/AM62 SoCs) needs to be in quiescent state, before a
      reset is asserted. This patch introduces a mailbox handshake mechanism
      between the MPU and the remote processor to allow the remote processor
      to gracefully shutdown its peripherals and enter a quiescent state.
      
      Signed-off-by: default avatarHari Nagalla <hnagalla@ti.com>
      36d6485f
  2. Jan 03, 2023
  3. Sep 22, 2022
  4. Apr 26, 2022
  5. Feb 23, 2022
    • Tero Kristo's avatar
      remoteproc/omap: Trigger IOMMU during crash recovery sequence · 83e09589
      Tero Kristo authored
      
      Trigger IOMMU during crash recovery sequence to reset IOMMU also.
      Otherwise IOMMU may end up in a stale state, causing the remoteproc to
      hang or crash again. This issue is particularly seen on DRA7xx/AM57xx
      DSP remoteprocs.
      
      Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      83e09589
    • Suman Anna's avatar
      remoteproc: Fix multiple back-to-back error recoveries · 706c31b9
      Suman Anna authored
      The remoteproc core uses a dedicated work item per remote processor
      to perform an error recovery of that processor. This work item is
      always scheduled upon notification of an error at the moment. The
      error recovery process itself is performed when the workqueue gets
      scheduled and executes the work function, but an error recovery
      needs to be performed only once if there are multiple notifications
      while an existing error recovery is in progress. Fix this by adding
      a check to make sure the remote processor error recovery work item
      is not already running or scheduled.
      
      This fixes an issue with error recovery upon MMU Faults on OMAP
      IPU remote processors. An MMU fault on OMAP IPU sends two error
      notifications - one a direct interrupt from the MMU, and the second
      a mailbox-based crash notification after the remote processor has
      collected some backtrace. The mailbox based interrupt mechanism,
      added in commit 232ba6ca
      
       ("remoteproc/omap: Report device
      exceptions and trigger recovery"), is used for Attribute MMU (AMMU)
      faults and other internal exceptions on the IPU. The backtrace
      collection on the IPU remote processor is triggered by the same
      interrupt which cannot be differentiated between an MMU fault and
      an AMMU fault. The remoteproc core changes in 4.9 kernel around the
      boot sequences has now caused the second notification to trigger a
      secondary error recovery, which was avoided in previous kernels due
      to the event detection in the work-function itself. The newer code
      sequences changes the timing w.r.t previous kernels where the
      recovery process was performed a bit later due to the asynchronous
      firmware loading.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      706c31b9
    • Suman Anna's avatar
      remoteproc: implement last trace for remoteproc · b8e3c7f5
      Suman Anna authored
      
      The last trace is a way of preserving the remoteproc traces past
      remoteproc recovery. This is achieved by creating a new traceY_last
      debugfs entry during a crash for each trace entry, and copying the
      trace buffer contents into the corresponding last trace entry. This
      copied contents can then be read out using a debugfs entry. All the
      trace entries are cleaned up during the resource cleanup phase when
      shutting down a remoteproc. The design assumes that the same firmware
      is being used for the error recovery.
      
      Eg:
      	cat <debugfs_root>/remoteproc/remoteprocX/traceY_last
      should give the traces that were printed out just before the recovery
      happened on remoteproc X for trace Y.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarSubramaniam Chanderashekarapuram <subramaniam.ca@ti.com>
      [dfustini: resolved trivial conflicts for 5.10]
      Signed-off-by: default avatarDrew Fustini <dfustini@baylibre.com>
      b8e3c7f5
    • Suman Anna's avatar
      remoteproc: debugfs: Optimize the trace va lookup · 06462804
      Suman Anna authored
      The commit a987e6b9
      
       ("remoteproc: fix trace buffer va initialization")
      computes the trace va given the trace device address every time a debugfs
      read is done. This can be optimized to perform the lookup only the first
      time, and store the value in the va field of the embedded rproc_mem_entry
      structure for the debug trace. This restores how the trace va was stored
      prior to the above commit in the original trace resource entry handling.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      06462804
    • Suman Anna's avatar
      remoteproc/omap: add a trace to print missing alias ids · 4262d9cd
      Suman Anna authored
      
      The alias ids for OMAP remoteprocs are required by some
      rpmsg client drivers to identify a remote processor in
      a fixed manner to userspace. Add a trace during probe
      to warn developers if the alias id is not defined for a
      remoteproc DT node.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      4262d9cd
  6. Jan 31, 2022
  7. Oct 20, 2021
    • Suman Anna's avatar
      arm64: dts: ti: k3-j721e-main: Add PRU system events for virtio · 6231f06d
      Suman Anna authored
      
      A PRU system event "vring" has been added to each PRU and RTU node
      in each of the ICSSG0 and ICSSG1 remote processor subsystems to enable
      the virtio/rpmsg communication between MPU and that PRU/RTU core. No
      events have been added to the Tx_PRU cores at present. The additions
      are done in the base k3-j721e-main.dtsi, and so are inherited by all
      the K3 J721E boards.
      
      The PRU system events is the preferred approach over using TI
      mailboxes, as it eliminates an external peripheral access from
      the PRU/RTU-side, and keeps the interrupt generation internal to
      the ICSSG. The difference from MPU would be minimal in using one
      versus the other.
      
      Mailboxes can still be used if desired, but currently there is
      no support on firmware-side for K3 SoCs to use mailboxes. Either
      approach would require that an appropriate firmware image is
      loaded/booted on the PRU.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      6231f06d
    • Suman Anna's avatar
      arm64: dts: ti: k3-am65-main: Add PRU system events for virtio · a85ebb80
      Suman Anna authored
      
      A PRU system event "vring" has been added to each PRU and RTU
      node in each of the ICSSG0, ICSSG1 and ICSSG2 remote processor
      subsystems to enable the virtio/rpmsg communication between MPU
      and that PRU/RTU core. The additions are done in the base
      k3-am65-main.dtsi, and so are inherited by all the K3 AM65x
      boards.
      
      The PRU system events is the preferred approach over using TI
      mailboxes, as it eliminates an external peripheral access from
      the PRU/RTU-side, and keeps the interrupt generation internal to
      the ICSSG. The difference from MPU would be minimal in using one
      versus the other.
      
      Mailboxes can still be used if desired, but currently there is
      no support on firmware-side for K3 SoCs to use mailboxes. Either
      approach would require that an appropriate firmware image is
      loaded/booted on the PRU.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      a85ebb80
    • Nick Saulnier's avatar
      ARM: dts: am57xx: Add PRU system events for virtio · 9aaf81c2
      Nick Saulnier authored
      
      A PRU system event "vring" has been added to each of the PRU nodes in
      the PRU-ICSS remote processor subsystem to enable the virtio/rpmsg
      communication between MPU and that PRU core. The additions are done
      in the common am57-pruss.dtsi, and so are inherited by all the AM57xx
      boards.
      
      The PRU system events is the preferred approach over using OMAP
      mailboxes, as it eliminates an external peripheral access from
      the PRU-side, and keeps the interrupt generation internal to the
      PRUSS. The difference from MPU would be minimal in using one
      versus the other.
      
      Mailboxes can still be used if desired, but currently there is no
      support on firmware-side for the SoC to use mailboxes. Either approach
      would require that an appropriate firmware image is loaded/booted on
      the PRU.
      
      Signed-off-by: default avatarNick Saulnier <nsaulnier@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      9aaf81c2
    • Nick Saulnier's avatar
      ARM: dts: AM4372: Add PRU system events for virtio · b1f44e64
      Nick Saulnier authored
      
      A PRU system event "vring" has been added to each of the PRU nodes in
      the PRU-ICSS remote processor subsystem to enable the virtio/rpmsg
      communication between MPU and that PRU core. The additions are done
      in the base am4372.dtsi, and so are inherited by all the AM437x boards.
      Do note that PRUSS is available only on all AM4376+ SoCs.
      
      The PRU system events is the preferred approach over using OMAP
      mailboxes, as it eliminates an external peripheral access from
      the PRU-side, and keeps the interrupt generation internal to the
      PRUSS. The difference from MPU would be minimal in using one
      versus the other.
      
      Mailboxes can still be used if desired, but currently there is no
      support on firmware-side for the SoC to use mailboxes. Either approach
      would require that an appropriate firmware image is loaded/booted on
      the PRU.
      
      Signed-off-by: default avatarNick Saulnier <nsaulnier@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      b1f44e64
    • Nick Saulnier's avatar
      ARM: dts: am335x: Add PRU system events for virtio · be1be917
      Nick Saulnier authored
      
      A PRU system event "vring" has been added to each of the PRU nodes in
      the PRU-ICSS remote processor subsystem to enable the virtio/rpmsg
      communication between MPU and that PRU core. The additions are done
      in the base am33xx-l4.dtsi, and so are inherited by all the AM335x
      boards. Do note that PRUSS is available only on all AM3356+ SoCs.
      
      The PRU system events is the preferred approach over using OMAP
      mailboxes, as it eliminates an external peripheral access from
      the PRU-side, and keeps the interrupt generation internal to the
      PRUSS. The difference from MPU would be minimal in using one
      versus the other.
      
      Mailboxes can still be used if desired, but currently there is no
      support on firmware-side for the SoC to use mailboxes. Either approach
      would require that an appropriate firmware image is loaded/booted on
      the PRU.
      
      Signed-off-by: default avatarNick Saulnier <nsaulnier@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      be1be917
    • Suman Anna's avatar
      remoteproc: pru: Add support for virtio rpmsg stack · d580a852
      Suman Anna authored
      
      The PRU remoteproc driver has been enhanced to support the optional
      rpmsg stack using the virtio-ring based communication transport
      between MPU and a PRU core. This provides support to any firmware
      images supporting the virtio devices.
      
      The virtio-ring signalling support is provided through two PRU system
      events - one event used in each direction for kicking from one processor
      and receiving notification on the other processor. It provides an
      uniform solution across all the OMAP, Keystone and Davinci architectures.
      The virtio-ring based communication requires the corresponding firmware
      support though.
      
      Because the vring irq mappings described in DT may conflict with
      some PRU client irq mappings described in DT, move part responsible for
      gathering vring irq to pru_rproc_start stage and perform it only if
      rvdevs are present.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Co-developed-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      [grzegorz.jaszczyk@linaro.org: Gather vring irq only when rvdevs
      are present]
      Signed-off-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      d580a852
    • Suman Anna's avatar
      dt-bindings: remoteproc: pru: Update bindings for supporting rpmsg · 91575de1
      Suman Anna authored
      
      Update the PRU remoteproc DT bindings to add the properties required
      to support the optional virtio rpmsg stack using the virtio-ring based
      communication transport between MPU and a PRU core.
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Co-developed-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      Signed-off-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      91575de1
  8. Oct 16, 2021
    • Hari Nagalla's avatar
      remoteproc: k3-m4: Add a remoteproc driver for M4F subsystem · 821f316d
      Hari Nagalla authored
      
      The AM64x SoC of TI K3 family has a Cortex  M4F core in the MCU
      domain. This core is typically used for safety applications in a stand
      alone mode. However, some application (non safety related) may want to
      use the M4F core as a generic remote processor with IPC to the host
      processor. The M4F core has internal IRAM and DRAM memories and are
      exposed to the system bus for code and data loading.
      
      A remoteproc driver is added to support this subsystem to be able to
      load and boot M4F core. Loading includes to M4F internal memories and
      to any predefined external code/data memory. The carveouts for external
      contiguous memory is defined in the M4F device node and should match
      with the external memory declarations in the M4F image binary. The M4F
      subsystem has two resets. One reset is for the entire subsystem i.e
      including the internal memories and the other, a local reset is only
      for the M4F processing core. For loading the image remoteproc driver
      first releases the subsystem reset, loads the firmware image and then
      releases the local reset to let the M4F processing core to run.
      
      Signed-off-by: default avatarHari Nagalla <hnagalla@ti.com>
      821f316d
  9. Oct 11, 2021
    • Hari Nagalla's avatar
      dt-bindings: remoteproc: k3-m4f: Add bindings for K3 AM64x SoCs · b5e2f1c0
      Hari Nagalla authored
      
      K3 AM64x SoC has a Cortex M4F subsystem in the MCU volatge domain.
      The remote processor's life cycle management and IPC mechanisms are
      similar across the R5F and M4F cores from remote processor driver
      point of view. However, there are subtle differences in image loading
      and starting the M4F subsystems.
      
      The YAML binding document provides the various node properties to be
      configured by the consumers of the M4F subsystem.
      
      Signed-off-by: default avatarHari Nagalla <hnagalla@ti.com>
      b5e2f1c0
  10. Jul 19, 2021
    • Grygorii Strashko's avatar
      irqchip/irq-pruss-intc: Fix build warning · 4dae907b
      Grygorii Strashko authored
      Fix build warning on v7 platforms:
      
        CC [M]  drivers/irqchip/irq-pruss-intc.o
      In file included from ../include/linux/bits.h:6,
                       from ../include/linux/bitops.h:5,
                       from ../include/linux/kernel.h:12,
                       from ../include/linux/interrupt.h:6,
                       from ../drivers/irqchip/irq-pruss-intc.c:15:
      ../include/vdso/bits.h:7:26: warning: left shift count >= width of type [-Wshift-count-overflow]
       #define BIT(nr)   (UL(1) << (nr))
                                ^~
      ../drivers/irqchip/irq-pruss-intc.c:668:32: note: in expansion of macro ‘BIT’
        .quirky_events = BIT_ULL(7) | BIT(56), /* IEP{0,1} capture/compare events */
                                      ^~~
      The quirky_events is u64 so BIT_ULL() has to be used.
      
      Fixes: bbe0ff82
      
       ("HACK: irqchip/irq-pruss-intc: Fix processing of IEP interrupts")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      4dae907b
  11. Jun 17, 2021
    • Suman Anna's avatar
      Merge branch 'mailbox-linux-5.10.y' of git://git.ti.com/rpmsg/mailbox into rproc-linux-5.10.y · 0a95b3dd
      Suman Anna authored
      Pull in the mailbox feature branch into the remoteproc tree. The OMAP
      Mailbox support and corresponding sub-mailboxes nodes are all upstream
      and present in vanilla 5.10 kernel (except for AM64x nodes), and this
      merge pulls in the OMAP Mailbox YAML binding conversion and related
      dts node cleanups.
      
      * 'mailbox-linux-5.10.y' of git://git.ti.com/rpmsg/mailbox
      
      :
        dt-bindings: mailbox: Convert omap-mailbox.txt binding to YAML
        ARM: dts: OMAP2+: Replace underscores in sub-mailbox node names
        ARM: dts: AM33xx/AM43xx: Rename wkup_m3 sub-mailbox node
        ARM: dts: OMAP2/OMAP3: Rename processor sub-mailbox nodes
        ARM: dts: OMAP2420: Drop interrupt-names from mailbox node
        TEMP: dt-bindings: mailbox: omap: Add example for AM64x SoCs
        mailbox: omap: Add support for K3 AM64x SoCs
        dt-bindings: mailbox: omap: Update binding for AM64x SoCs
      
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      0a95b3dd
  12. Jun 16, 2021
  13. May 28, 2021
    • Suman Anna's avatar
      HACK: irqchip/irq-pruss-intc: Fix processing of IEP interrupts · bbe0ff82
      Suman Anna authored
      
      It was discovered that IEP capture/compare IRQs (event #7 on all SoCs
      and event #56 on K3 SoCs) are always triggered twice when PPS is
      generated and CMP hit event detected by IEP.
      
      An example of the problem is:
        pruss_intc_irq_handler
         generic_handle_irq
          handle_level_irq
            mask_ack_irq -> IRQ 7 masked and asked in INTC,
                            but it's not yet cleared on HW level
            handle_irq_event()
              <threaded on RT>
                 icss_iep_cap_cmp_handler() -> IRQ 7 is actually processed in HW
              irq_finalize_oneshot()
               unmask_irq()
                 pruss_intc_irq_unmask() -> IRQ 7 status is still observed as set
      
      The solution is to actually ack these IRQs from pruss_intc_irq_unmask()
      after the IRQ source is cleared in HW.
      
      NOTE:
      1. The current solution provides a decent generic framework to scale
         for any additional events that might be discovered in the future.
      2. The solution can be reworked using soc_device_attributes() if a
         per-SoC solution is desired. The current solution applies to all
         SoCs accounting for single IEP on non-K3 SoCs and for 2 IEPs on
         all K3 SoCs.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      bbe0ff82
    • Grygorii Strashko's avatar
      irqchip/irq-pruss-intc: Fix listed IRQ type in /proc/interrupts · 3432a9d1
      Grygorii Strashko authored
      
      The PRUSS INTC driver doesn't have .irq_set_type() callback implemented and
      supports only IRQ_TYPE_LEVEL_HIGH. This resulted in the IRQ properties not
      being updated properly and the PRUSS INTC IRQs were listed incorrectly in
      /proc/interrupts as Edge.
      
      Example:
        218:          0  4b220000.interrupt-controller  26 Edge      pru10
      
      Fix this by adding a simple .irq_set_type() implementation which checks the
      requested IRQ triggering type.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      3432a9d1
    • Suman Anna's avatar
      irqchip/irq-pruss-intc: Fix enabling of intc events · 7d1ca3e7
      Suman Anna authored
      
      PRUSS INTC events are enabled by default once IRQ events are mapped to
      channel:host pair. This may cause issues with undesirable IRQs triggering
      even before a PRU IRQ is requested which are silently processed by
      pruss_intc_irq_handler().
      
      Fix it by masking all events by default except those which are routed to
      various PRU cores (Host IRQs 0, 1; 10 through 19 on K3 SoCs), and any
      other reserved IRQs routed to other processors. The unmasking of IRQs is
      the responsibility of Linux IRQ core when IRQ is actually requested.
      
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      7d1ca3e7
  14. May 25, 2021