From: Oleksandr Date: Tue, 12 Feb 2019 23:20:54 +0200 Subject: [U-Boot] [PATCH 1/3] ARM: rmobile: Switch CPU to non-secure HYP mode for r8a7790 based boards In-Reply-To: <2c8c8ea4-8c9f-b592-b62f-5c3b24911702@gmail.com> References: <1548956309-24113-1-git-send-email-olekstysh@gmail.com> <1548956309-24113-2-git-send-email-olekstysh@gmail.com> <795f212f-6178-b71a-c2de-5f84e38203e5@gmail.com> <285fafea-aaf4-a307-1f78-eb8752eb6904@gmail.com> <9c8a4b4b-5da5-23b5-80de-f629a7597e79@gmail.com> <557f3dd6-70a8-1039-6177-e70f3fb1c149@gmail.com> <2c8c8ea4-8c9f-b592-b62f-5c3b24911702@gmail.com> Message-ID: <33f18f1f-7e51-3aaf-78ae-efd6bf687f20@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On 09.02.19 18:37, Marek Vasut wrote: Hi >>>>>>> diff --git a/arch/arm/mach-rmobile/Kconfig.32 >>>>>>> b/arch/arm/mach-rmobile/Kconfig.32 >>>>>>> index 076a019..a2e9e3d 100644 >>>>>>> --- a/arch/arm/mach-rmobile/Kconfig.32 >>>>>>> +++ b/arch/arm/mach-rmobile/Kconfig.32 >>>>>>> @@ -76,6 +76,8 @@ config TARGET_LAGER >>>>>>>        select SUPPORT_SPL >>>>>>>        select USE_TINY_PRINTF >>>>>>>        imply CMD_DM >>>>>>> +    select CPU_V7_HAS_NONSEC >>>>>>> +    select CPU_V7_HAS_VIRT >>>>>> Shouldn't this be a H2 CPU property instead of a board property ? >>>>> Probably yes, sounds reasonable. I will move these options under >>>>> "config >>>>> R8A7790". >>>>> >>>>>> Does this apply to M2* too , since it has CA15 cores as well ? >>>>> I think, yes. But, without PSCI support being implemented for M2*, I >>>>> think it is not worth to select these options for it as well. >>>> It's basically the same SoC with two CPU cores less, how would that PSCI >>>> be any different on M2 ? >>> I need some time to investigate. I will come up with an answer later. >> From the first look: >> >> 1. It should be different total number of CPUs: >> >> For R8A7790 we have the following: >> >> #define R8A7790_PSCI_NR_CPUS    8 >> >> But for R8A7791 it seems we need to use: >> >> #define R8A7791_PSCI_NR_CPUS    2 > This information should be in the DT for each SoC, so you should extract > it from there. > >> 2. It should be new pm-r8a7791.c file which will don't have any CA7 >> related stuff (CPU cores, SCU, etc). > I'd like to have a generic pm-gen2.c file , which parses the DT and > figures the configuration out that way. We are trying to get rid of all > the ad-hoc hardcoded configuration stuff in favor of DT. > >> Or it should be the single pm-r8a779x.c which must distinguish what SoC >> is being used and do proper things. > Right I agree to have a single generic pm-gen2.c file which covers all Gen2 SoCs. But, unfortunately, I only have Stout boards (H2), and therefore can check only on them. This is why the current patch series adds support for H2 SoC only. Theoretically, I could add support for M2 as well, but, I wouldn't have possibility to check. I would focus on the r8a7790 for now, as the Stout board is our nearest target which we want to support in Xen and the PSCI feature is a mandatory option. What do you think?