diff mbox

[1/6] ARM: add CPU_BE8_BOOT_LE configuration

Message ID 1371659404-20167-2-git-send-email-ben.dooks@codethink.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Dooks June 19, 2013, 4:29 p.m. UTC
Add configuration for booting a BE8 system from a LE boot environment.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/mm/Kconfig |    7 +++++++
 1 file changed, 7 insertions(+)

Comments

Thomas Petazzoni June 19, 2013, 5:29 p.m. UTC | #1
Dear Ben Dooks,

On Wed, 19 Jun 2013 17:29:58 +0100, Ben Dooks wrote:

> +config CPU_BE8_BOOT_LE
> +	bool "Boot BE system from LE loader"
> +	depends on CPU_ENDIAN_BE8
> +	help
> +	  Support for running BE-8 (big-endian) from a boot environment that is
> +	  running in LE mode.
> +

I'm not sure to understand how this option articulates with the
CPU_ENDIAN_BE8 option, because your other patch series ("Initial
big-endian support series") in its PATCH 4 ("ARM: set BE8 if LE in head
code") already switches the kernel into BE mode even if it's booted
from a Little Endian bootloader.

Maybe what you wanted to achieve is:

 * The first patch series "Initial big-endian support series" allows to
   run the kernel big-endian if the bootloader has booted it big-endian.

 * The second patch series "ARM big-endian - atags and loader updates",
   allows to run the kernel big-endian even if the bootloader started
   it little-endian.

In this case, then the PATCH 4 of your first patch series ("ARM: set
BE8 if LE in head code") should be in the second patch series, and
the code be conditional under CPU_BE8_BOOT_LE.

Or maybe I'm missing something?

Best regards,

Thomas
Ben Dooks June 20, 2013, 10:58 a.m. UTC | #2
On 19/06/13 18:29, Thomas Petazzoni wrote:
> Dear Ben Dooks,
>
> On Wed, 19 Jun 2013 17:29:58 +0100, Ben Dooks wrote:
>
>> +config CPU_BE8_BOOT_LE
>> +	bool "Boot BE system from LE loader"
>> +	depends on CPU_ENDIAN_BE8
>> +	help
>> +	  Support for running BE-8 (big-endian) from a boot environment that is
>> +	  running in LE mode.
>> +
>
> I'm not sure to understand how this option articulates with the
> CPU_ENDIAN_BE8 option, because your other patch series ("Initial
> big-endian support series") in its PATCH 4 ("ARM: set BE8 if LE in head
> code") already switches the kernel into BE mode even if it's booted
> from a Little Endian bootloader.
>
> Maybe what you wanted to achieve is:
>
>   * The first patch series "Initial big-endian support series" allows to
>     run the kernel big-endian if the bootloader has booted it big-endian.
>
>   * The second patch series "ARM big-endian - atags and loader updates",
>     allows to run the kernel big-endian even if the bootloader started
>     it little-endian.
>
> In this case, then the PATCH 4 of your first patch series ("ARM: set
> BE8 if LE in head code") should be in the second patch series, and
> the code be conditional under CPU_BE8_BOOT_LE.

I suppose the second series should be to allow little endian ATAGS
based loaders to boot the kernel. If the loader starts the kernel LE
with OF then it is easy to swap to big endian in the head code.

The secondary boots will always require the LE->BE switching as there
is no guarantee that if the primary processor started the kernel BE8
that any of the secondary cpus will be started in the same way.
diff mbox

Patch

diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 35955b5..2e1e70f 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -688,6 +688,13 @@  config CPU_ENDIAN_BE8
 	help
 	  Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
 
+config CPU_BE8_BOOT_LE
+	bool "Boot BE system from LE loader"
+	depends on CPU_ENDIAN_BE8
+	help
+	  Support for running BE-8 (big-endian) from a boot environment that is
+	  running in LE mode.
+
 config CPU_ENDIAN_BE32
 	bool
 	depends on CPU_BIG_ENDIAN