diff mbox series

[RFC,v1,1/5] xen/arm: add support for Renesas R-Car Gen3 platform

Message ID 7ac8512b5479cf192b4aa399fa2501d0bccaaf48.1639472078.git.oleksii_moisieiev@epam.com (mailing list archive)
State Superseded
Headers show
Series Introduce SCI-mediator feature | expand

Commit Message

Oleksii Moisieiev Dec. 14, 2021, 9:34 a.m. UTC
Implementation includes platform-specific smc handler for rcar3 platform.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
---
 xen/arch/arm/platforms/Makefile |  1 +
 xen/arch/arm/platforms/rcar3.c  | 46 +++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 xen/arch/arm/platforms/rcar3.c

Comments

Oleksandr Andrushchenko Dec. 15, 2021, 6:38 a.m. UTC | #1
Hi, Oleksii!

On 14.12.21 11:34, Oleksii Moisieiev wrote:
> Implementation includes platform-specific smc handler for rcar3 platform.
>
> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

> ---
>   xen/arch/arm/platforms/Makefile |  1 +
>   xen/arch/arm/platforms/rcar3.c  | 46 +++++++++++++++++++++++++++++++++
>   2 files changed, 47 insertions(+)
>   create mode 100644 xen/arch/arm/platforms/rcar3.c
>
> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> index 8632f4115f..b64c25de6c 100644
> --- a/xen/arch/arm/platforms/Makefile
> +++ b/xen/arch/arm/platforms/Makefile
> @@ -4,6 +4,7 @@ obj-$(CONFIG_ALL32_PLAT) += exynos5.o
>   obj-$(CONFIG_ALL32_PLAT) += midway.o
>   obj-$(CONFIG_ALL32_PLAT) += omap5.o
>   obj-$(CONFIG_ALL32_PLAT) += rcar2.o
> +obj-$(CONFIG_RCAR3) += rcar3.o
>   obj-$(CONFIG_ALL64_PLAT) += seattle.o
>   obj-$(CONFIG_ALL_PLAT)   += sunxi.o
>   obj-$(CONFIG_ALL64_PLAT) += thunderx.o
> diff --git a/xen/arch/arm/platforms/rcar3.c b/xen/arch/arm/platforms/rcar3.c
> new file mode 100644
> index 0000000000..d740145c71
> --- /dev/null
> +++ b/xen/arch/arm/platforms/rcar3.c
> @@ -0,0 +1,46 @@
> +/*
> + * xen/arch/arm/platforms/rcar3.c
> + *
> + * Renesas R-Car Gen3 specific settings
> + *
> + * Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> + * Copyright (C) 2021 EPAM Systems
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <asm/platform.h>
> +
> +static bool rcar3_smc(struct cpu_user_regs *regs)
> +{
> +    return false;
> +}
> +
> +static const char *const rcar3_dt_compat[] __initconst =
> +{
> +    "renesas,r8a7795",
> +    "renesas,r8a7796",
> +    NULL
> +};
> +
> +PLATFORM_START(rcar3, "Renesas R-Car Gen3")
> +    .compatible = rcar3_dt_compat,
> +    .smc = rcar3_smc
> +PLATFORM_END
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
Julien Grall Dec. 15, 2021, 9:39 a.m. UTC | #2
Hi,

On 14/12/2021 09:34, Oleksii Moisieiev wrote:
> Implementation includes platform-specific smc handler for rcar3 platform.
> 
> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> ---
>   xen/arch/arm/platforms/Makefile |  1 +
>   xen/arch/arm/platforms/rcar3.c  | 46 +++++++++++++++++++++++++++++++++
>   2 files changed, 47 insertions(+)
>   create mode 100644 xen/arch/arm/platforms/rcar3.c
> 
> diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> index 8632f4115f..b64c25de6c 100644
> --- a/xen/arch/arm/platforms/Makefile
> +++ b/xen/arch/arm/platforms/Makefile
> @@ -4,6 +4,7 @@ obj-$(CONFIG_ALL32_PLAT) += exynos5.o
>   obj-$(CONFIG_ALL32_PLAT) += midway.o
>   obj-$(CONFIG_ALL32_PLAT) += omap5.o
>   obj-$(CONFIG_ALL32_PLAT) += rcar2.o
> +obj-$(CONFIG_RCAR3) += rcar3.o
>   obj-$(CONFIG_ALL64_PLAT) += seattle.o
>   obj-$(CONFIG_ALL_PLAT)   += sunxi.o
>   obj-$(CONFIG_ALL64_PLAT) += thunderx.o
> diff --git a/xen/arch/arm/platforms/rcar3.c b/xen/arch/arm/platforms/rcar3.c
> new file mode 100644
> index 0000000000..d740145c71
> --- /dev/null
> +++ b/xen/arch/arm/platforms/rcar3.c
> @@ -0,0 +1,46 @@
> +/*
> + * xen/arch/arm/platforms/rcar3.c
> + *
> + * Renesas R-Car Gen3 specific settings
> + *
> + * Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> + * Copyright (C) 2021 EPAM Systems
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <asm/platform.h>
> +
> +static bool rcar3_smc(struct cpu_user_regs *regs)
> +{
> +    return false;
> +}

Looking at the rest of the series, this is going to be replaced in patch 
#2 with:

return sci_handle_call();

SCMI is not specific to RCAR3. So I would expect the function to be 
called from common code.

If it still needs some platform specific code, then I think it would be 
best to introduce rcar3.c at the end of the series. So we don't 
introduce a dummy platform and not hook the code in the middle of 
patch#2 which is meant to be generic.

I will have a proper review of the rest of the series in the new year.

Cheers,
Oleksandr Tyshchenko Dec. 15, 2021, 9:57 a.m. UTC | #3
On Tue, Dec 14, 2021 at 11:35 AM Oleksii Moisieiev <
Oleksii_Moisieiev@epam.com> wrote:

Hi Oleksii

[sorry for the possible format issues]

Implementation includes platform-specific smc handler for rcar3 platform.
>
> Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> ---
>  xen/arch/arm/platforms/Makefile |  1 +
>  xen/arch/arm/platforms/rcar3.c  | 46 +++++++++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+)
>  create mode 100644 xen/arch/arm/platforms/rcar3.c
>
> diff --git a/xen/arch/arm/platforms/Makefile
> b/xen/arch/arm/platforms/Makefile
> index 8632f4115f..b64c25de6c 100644
> --- a/xen/arch/arm/platforms/Makefile
> +++ b/xen/arch/arm/platforms/Makefile
> @@ -4,6 +4,7 @@ obj-$(CONFIG_ALL32_PLAT) += exynos5.o
>  obj-$(CONFIG_ALL32_PLAT) += midway.o
>  obj-$(CONFIG_ALL32_PLAT) += omap5.o
>  obj-$(CONFIG_ALL32_PLAT) += rcar2.o
> +obj-$(CONFIG_RCAR3) += rcar3.o
>  obj-$(CONFIG_ALL64_PLAT) += seattle.o
>  obj-$(CONFIG_ALL_PLAT)   += sunxi.o
>  obj-$(CONFIG_ALL64_PLAT) += thunderx.o
> diff --git a/xen/arch/arm/platforms/rcar3.c
> b/xen/arch/arm/platforms/rcar3.c
> new file mode 100644
> index 0000000000..d740145c71
> --- /dev/null
> +++ b/xen/arch/arm/platforms/rcar3.c
> @@ -0,0 +1,46 @@
> +/*
> + * xen/arch/arm/platforms/rcar3.c
> + *
> + * Renesas R-Car Gen3 specific settings
> + *
> + * Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> + * Copyright (C) 2021 EPAM Systems
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <asm/platform.h>
> +
> +static bool rcar3_smc(struct cpu_user_regs *regs)
> +{
> +    return false;
> +}
> +
> +static const char *const rcar3_dt_compat[] __initconst =
> +{
> +    "renesas,r8a7795",
> +    "renesas,r8a7796",
>


Please note that since Linux commit:
"9c9f7891093b02eb64ca4e1c7ab776a4296c058f soc: renesas: Identify R-Car
M3-W+"
the compatible string for R-Car M3-W+ (ES3.0) SoC is "renesas,r8a77961". So
in case we want to have vSCMI feature on this new SoC revision as well we
will need
to extend the compatible list.


+    NULL
> +};
> +
> +PLATFORM_START(rcar3, "Renesas R-Car Gen3")
> +    .compatible = rcar3_dt_compat,
> +    .smc = rcar3_smc
> +PLATFORM_END
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> --
> 2.27.0
>
>
Oleksii Moisieiev Dec. 15, 2021, 8:08 p.m. UTC | #4
Hi Oleksandr,

Thank you for the point.
I will add it to the next patch version.

Best regards,
Oleksii 

On Wed, Dec 15, 2021 at 06:38:00AM +0000, Oleksandr Andrushchenko wrote:
> Hi, Oleksii!
> 
> On 14.12.21 11:34, Oleksii Moisieiev wrote:
> > Implementation includes platform-specific smc handler for rcar3 platform.
> >
> > Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
> 
> > ---
> >   xen/arch/arm/platforms/Makefile |  1 +
> >   xen/arch/arm/platforms/rcar3.c  | 46 +++++++++++++++++++++++++++++++++
> >   2 files changed, 47 insertions(+)
> >   create mode 100644 xen/arch/arm/platforms/rcar3.c
> >
> > diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
> > index 8632f4115f..b64c25de6c 100644
> > --- a/xen/arch/arm/platforms/Makefile
> > +++ b/xen/arch/arm/platforms/Makefile
> > @@ -4,6 +4,7 @@ obj-$(CONFIG_ALL32_PLAT) += exynos5.o
> >   obj-$(CONFIG_ALL32_PLAT) += midway.o
> >   obj-$(CONFIG_ALL32_PLAT) += omap5.o
> >   obj-$(CONFIG_ALL32_PLAT) += rcar2.o
> > +obj-$(CONFIG_RCAR3) += rcar3.o
> >   obj-$(CONFIG_ALL64_PLAT) += seattle.o
> >   obj-$(CONFIG_ALL_PLAT)   += sunxi.o
> >   obj-$(CONFIG_ALL64_PLAT) += thunderx.o
> > diff --git a/xen/arch/arm/platforms/rcar3.c b/xen/arch/arm/platforms/rcar3.c
> > new file mode 100644
> > index 0000000000..d740145c71
> > --- /dev/null
> > +++ b/xen/arch/arm/platforms/rcar3.c
> > @@ -0,0 +1,46 @@
> > +/*
> > + * xen/arch/arm/platforms/rcar3.c
> > + *
> > + * Renesas R-Car Gen3 specific settings
> > + *
> > + * Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> > + * Copyright (C) 2021 EPAM Systems
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + */
> > +
> > +#include <asm/platform.h>
> > +
> > +static bool rcar3_smc(struct cpu_user_regs *regs)
> > +{
> > +    return false;
> > +}
> > +
> > +static const char *const rcar3_dt_compat[] __initconst =
> > +{
> > +    "renesas,r8a7795",
> > +    "renesas,r8a7796",
> > +    NULL
> > +};
> > +
> > +PLATFORM_START(rcar3, "Renesas R-Car Gen3")
> > +    .compatible = rcar3_dt_compat,
> > +    .smc = rcar3_smc
> > +PLATFORM_END
> > +
> > +/*
> > + * Local variables:
> > + * mode: C
> > + * c-file-style: "BSD"
> > + * c-basic-offset: 4
> > + * indent-tabs-mode: nil
> > + * End:
> > + */
Oleksii Moisieiev Dec. 17, 2021, 10:48 a.m. UTC | #5
Hi Julien,

On Wed, Dec 15, 2021 at 09:39:32AM +0000, Julien Grall wrote:
> Hi,
> 
> Looking at the rest of the series, this is going to be replaced in patch #2
> with:
> 
> return sci_handle_call();
> 
> SCMI is not specific to RCAR3. So I would expect the function to be called
> from common code.
> 
> If it still needs some platform specific code, then I think it would be best
> to introduce rcar3.c at the end of the series. So we don't introduce a dummy
> platform and not hook the code in the middle of patch#2 which is meant to be
> generic.
> 
> I will have a proper review of the rest of the series in the new year.
> 
> Cheers,
> 
> -- 
> Julien Grall

That's sound reasonable. My first thought was to move SCM func_id to the
different section, such as Arm Architecture Service (see Section 6
of DEN0028D). But I think that SiP service func_id fits best in this
case because from guest standpoint all clocks\resets\power-domain ids
are SoC implementation specific.

I'm going to leave SMC func_id in SiP range, but refactor SIP smc
handler, so no RCAR3 specific code will be needed. So there will be no
need to introduce rcar3.c in this patch series.

What do you think about that? 

Best regards,
Oleksii.
Oleksii Moisieiev Dec. 17, 2021, 10:52 a.m. UTC | #6
Hi Oleksandr,

On Wed, Dec 15, 2021 at 11:57:29AM +0200, Oleksandr Tyshchenko wrote:
> On Tue, Dec 14, 2021 at 11:35 AM Oleksii Moisieiev <
> Oleksii_Moisieiev@epam.com> wrote:
> 
> Hi Oleksii
> 
> [sorry for the possible format issues]
> 
> Implementation includes platform-specific smc handler for rcar3 platform.
> >
> > Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> > ---
> >  xen/arch/arm/platforms/Makefile |  1 +
> >  xen/arch/arm/platforms/rcar3.c  | 46 +++++++++++++++++++++++++++++++++
> >  2 files changed, 47 insertions(+)
> >  create mode 100644 xen/arch/arm/platforms/rcar3.c
> >
> > diff --git a/xen/arch/arm/platforms/Makefile
> > b/xen/arch/arm/platforms/Makefile
> > index 8632f4115f..b64c25de6c 100644
> > --- a/xen/arch/arm/platforms/Makefile
> > +++ b/xen/arch/arm/platforms/Makefile
> > @@ -4,6 +4,7 @@ obj-$(CONFIG_ALL32_PLAT) += exynos5.o
> >  obj-$(CONFIG_ALL32_PLAT) += midway.o
> >  obj-$(CONFIG_ALL32_PLAT) += omap5.o
> >  obj-$(CONFIG_ALL32_PLAT) += rcar2.o
> > +obj-$(CONFIG_RCAR3) += rcar3.o
> >  obj-$(CONFIG_ALL64_PLAT) += seattle.o
> >  obj-$(CONFIG_ALL_PLAT)   += sunxi.o
> >  obj-$(CONFIG_ALL64_PLAT) += thunderx.o
> > diff --git a/xen/arch/arm/platforms/rcar3.c
> > b/xen/arch/arm/platforms/rcar3.c
> > new file mode 100644
> > index 0000000000..d740145c71
> > --- /dev/null
> > +++ b/xen/arch/arm/platforms/rcar3.c
> > @@ -0,0 +1,46 @@
> > +/*
> > + * xen/arch/arm/platforms/rcar3.c
> > + *
> > + * Renesas R-Car Gen3 specific settings
> > + *
> > + * Oleksii Moisieiev <oleksii_moisieiev@epam.com>
> > + * Copyright (C) 2021 EPAM Systems
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + */
> > +
> > +#include <asm/platform.h>
> > +
> > +static bool rcar3_smc(struct cpu_user_regs *regs)
> > +{
> > +    return false;
> > +}
> > +
> > +static const char *const rcar3_dt_compat[] __initconst =
> > +{
> > +    "renesas,r8a7795",
> > +    "renesas,r8a7796",
> >
> 
> 
> Please note that since Linux commit:
> "9c9f7891093b02eb64ca4e1c7ab776a4296c058f soc: renesas: Identify R-Car
> M3-W+"
> the compatible string for R-Car M3-W+ (ES3.0) SoC is "renesas,r8a77961". So
> in case we want to have vSCMI feature on this new SoC revision as well we
> will need
> to extend the compatible list.
> 

Thank you for the point, this will be fixed in v2.

Best regards,
Oleksii

> 
> +    NULL
> > +};
> > +
> > +PLATFORM_START(rcar3, "Renesas R-Car Gen3")
> > +    .compatible = rcar3_dt_compat,
> > +    .smc = rcar3_smc
> > +PLATFORM_END
> > +
> > +/*
> > + * Local variables:
> > + * mode: C
> > + * c-file-style: "BSD"
> > + * c-basic-offset: 4
> > + * indent-tabs-mode: nil
> > + * End:
> > + */
> > --
> > 2.27.0
> >
> >
> 
> -- 
> Regards,
> 
> Oleksandr Tyshchenko
diff mbox series

Patch

diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile
index 8632f4115f..b64c25de6c 100644
--- a/xen/arch/arm/platforms/Makefile
+++ b/xen/arch/arm/platforms/Makefile
@@ -4,6 +4,7 @@  obj-$(CONFIG_ALL32_PLAT) += exynos5.o
 obj-$(CONFIG_ALL32_PLAT) += midway.o
 obj-$(CONFIG_ALL32_PLAT) += omap5.o
 obj-$(CONFIG_ALL32_PLAT) += rcar2.o
+obj-$(CONFIG_RCAR3) += rcar3.o
 obj-$(CONFIG_ALL64_PLAT) += seattle.o
 obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
diff --git a/xen/arch/arm/platforms/rcar3.c b/xen/arch/arm/platforms/rcar3.c
new file mode 100644
index 0000000000..d740145c71
--- /dev/null
+++ b/xen/arch/arm/platforms/rcar3.c
@@ -0,0 +1,46 @@ 
+/*
+ * xen/arch/arm/platforms/rcar3.c
+ *
+ * Renesas R-Car Gen3 specific settings
+ *
+ * Oleksii Moisieiev <oleksii_moisieiev@epam.com>
+ * Copyright (C) 2021 EPAM Systems
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/platform.h>
+
+static bool rcar3_smc(struct cpu_user_regs *regs)
+{
+    return false;
+}
+
+static const char *const rcar3_dt_compat[] __initconst =
+{
+    "renesas,r8a7795",
+    "renesas,r8a7796",
+    NULL
+};
+
+PLATFORM_START(rcar3, "Renesas R-Car Gen3")
+    .compatible = rcar3_dt_compat,
+    .smc = rcar3_smc
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */