mbox series

[v2,0/2] Initial Renesas R-Car remoteproc support

Message ID 20211130100049.129418-1-julien.massot@iot.bzh (mailing list archive)
Headers show
Series Initial Renesas R-Car remoteproc support | expand

Message

Julien Massot Nov. 30, 2021, 10 a.m. UTC
Most of the SoCs in the R-Car gen3 SoC series such as
H3,M3 and E3 have an 'Arm Realtime Core'.
This Realtime core is an Arm Cortex-R7 clocked at 800MHz.
This series adds initial support to load a firmware and start
this remote processor through the remoteproc subsystem.

This series depends on
https://patchwork.kernel.org/project/linux-renesas-soc/patch/20211022122101.66998-1-julien.massot@iot.bzh/
to be able to set the Cortex-R7 boot address.

One of the way to test this driver is to use the zephyr upstream support
for h3ulcb board 'blinky' demo is my favorite testing firmware.

To generate a firmware with the zephyr project.

follow this starting guide
https://docs.zephyrproject.org/2.7.0/getting_started/index.html

Then compile your zephyr demo
west build -b rcar_h3ulcb_cr7 zephyr/samples/basic/blinky \
    -DCONFIG_KERNEL_ENTRY=\"_vector_table\" \
    --build-dir h3-blinky

Then you can use h3-blinky/zephyr/zephyr.elf as a testing
firmware.

Patch 1/2 adds the dt-bindings

Patch 2/2 is a small driver to cover basic remoteproc
usage: loading firmware from filesystem, starting and stopping the
Cortex-r7 processor.

Device tree modifications have been dropped in this patchset version.
Reason is that memory range used by the Cortex-R7 depends on
design choice.
One thing we could do in the future is to add CR7 node
in the different Gen3 SoCs dtsi files such as r8a77951.dtsi, r8a77990.dtsi,
r8a77961.dtsi.. 

Julien Massot (2):
  dt-bindings: remoteproc: Add Renesas R-Car
  remoteproc: Add Renesas rcar driver

 .../remoteproc/renesas,rcar-rproc.yaml        |  65 +++++
 drivers/remoteproc/Kconfig                    |  11 +
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/rcar_rproc.c               | 226 ++++++++++++++++++
 4 files changed, 303 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/renesas,rcar-rproc.yaml
 create mode 100644 drivers/remoteproc/rcar_rproc.c

Comments

Mathieu Poirier Dec. 1, 2021, 4:46 p.m. UTC | #1
Good morning,

On Tue, Nov 30, 2021 at 11:00:47AM +0100, Julien Massot wrote:
> Most of the SoCs in the R-Car gen3 SoC series such as
> H3,M3 and E3 have an 'Arm Realtime Core'.
> This Realtime core is an Arm Cortex-R7 clocked at 800MHz.
> This series adds initial support to load a firmware and start
> this remote processor through the remoteproc subsystem.
> 
> This series depends on
> https://patchwork.kernel.org/project/linux-renesas-soc/patch/20211022122101.66998-1-julien.massot@iot.bzh/
> to be able to set the Cortex-R7 boot address.

The above depencency is needed for this patchset to compile properly.  Since
Geert has already applied it to his renesas-devel tree we can do two things:

1) Make this set go through Geert's tree.
2) Geert publishes an immutable branch I can pull the dependency from.

I'm good either way, just let me know what you want to do.

Thanks,
Mathieu

> 
> One of the way to test this driver is to use the zephyr upstream support
> for h3ulcb board 'blinky' demo is my favorite testing firmware.
> 
> To generate a firmware with the zephyr project.
> 
> follow this starting guide
> https://docs.zephyrproject.org/2.7.0/getting_started/index.html
> 
> Then compile your zephyr demo
> west build -b rcar_h3ulcb_cr7 zephyr/samples/basic/blinky \
>     -DCONFIG_KERNEL_ENTRY=\"_vector_table\" \
>     --build-dir h3-blinky
> 
> Then you can use h3-blinky/zephyr/zephyr.elf as a testing
> firmware.
> 
> Patch 1/2 adds the dt-bindings
> 
> Patch 2/2 is a small driver to cover basic remoteproc
> usage: loading firmware from filesystem, starting and stopping the
> Cortex-r7 processor.
> 
> Device tree modifications have been dropped in this patchset version.
> Reason is that memory range used by the Cortex-R7 depends on
> design choice.
> One thing we could do in the future is to add CR7 node
> in the different Gen3 SoCs dtsi files such as r8a77951.dtsi, r8a77990.dtsi,
> r8a77961.dtsi.. 
> 
> Julien Massot (2):
>   dt-bindings: remoteproc: Add Renesas R-Car
>   remoteproc: Add Renesas rcar driver
> 
>  .../remoteproc/renesas,rcar-rproc.yaml        |  65 +++++
>  drivers/remoteproc/Kconfig                    |  11 +
>  drivers/remoteproc/Makefile                   |   1 +
>  drivers/remoteproc/rcar_rproc.c               | 226 ++++++++++++++++++
>  4 files changed, 303 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/remoteproc/renesas,rcar-rproc.yaml
>  create mode 100644 drivers/remoteproc/rcar_rproc.c
> 
> -- 
> 2.33.1
> 
>
Julien Massot Dec. 2, 2021, 8:57 a.m. UTC | #2
Hi Geert, Mathieu,

On 12/1/21 17:46, Mathieu Poirier wrote:
> Good morning,
> 
> On Tue, Nov 30, 2021 at 11:00:47AM +0100, Julien Massot wrote:
>> Most of the SoCs in the R-Car gen3 SoC series such as
>> H3,M3 and E3 have an 'Arm Realtime Core'.
>> This Realtime core is an Arm Cortex-R7 clocked at 800MHz.
>> This series adds initial support to load a firmware and start
>> this remote processor through the remoteproc subsystem.
>>
>> This series depends on
>> https://patchwork.kernel.org/project/linux-renesas-soc/patch/20211022122101.66998-1-julien.massot@iot.bzh/
>> to be able to set the Cortex-R7 boot address.
> 
> The above depencency is needed for this patchset to compile properly.  Since
> Geert has already applied it to his renesas-devel tree we can do two things:
> 
> 1) Make this set go through Geert's tree.
> 2) Geert publishes an immutable branch I can pull the dependency from.
> 
> I'm good either way, just let me know what you want to do.
Geert, since you already have the required patch in your tree, it could make sense
if you handle this patchset too ?
Up to your choice.

Regards,
Geert Uytterhoeven Dec. 2, 2021, 1:41 p.m. UTC | #3
Hi Mathieu,

On Wed, Dec 1, 2021 at 5:46 PM Mathieu Poirier
<mathieu.poirier@linaro.org> wrote:
> On Tue, Nov 30, 2021 at 11:00:47AM +0100, Julien Massot wrote:
> > Most of the SoCs in the R-Car gen3 SoC series such as
> > H3,M3 and E3 have an 'Arm Realtime Core'.
> > This Realtime core is an Arm Cortex-R7 clocked at 800MHz.
> > This series adds initial support to load a firmware and start
> > this remote processor through the remoteproc subsystem.
> >
> > This series depends on
> > https://patchwork.kernel.org/project/linux-renesas-soc/patch/20211022122101.66998-1-julien.massot@iot.bzh/
> > to be able to set the Cortex-R7 boot address.
>
> The above depencency is needed for this patchset to compile properly.  Since
> Geert has already applied it to his renesas-devel tree we can do two things:
>
> 1) Make this set go through Geert's tree.
> 2) Geert publishes an immutable branch I can pull the dependency from.
>
> I'm good either way, just let me know what you want to do.

I prefer you to handle the remoteproc parts.
Please find a pull request for the immutable branch below.
Thanks!

The following changes since commit fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf:

  Linux 5.16-rc1 (2021-11-14 13:56:52 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git
tags/rcar_rst_rproc-tag1

for you to fetch changes up to 4c7924fb905b02323ff6d9d20f370892615dccfa:

  soc: renesas: rcar-rst: Add support to set rproc boot address
(2021-11-15 10:01:10 +0100)

----------------------------------------------------------------
Renesas R-Car Reset Controller remoteproc API

Definition of rcar_rst_set_rproc_boot_addr(), to be consumed by the
Renesas R-Car Gen3 remote processor driver.

----------------------------------------------------------------
Julien Massot (1):
      soc: renesas: rcar-rst: Add support to set rproc boot address

 drivers/soc/renesas/rcar-rst.c       | 43 +++++++++++++++++++++++++++++++++---
 include/linux/soc/renesas/rcar-rst.h |  2 ++
 2 files changed, 42 insertions(+), 3 deletions(-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Mathieu Poirier Dec. 6, 2021, 4:59 p.m. UTC | #4
On Thu, Dec 02, 2021 at 02:41:57PM +0100, Geert Uytterhoeven wrote:
> Hi Mathieu,
> 
> On Wed, Dec 1, 2021 at 5:46 PM Mathieu Poirier
> <mathieu.poirier@linaro.org> wrote:
> > On Tue, Nov 30, 2021 at 11:00:47AM +0100, Julien Massot wrote:
> > > Most of the SoCs in the R-Car gen3 SoC series such as
> > > H3,M3 and E3 have an 'Arm Realtime Core'.
> > > This Realtime core is an Arm Cortex-R7 clocked at 800MHz.
> > > This series adds initial support to load a firmware and start
> > > this remote processor through the remoteproc subsystem.
> > >
> > > This series depends on
> > > https://patchwork.kernel.org/project/linux-renesas-soc/patch/20211022122101.66998-1-julien.massot@iot.bzh/
> > > to be able to set the Cortex-R7 boot address.
> >
> > The above depencency is needed for this patchset to compile properly.  Since
> > Geert has already applied it to his renesas-devel tree we can do two things:
> >
> > 1) Make this set go through Geert's tree.
> > 2) Geert publishes an immutable branch I can pull the dependency from.
> >
> > I'm good either way, just let me know what you want to do.
> 
> I prefer you to handle the remoteproc parts.
> Please find a pull request for the immutable branch below.
> Thanks!

Perfect - I'll pull from this branch when I receive Julien's final version.

Mathieu

> 
> The following changes since commit fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf:
> 
>   Linux 5.16-rc1 (2021-11-14 13:56:52 -0800)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git
> tags/rcar_rst_rproc-tag1
> 
> for you to fetch changes up to 4c7924fb905b02323ff6d9d20f370892615dccfa:
> 
>   soc: renesas: rcar-rst: Add support to set rproc boot address
> (2021-11-15 10:01:10 +0100)
> 
> ----------------------------------------------------------------
> Renesas R-Car Reset Controller remoteproc API
> 
> Definition of rcar_rst_set_rproc_boot_addr(), to be consumed by the
> Renesas R-Car Gen3 remote processor driver.
> 
> ----------------------------------------------------------------
> Julien Massot (1):
>       soc: renesas: rcar-rst: Add support to set rproc boot address
> 
>  drivers/soc/renesas/rcar-rst.c       | 43 +++++++++++++++++++++++++++++++++---
>  include/linux/soc/renesas/rcar-rst.h |  2 ++
>  2 files changed, 42 insertions(+), 3 deletions(-)
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds