aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/idle_book3e.S
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2022-09-19 19:01:42 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2022-09-26 23:00:14 +1000
commit6556fd1a1e9fcd180348c4368d2387bdc6a17613 (patch)
tree6502013ea72eec423dce6af604fb3bbc1ca658df /arch/powerpc/kernel/idle_book3e.S
parentpowerpc: Simplify redundant Kconfig tests (diff)
downloadlinux-dev-6556fd1a1e9fcd180348c4368d2387bdc6a17613.tar.xz
linux-dev-6556fd1a1e9fcd180348c4368d2387bdc6a17613.zip
powerpc: Cleanup idle for e500
e500 idle setup is a bit messy. e500_idle() is used for PPC32 while book3e_idle() is used for PPC64. As they are mutually exclusive, call them all e500_idle(). Use CONFIG_MPC_85xx instead of PPC32 + E500 in Makefile and rename idle_e500.c to idle_85xx.c . Rename idle_book3e.c to idle_64e.c and remove #ifdef PPC64 in as it's only built on PPC64. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/8039301334e948974c85ec5ef2db37751075185b.1663606876.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/idle_book3e.S')
-rw-r--r--arch/powerpc/kernel/idle_book3e.S103
1 files changed, 0 insertions, 103 deletions
diff --git a/arch/powerpc/kernel/idle_book3e.S b/arch/powerpc/kernel/idle_book3e.S
deleted file mode 100644
index cc008de58b05..000000000000
--- a/arch/powerpc/kernel/idle_book3e.S
+++ /dev/null
@@ -1,103 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Copyright 2010 IBM Corp, Benjamin Herrenschmidt <benh@kernel.crashing.org>
- *
- * Generic idle routine for Book3E processors
- */
-
-#include <linux/threads.h>
-#include <asm/reg.h>
-#include <asm/ppc_asm.h>
-#include <asm/asm-offsets.h>
-#include <asm/ppc-opcode.h>
-#include <asm/processor.h>
-#include <asm/thread_info.h>
-#include <asm/epapr_hcalls.h>
-#include <asm/hw_irq.h>
-
-/* 64-bit version only for now */
-#ifdef CONFIG_PPC64
-
-.macro BOOK3E_IDLE name loop
-_GLOBAL(\name)
- /* Save LR for later */
- mflr r0
- std r0,16(r1)
-
- /* Hard disable interrupts */
- wrteei 0
-
- /* Now check if an interrupt came in while we were soft disabled
- * since we may otherwise lose it (doorbells etc...).
- */
- lbz r3,PACAIRQHAPPENED(r13)
- cmpwi cr0,r3,0
- bne 2f
-
- /* Now we are going to mark ourselves as soft and hard enabled in
- * order to be able to take interrupts while asleep. We inform lockdep
- * of that. We don't actually turn interrupts on just yet tho.
- */
-#ifdef CONFIG_TRACE_IRQFLAGS
- stdu r1,-128(r1)
- bl trace_hardirqs_on
- addi r1,r1,128
-#endif
- li r0,IRQS_ENABLED
- stb r0,PACAIRQSOFTMASK(r13)
-
- /* Interrupts will make use return to LR, so get something we want
- * in there
- */
- bl 1f
-
- /* And return (interrupts are on) */
- ld r0,16(r1)
- mtlr r0
- blr
-
-1: /* Let's set the _TLF_NAPPING flag so interrupts make us return
- * to the right spot
- */
- ld r11, PACACURRENT(r13)
- ld r10,TI_LOCAL_FLAGS(r11)
- ori r10,r10,_TLF_NAPPING
- std r10,TI_LOCAL_FLAGS(r11)
-
- /* We can now re-enable hard interrupts and go to sleep */
- wrteei 1
- \loop
-
-2:
- lbz r10,PACAIRQHAPPENED(r13)
- ori r10,r10,PACA_IRQ_HARD_DIS
- stb r10,PACAIRQHAPPENED(r13)
- blr
-.endm
-
-.macro BOOK3E_IDLE_LOOP
-1:
- PPC_WAIT(0)
- b 1b
-.endm
-
-/* epapr_ev_idle_start below is patched with the proper hcall
- opcodes during kernel initialization */
-.macro EPAPR_EV_IDLE_LOOP
-idle_loop:
- LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
-
-.global epapr_ev_idle_start
-epapr_ev_idle_start:
- li r3, -1
- nop
- nop
- nop
- b idle_loop
-.endm
-
-BOOK3E_IDLE epapr_ev_idle EPAPR_EV_IDLE_LOOP
-
-BOOK3E_IDLE book3e_idle BOOK3E_IDLE_LOOP
-
-#endif /* CONFIG_PPC64 */