linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] ARM: compressed: move BE32 handling into head.S
Date: Mon,  5 Nov 2018 19:44:36 +0100	[thread overview]
Message-ID: <20181105184438.19494-5-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <20181105184438.19494-1-ard.biesheuvel@linaro.org>

The BE switch only takes 3 instructions, and is currently pulled into
the main startup code by the linker, which is not the nicest way to
do this. Let's just pull the code into head.S and enable it using
preprocessor conditionals.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm/boot/compressed/Makefile     |  8 --------
 arch/arm/boot/compressed/big-endian.S | 14 --------------
 arch/arm/boot/compressed/head.S       |  5 +++++
 3 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 01bf2585a0fa..d1862621556f 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -47,14 +47,6 @@ ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
 OBJS		+= head-sharpsl.o
 endif
 
-ifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
-ifeq ($(CONFIG_CPU_CP15),y)
-OBJS		+= big-endian.o
-else
-# The endian should be set by h/w design.
-endif
-endif
-
 #
 # We now have a PIC decompressor implementation.  Decompressors running
 # from RAM should not define ZTEXTADDR.  Decompressors running directly
diff --git a/arch/arm/boot/compressed/big-endian.S b/arch/arm/boot/compressed/big-endian.S
deleted file mode 100644
index 88e2a88d324b..000000000000
--- a/arch/arm/boot/compressed/big-endian.S
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- *  linux/arch/arm/boot/compressed/big-endian.S
- *
- *  Switch CPU into big endian mode.
- *  Author: Nicolas Pitre
- */
-
-	.section ".start", #alloc, #execinstr
-
-	mrc	p15, 0, r0, c1, c0, 0	@ read control reg
-	orr	r0, r0, #(1 << 7)	@ enable big endian mode
-	mcr	p15, 0, r0, c1, c0, 0	@ write control reg
-
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index da93f419d1f4..55c227077207 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -222,6 +222,11 @@ not_angel:
 #ifdef CONFIG_CPU_XSCALE
 		bl	__XScale_start
 #endif
+#if defined(CONFIG_CPU_ENDIAN_BE32) && defined(CONFIG_CPU_CP15)
+		mrc	p15, 0, r0, c1, c0, 0	@ read control reg
+		orr	r0, r0, #(1 << 7)	@ enable big endian mode
+		mcr	p15, 0, r0, c1, c0, 0	@ write control reg
+#endif
 
 #ifdef CONFIG_AUTO_ZRELADDR
 		/*
-- 
2.19.1

  parent reply	other threads:[~2018-11-05 18:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 18:44 [PATCH 0/6] ARM: compressed: clean up section layout and enable EFI debugging Ard Biesheuvel
2018-11-05 18:44 ` [PATCH 1/6] ARM: compressed: move sharpsl startup code into subroutine Ard Biesheuvel
2018-11-05 18:59   ` Russell King - ARM Linux
2018-11-05 19:07     ` Ard Biesheuvel
2018-11-05 19:13       ` Russell King - ARM Linux
2018-11-05 19:25   ` Nicolas Pitre
2018-11-05 19:35     ` Ard Biesheuvel
2018-11-05 18:44 ` [PATCH 2/6] ARM: compressed: move sa1100 " Ard Biesheuvel
2018-11-05 19:00   ` Russell King - ARM Linux
2018-11-05 18:44 ` [PATCH 3/6] ARM: compressed: move xscale " Ard Biesheuvel
2018-11-05 19:00   ` Russell King - ARM Linux
2018-11-05 18:44 ` Ard Biesheuvel [this message]
2018-11-05 18:44 ` [PATCH 5/6] ARM: compressed: put zImage header and EFI header in dedicated section Ard Biesheuvel
2018-11-05 18:44 ` [PATCH 6/6] ARM: efi: add PE/COFF debug table to EFI header Ard Biesheuvel
2018-11-05 19:09 ` [PATCH 0/6] ARM: compressed: clean up section layout and enable EFI debugging Russell King - ARM Linux
2018-11-05 19:10   ` Ard Biesheuvel
2018-11-05 19:14     ` Russell King - ARM Linux
2018-11-05 19:21       ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181105184438.19494-5-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).