diff mbox

[U-Boot] sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

Message ID 1413985523-19303-1-git-send-email-hdegoede@redhat.com
State Superseded
Delegated to: Ian Campbell
Headers show

Commit Message

Hans de Goede Oct. 22, 2014, 1:45 p.m. UTC
Old kernels cannot handle booting in non-secure (hyp) mode, so when
CONFIG_OLD_KERNEL_COMPAT is set, also set CONFIG_ARMV7_SEC_BY_DEFAULT.

Note that whether to booting secure or non-secure can always be overriden
using the bootm_boot_mode environment variable.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/configs/sun7i.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ian Campbell Oct. 22, 2014, 6:57 p.m. UTC | #1
On Wed, 2014-10-22 at 15:45 +0200, Hans de Goede wrote:
> Old kernels cannot handle booting in non-secure (hyp) mode, so when
> CONFIG_OLD_KERNEL_COMPAT is set, also set CONFIG_ARMV7_SEC_BY_DEFAULT.
> 
> Note that whether to booting secure or non-secure can always be overriden

nits: "boot" (not booting, or s/whether to/ perhaps) and "overridden"

> using the bootm_boot_mode environment variable.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  include/configs/sun7i.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
> index 966cbd8..4a864b2 100644
> --- a/include/configs/sun7i.h
> +++ b/include/configs/sun7i.h
> @@ -35,6 +35,10 @@
>  #define CONFIG_ARMV7_PSCI		1
>  #define CONFIG_ARMV7_PSCI_NR_CPUS	2
>  #define CONFIG_ARMV7_SECURE_BASE	SUNXI_SRAM_B_BASE
> +#ifdef CONFIG_OLD_KERNEL_COMPAT
> +#define CONFIG_ARMV7_SEC_BY_DEFAULT	1
> +#endif

I think this would be better right after the NONSEC+VIRT defines just
above the context here, since they are related.

Ian.
Tom Rini Oct. 22, 2014, 7:24 p.m. UTC | #2
On Wed, Oct 22, 2014 at 03:45:23PM +0200, Hans de Goede wrote:

> Old kernels cannot handle booting in non-secure (hyp) mode, so when
> CONFIG_OLD_KERNEL_COMPAT is set, also set CONFIG_ARMV7_SEC_BY_DEFAULT.
> 
> Note that whether to booting secure or non-secure can always be overriden
> using the bootm_boot_mode environment variable.

This belongs in Kconfig.  If you want to make it really optional all the
same, make modifying it depend on CONFIG_EXPERT too.
Hans de Goede Oct. 23, 2014, 8:52 a.m. UTC | #3
Hi Tom,

On 10/22/2014 09:24 PM, Tom Rini wrote:
> On Wed, Oct 22, 2014 at 03:45:23PM +0200, Hans de Goede wrote:
> 
>> Old kernels cannot handle booting in non-secure (hyp) mode, so when
>> CONFIG_OLD_KERNEL_COMPAT is set, also set CONFIG_ARMV7_SEC_BY_DEFAULT.
>>
>> Note that whether to booting secure or non-secure can always be overriden
>> using the bootm_boot_mode environment variable.
> 
> This belongs in Kconfig.  If you want to make it really optional all the
> same, make modifying it depend on CONFIG_EXPERT too.

I understand where your coming from, but the problem is that
CONFIG_ARMV7_SEC_BY_DEFAULT as a Kconfig option should depend on
CONFIG_ARMV7_VIRT or CONFIG_ARMV7_NONSEC, which depend on
CONFIG_ARMV7_PSCI / CONFIG_ARMV7_PSCI_NR_CPUS and
CONFIG_ARMV7_SECURE_BASE, all of which are currently set
through include/configs/foo.h.

I know that the plan is to move all of these to Kconfig eventually,
but there still is a lot of figuring out how that exactly should be
done, and as such I believe that it is best to set
CONFIG_ARMV7_SEC_BY_DEFAULT the "old-fashioned" way for now.

Regards,

Hans
Hans de Goede Oct. 23, 2014, 8:52 a.m. UTC | #4
Hi,

On 10/22/2014 08:57 PM, Ian Campbell wrote:
> On Wed, 2014-10-22 at 15:45 +0200, Hans de Goede wrote:
>> Old kernels cannot handle booting in non-secure (hyp) mode, so when
>> CONFIG_OLD_KERNEL_COMPAT is set, also set CONFIG_ARMV7_SEC_BY_DEFAULT.
>>
>> Note that whether to booting secure or non-secure can always be overriden
> 
> nits: "boot" (not booting, or s/whether to/ perhaps) and "overridden"
> 
>> using the bootm_boot_mode environment variable.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  include/configs/sun7i.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
>> index 966cbd8..4a864b2 100644
>> --- a/include/configs/sun7i.h
>> +++ b/include/configs/sun7i.h
>> @@ -35,6 +35,10 @@
>>  #define CONFIG_ARMV7_PSCI		1
>>  #define CONFIG_ARMV7_PSCI_NR_CPUS	2
>>  #define CONFIG_ARMV7_SECURE_BASE	SUNXI_SRAM_B_BASE
>> +#ifdef CONFIG_OLD_KERNEL_COMPAT
>> +#define CONFIG_ARMV7_SEC_BY_DEFAULT	1
>> +#endif
> 
> I think this would be better right after the NONSEC+VIRT defines just
> above the context here, since they are related.

Fixed in my personal tree, I'll do a v2 as soon as the Kconfig
question Tom raised is answered.

Regards,

Hans
Tom Rini Oct. 23, 2014, 1:10 p.m. UTC | #5
On Thu, Oct 23, 2014 at 10:52:23AM +0200, Hans de Goede wrote:
> Hi Tom,
> 
> On 10/22/2014 09:24 PM, Tom Rini wrote:
> > On Wed, Oct 22, 2014 at 03:45:23PM +0200, Hans de Goede wrote:
> > 
> >> Old kernels cannot handle booting in non-secure (hyp) mode, so when
> >> CONFIG_OLD_KERNEL_COMPAT is set, also set CONFIG_ARMV7_SEC_BY_DEFAULT.
> >>
> >> Note that whether to booting secure or non-secure can always be overriden
> >> using the bootm_boot_mode environment variable.
> > 
> > This belongs in Kconfig.  If you want to make it really optional all the
> > same, make modifying it depend on CONFIG_EXPERT too.
> 
> I understand where your coming from, but the problem is that
> CONFIG_ARMV7_SEC_BY_DEFAULT as a Kconfig option should depend on
> CONFIG_ARMV7_VIRT or CONFIG_ARMV7_NONSEC, which depend on
> CONFIG_ARMV7_PSCI / CONFIG_ARMV7_PSCI_NR_CPUS and
> CONFIG_ARMV7_SECURE_BASE, all of which are currently set
> through include/configs/foo.h.

True, but lets fix it.  Ideally, we would have something to select
"ARMV7", but we don't yet, and I won't make that your pre-req.  All of
the above options are only used by sunxi and arndale and vexpress right
now.  Add arch/arm/cpu/armv7/Kconfig for the above ARMv7 options, source
it from arch/arm/Kconfig and make the contents be on if ARNDALE || CA15
|| SUNXI with a comment on needing to clean this up further once we have
more fine-grained selects on SoC features.
diff mbox

Patch

diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
index 966cbd8..4a864b2 100644
--- a/include/configs/sun7i.h
+++ b/include/configs/sun7i.h
@@ -35,6 +35,10 @@ 
 #define CONFIG_ARMV7_PSCI		1
 #define CONFIG_ARMV7_PSCI_NR_CPUS	2
 #define CONFIG_ARMV7_SECURE_BASE	SUNXI_SRAM_B_BASE
+#ifdef CONFIG_OLD_KERNEL_COMPAT
+#define CONFIG_ARMV7_SEC_BY_DEFAULT	1
+#endif
+
 #define CONFIG_SYS_CLK_FREQ		24000000
 
 /*