1. 10 Dec, 2020 5 commits
    • Suman Anna's avatar
      remoteproc: pru: Add support for various PRU cores on K3 AM65x SoCs · 1d39f4d1
      Suman Anna authored
      The K3 AM65x family of SoCs have the next generation of the PRU-ICSS
      processor subsystem, commonly referred to as ICSSG. Each ICSSG processor
      subsystem on AM65x SR1.0 contains two primary PRU cores and two new
      auxiliary PRU cores called RTUs. The AM65x SR2.0 SoCs have a revised
      ICSSG IP that is based off the subsequent IP revision used on J721E
      SoCs. This IP instance has two new custom auxiliary PRU cores called
      Transmit PRUs (Tx_PRUs) in addition to the existing PRUs and RTUs.
      
      Each RTU and Tx_PRU cores have their own dedicated IRAM (smaller than
      a PRU), Control and debug feature sets, but is different in terms of
      sub-modules integrated around it and does not have the full capabilities
      associated with a PRU core. The RTU core is typically used to aid a
      PRU core in accelerating data transfers, while the Tx_PRU cores is
      normally used to control the TX L2 FIFO if enabled in Ethernet
      applications. Both can also be used to run independent applications.
      The RTU and Tx_PRU cores though share the same Data RAMs as the PRU
      cores, so the memories have to be partitioned carefully between different
      applications. The new cores also support a new sub-module called Task
      Manager to support two different context thread executions.
      
      Enhance the existing PRU remoteproc driver to support these new PRU, RTU
      and Tx PRU cores by using specific compatibles. The initial names for the
      firmware images for each PRU core are retrieved from DT nodes, and can
      be adjusted through sysfs if required.
      
      The PRU remoteproc driver has to be specifically modified to use a
      custom memcpy function within its ELF loader implementation for these
      new cores in order to overcome a limitation with copying data into each
      of the core's IRAM memories. These memory ports support only 4-byte
      writes, and any sub-word order byte writes clear out the remaining
      bytes other than the bytes being written within the containing word.
      The default ARM64 memcpy also cannot be used as it throws an exception
      when the preferred 8-byte copy operation is attempted. This choice is
      made by using a state flag that is set only on K3 SoCs.
      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>
      Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20201208141002.17777-6-grzegorz.jaszczyk@linaro.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      1d39f4d1
    • Suman Anna's avatar
      remoteproc: pru: Add pru-specific debugfs support · 20ad1de0
      Suman Anna authored
      The remoteproc core creates certain standard debugfs entries,
      that does not give a whole lot of useful information for the
      PRUs. The PRU remoteproc driver is enhanced to add additional
      debugfs entries for PRU. These will be auto-cleaned up when
      the parent rproc debug directory is removed.
      
      The enhanced debugfs support adds two new entries: 'regs' and
      'single_step'. The 'regs' dumps out the useful CTRL sub-module
      registers as well as each of the 32 GPREGs and CT_REGs registers.
      The GPREGs and CT_REGs though are printed only when the PRU is
      halted and accessible as per the IP design.
      
      The 'single_step' utilizes the single-step execution of the PRU
      cores. Writing a non-zero value performs a single step, and a
      zero value restores the PRU to execute in the same mode as the
      mode before the first single step. (note: if the PRU is halted
      because of a halt instruction, then no change occurs).
      
      Logic for setting the PC and jumping over a halt instruction shall
      be added in the future.
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20201208141002.17777-5-grzegorz.jaszczyk@linaro.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      20ad1de0
    • Grzegorz Jaszczyk's avatar
      remoteproc: pru: Add support for PRU specific interrupt configuration · c75c9fda
      Grzegorz Jaszczyk authored
      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: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
      Co-developed-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      Link: https://lore.kernel.org/r/20201208141002.17777-4-grzegorz.jaszczyk@linaro.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      c75c9fda
    • Suman Anna's avatar
      remoteproc: pru: Add a PRU remoteproc driver · d4ce2de7
      Suman Anna authored
      The Programmable Real-Time Unit Subsystem (PRUSS) consists of
      dual 32-bit RISC cores (Programmable Real-Time Units, or PRUs)
      for program execution. This patch adds a remoteproc platform
      driver for managing the individual PRU RISC cores life cycle.
      
      The PRUs do not have a unified address space (have an Instruction
      RAM and a primary Data RAM at both 0x0). The PRU remoteproc driver
      therefore uses a custom remoteproc core ELF loader ops. The added
      .da_to_va ops is only used to provide translations for the PRU
      Data RAMs. This remoteproc driver does not have support for error
      recovery and system suspend/resume features. Different compatibles
      are used to allow providing scalability for instance-specific device
      data if needed. The driver uses a default firmware-name retrieved
      from device-tree for each PRU core, and the firmwares are expected
      to be present in the standard Linux firmware search paths. They can
      also be adjusted by userspace if required through the sysfs interface
      provided by the remoteproc core.
      
      The PRU remoteproc driver uses a client-driven boot methodology: it
      does _not_ support auto-boot so that the PRU load and boot is dictated
      by the corresponding client drivers for achieving various usecases.
      This allows flexibility for the client drivers or applications to set
      a firmware name (if needed) based on their desired functionality and
      boot the PRU. The sysfs bind and unbind attributes have also been
      suppressed so that the PRU devices cannot be unbound and thereby
      shutdown a PRU from underneath a PRU client driver.
      
      The driver currently supports the AM335x, AM437x, AM57xx and 66AK2G
      SoCs, and support for other TI SoCs will be added in subsequent
      patches.
      Co-developed-by: default avatarAndrew F. Davis <afd@ti.com>
      Signed-off-by: default avatarAndrew F. Davis <afd@ti.com>
      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>
      Reviewed-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
      Link: https://lore.kernel.org/r/20201208141002.17777-3-grzegorz.jaszczyk@linaro.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      d4ce2de7
    • Suman Anna's avatar
      dt-bindings: remoteproc: Add binding doc for PRU cores in the PRU-ICSS · d570d05e
      Suman Anna authored
      The Programmable Real-Time Unit and Industrial Communication Subsystem
      (PRU-ICSS or simply PRUSS) on various TI SoCs consists of dual 32-bit
      RISC cores (Programmable Real-Time Units, or PRUs) for program execution.
      
      The K3 AM65x amd J721E SoCs have the next generation of the PRU-ICSS IP,
      commonly called ICSSG. The ICSSG IP on AM65x SoCs has two PRU cores,
      two auxiliary custom PRU cores called Real Time Units (RTUs). The K3
      AM65x SR2.0 and J721E SoCs have a revised version of the ICSSG IP, and
      include two additional custom auxiliary PRU cores called Transmit PRUs
      (Tx_PRUs).
      
      This patch adds the bindings for these PRU cores. The binding covers the
      OMAP architecture SoCs - AM33xx, AM437x and AM57xx; Keystone 2 architecture
      based 66AK2G SoC; and the K3 architecture based SoCs - AM65x and J721E. The
      Davinci based OMAPL138 SoCs will be covered in a future patch.
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Co-developed-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Signed-off-by: default avatarSuman Anna <s-anna@ti.com>
      Signed-off-by: default avatarGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
      Link: https://lore.kernel.org/r/20201208141002.17777-2-grzegorz.jaszczyk@linaro.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
      d570d05e
  2. 04 Dec, 2020 2 commits
  3. 26 Nov, 2020 8 commits
  4. 24 Nov, 2020 3 commits
  5. 21 Nov, 2020 4 commits
  6. 18 Nov, 2020 2 commits
  7. 26 Oct, 2020 8 commits
  8. 25 Oct, 2020 8 commits