Skip to contentSkip to conversation

ARM: l2c: Maintain CPU endianness for early resume function

PATCH Superseded Dmitry Osipenko 3 participants 4 messages Jan 20, 2015 – Mar 15, 2015

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ARM: l2c: Maintain CPU endianness for early resume function

In big endian CPU mode l2x0_saved_regs structure stores registers values in BE format. In order to maintain BE CPU mode, these values and immediate constants must be converted back to LE format before writing them to cache controller.

---
 arch/arm/mm/l2c-l2x0-resume.S | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mm/l2c-l2x0-resume.S +10 -0
index fda415e..9f99c7e 100644
@@ -30,6 +30,15 @@ ENTRY(l2c310_early_resume)
 	teq	r1, #0
 	reteq	lr
 
+	@ Reverse for big endian kernel
+ARM_BE8(rev	r2, r2)
+ARM_BE8(rev	r3, r3)
+ARM_BE8(rev	r4, r4)
+ARM_BE8(rev	r5, r5)
+ARM_BE8(rev	r6, r6)
+ARM_BE8(rev	r7, r7)
+ARM_BE8(rev	r8, r8)
+
 	@ The prefetch and power control registers are revision dependent
 	@ and can be written whether or not the L2 cache is enabled
 	ldr	r0, [r1, #L2X0_CACHE_ID]
@@ -51,6 +60,7 @@ ENTRY(l2c310_early_resume)
 
 	str	r2, [r1, #L2X0_AUX_CTRL]
 	mov	r9, #L2X0_CTRL_EN
+ARM_BE8(rev	r9, r9)
 	str	r9, [r1, #L2X0_CTRL]
 	ret	lr
 ENDPROC(l2c310_early_resume)
Signature · 1 line
2.2.1
#1 lore raw
Quoted 8 lines · Dmitry Osipenko

In big endian CPU mode l2x0_saved_regs structure stores registers values in BE format. In order to maintain BE CPU mode, these values and immediate constants must be converted back to LE format before writing them to cache controller.

---
 arch/arm/mm/l2c-l2x0-resume.S | 10 ++++++++++
 1 file changed, 10 insertions(+)

Hi Russell,

Did you get a chance yet to review this patch? It's a dependency for enabling big-endian support on Tegra. As such, I wonder if you would be willing to ack it, so that I can take it through the Tegra tree along with the rest of the patches.

If you prefer to take it through the ARM tree, that's fine, too. In that case would you be able to provide a stable branch that I can merge into the Tegra tree to resolve the dependency?

Thanks,
Thierry

Quoted 36 lines
arch/arm/mm/l2c-l2x0-resume.S +10 -0
index fda415e..9f99c7e 100644
@@ -30,6 +30,15 @@ ENTRY(l2c310_early_resume)
 	teq	r1, #0
 	reteq	lr
 
+	@ Reverse for big endian kernel
+ARM_BE8(rev	r2, r2)
+ARM_BE8(rev	r3, r3)
+ARM_BE8(rev	r4, r4)
+ARM_BE8(rev	r5, r5)
+ARM_BE8(rev	r6, r6)
+ARM_BE8(rev	r7, r7)
+ARM_BE8(rev	r8, r8)
+
 	@ The prefetch and power control registers are revision dependent
 	@ and can be written whether or not the L2 cache is enabled
 	ldr	r0, [r1, #L2X0_CACHE_ID]
@@ -51,6 +60,7 @@ ENTRY(l2c310_early_resume)
 
 	str	r2, [r1, #L2X0_AUX_CTRL]
 	mov	r9, #L2X0_CTRL_EN
+ARM_BE8(rev	r9, r9)
 	str	r9, [r1, #L2X0_CTRL]
 	ret	lr
 ENDPROC(l2c310_early_resume)
Signature · 7 lines
2.2.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150311/3b95639a/attachment.sig>

Acked-by Russell King
#2 lore raw
Quoted 10 lines · Thierry Reding
Quoted 8 lines · Dmitry Osipenko

In big endian CPU mode l2x0_saved_regs structure stores registers values in BE format. In order to maintain BE CPU mode, these values and immediate constants must be converted back to LE format before writing them to cache controller.

---
 arch/arm/mm/l2c-l2x0-resume.S | 10 ++++++++++
 1 file changed, 10 insertions(+)
Quoted 6 lines

Hi Russell,

Did you get a chance yet to review this patch? It's a dependency for enabling big-endian support on Tegra. As such, I wonder if you would be willing to ack it, so that I can take it through the Tegra tree along with the rest of the patches.

Yes, it's fallen through the cracks.

Thanks.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
#3 lore raw
In reply to Thierry Reding

11.03.2015 13:18, Thierry Reding ?????:

Quoted 56 lines · Dmitry Osipenko
Quoted 8 lines

In big endian CPU mode l2x0_saved_regs structure stores registers values in BE format. In order to maintain BE CPU mode, these values and immediate constants must be converted back to LE format before writing them to cache controller.

---
  arch/arm/mm/l2c-l2x0-resume.S | 10 ++++++++++
  1 file changed, 10 insertions(+)

Hi Russell,

Did you get a chance yet to review this patch? It's a dependency for enabling big-endian support on Tegra. As such, I wonder if you would be willing to ack it, so that I can take it through the Tegra tree along with the rest of the patches.

If you prefer to take it through the ARM tree, that's fine, too. In that case would you be able to provide a stable branch that I can merge into the Tegra tree to resolve the dependency?

Thanks,
Thierry

Quoted 32 lines
arch/arm/mm/l2c-l2x0-resume.S +10 -1
index fda415e..9f99c7e 100644
@@ -30,6 +30,15 @@ ENTRY(l2c310_early_resume)
  	teq	r1, #0
  	reteq	lr
 
+	@ Reverse for big endian kernel
+ARM_BE8(rev	r2, r2)
+ARM_BE8(rev	r3, r3)
+ARM_BE8(rev	r4, r4)
+ARM_BE8(rev	r5, r5)
+ARM_BE8(rev	r6, r6)
+ARM_BE8(rev	r7, r7)
+ARM_BE8(rev	r8, r8)
+
  	@ The prefetch and power control registers are revision dependent
  	@ and can be written whether or not the L2 cache is enabled
  	ldr	r0, [r1, #L2X0_CACHE_ID]
@@ -51,6 +60,7 @@ ENTRY(l2c310_early_resume)
 
  	str	r2, [r1, #L2X0_AUX_CTRL]
  	mov	r9, #L2X0_CTRL_EN
+ARM_BE8(rev	r9, r9)
  	str	r9, [r1, #L2X0_CTRL]
  	ret	lr
  ENDPROC(l2c310_early_resume)
--

2.2.1

Quoted 4 lines
Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

This patch missed register reverse for "ldr". Please hold it, I'll send v3.

Signature · 1 line
Dmitry