Skip to contentSkip to conversation

sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

PATCH New Hans de Goede 3 participants 6 messages Oct 22, 2014 – Oct 23, 2014 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

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.

---
 include/configs/sun7i.h | 4 ++++
 1 file changed, 4 insertions(+)
include/configs/sun7i.h +4 -0
index 966cbd8..4a864b2 100644
@@ -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
 
 /*
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

Quoted 4 lines · Hans de Goede

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"

Quoted 12 lines

using the bootm_boot_mode environment variable.

---
 include/configs/sun7i.h | 4 ++++
 1 file changed, 4 insertions(+)
include/configs/sun7i.h +0 -0
index 966cbd8..4a864b2 100644

include/configs/sun7i.h line 40

Quoted 6 lines
include/configs/sun7i.h +3 -0
@@ -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.

#2 lore raw

PATCH 1/1 sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

Hi,

Quoted 15 lines · Ian Campbell
Quoted 4 lines · Hans de Goede

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"

Quoted 7 lines

using the bootm_boot_mode environment variable.

---
 include/configs/sun7i.h | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 14 lines

include/configs/sun7i.h line 40

Quoted 11 lines
include/configs/sun7i.h +3 -0
index 966cbd8..4a864b2 100644
@@ -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

#3 lore raw

PATCH 1/1 sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

In reply to Hans de Goede
Quoted 5 lines · Hans de Goede

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141022/9275f28c/attachment.pgp>
#4 lore raw

PATCH 1/1 sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

Hi Tom,

Quoted 10 lines · Tom Rini
Quoted 5 lines · Hans de Goede

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

#5 lore raw

PATCH 1/1 sun7i: Set CONFIG_ARMV7_SEC_BY_DEFAULT when CONFIG_OLD_KERNEL_COMPAT is set

Quoted 14 lines · Hans de Goede

Hi Tom,

Quoted 10 lines · Tom Rini
Quoted 5 lines · Hans de Goede

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.

Quoted 6 lines

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141023/d4b4dc69/attachment.pgp>