MPC8xx Idle support for 2.4.28
PATCH 1/1 MPC8xx Idle support for 2.4.28
Hi there
The following patch implements idling support for the 8xx.
The patch works on the DUET family and the Normal Low mode but could also work on other 8xxs easily; I just don't have access to any other boards.
It's 2.4 for now since most people with 8xx's are on 2.4 still.
By using it on a 870 I see a power savings of ~400mW on a 133MHz/66MHz.
Regards
Pantelis
P.S. Many thanks to Mr. Conn Clark a.k.a. Obscene_CNN, for it's only patch on an attempt.
P.S #2. There are alot of errata regarding PLPRCR for 8xx, on older revisions of 8xx. Make sure you read them...
Signed-off-by Pantelis Antoniou <[email protected]>
arch/ppc/8xx_io/Config.in +7 -0
@@ -4,10 +4,17 @@ mainmenu_option next_comment comment 'MPC8xx Options' +if [ "$CONFIG_8xx_SMC1" = "y" -o "$CONFIG_8xx_SMC2" = "y" -o \ + "$CONFIG_8xx_SCC1" = "y" -o "$CONFIG_8xx_SCC2" = "y" -o \ + "$CONFIG_8xx_SCC3" = "y" -o "$CONFIG_8xx_SCC4" = "y" ]; then + define_bool CONFIG_8xx_STD_SERIAL y +fi + comment 'Generic MPC8xx Options' bool 'Copy-Back Data Cache (else Writethrough)' CONFIG_8xx_COPYBACK bool 'CPU6 Silicon Errata (860 Pre Rev. C)' CONFIG_8xx_CPU6 bool 'I2C/SPI Microcode Patch' CONFIG_UCODE_PATCH +bool 'DUET support (87x/88x)' CONFIG_DUET comment 'MPC8xx CPM Options' if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
arch/ppc/config.in +15 -0
@@ -55,6 +55,21 @@ define_bool CONFIG_PPC_STD_MMU y fi +if [ "$CONFIG_8xx" = "y" ]; then + bool 'MPC8xx CPU Idle Support' CONFIG_8xx_IDLE + if [ "$CONFIG_8xx_IDLE" = "y" ]; then + if [ "$CONFIG_DUET" != "y" ]; then + choice 'Idle method' \ + "Normal-Low CONFIG_8xx_IDLE_NORMAL_LOW \ + Doze-High CONFIG_8xx_IDLE_DOZE_HIGH \ + Doze-Low CONFIG_8xx_IDLE_DOZE_LOW" CONFIG_8xx_IDLE_NORMAL_LOW + else + # DUET only supports NORMAL_LOW mode + define_bool CONFIG_8xx_IDLE_NORMAL_LOW y + fi + fi +fi + if [ "$CONFIG_8260" = "y" ]; then define_bool CONFIG_SERIAL_CONSOLE y define_bool CONFIG_CPM2 y
arch/ppc/kernel/Makefile +6 -1
@@ -40,7 +40,11 @@ semaphore.o syscalls.o setup.o \ cputable.o ppc_htab.o ifneq ($(CONFIG_6xx),y) -obj-y += idle_gen.o + ifeq ($(CONFIG_8xx_IDLE),y) + obj-y += idle_8xx.o + else + obj-y += idle_gen.o + endif endif obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o obj-$(CONFIG_MODULES) += ppc_ksyms.o
@@ -102,6 +106,7 @@ head_44x.o: head_44x.S ppc_defs.h head_8xx.o: head_8xx.S ppc_defs.h idle_6xx.o: idle_6xx.S ppc_defs.h +idle_8xx.o: idle_8xx.S ppc_defs.h ppc_defs.h: mk_defs.c ppc_defs.head \ $(TOPDIR)/include/asm/mmu.h \
arch/ppc/kernel/cputable.c +5 -1
@@ -408,7 +408,11 @@ {/* 8xx */ 0xffff0000 ,0x00500000 ,"8xx" ,/* CPU_FTR_CAN_DOZE is possible, if the 8xx code is there.... */ -CPU_FTR_SPLIT_ID_CACHE |CPU_FTR_USE_TB , + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB +#ifdef CONFIG_8xx_IDLE + |CPU_FTR_CAN_DOZE +#endif + ,PPC_FEATURE_32 |PPC_FEATURE_HAS_MMU ,16 ,16 , __setup_cpu_8xx/* Empty */
arch/ppc/kernel/head_8xx.S +9 -3
@@ -667,11 +667,11 @@ SAVE_8GPRS(24, r21) andi. r23,r23,MSR_PR mfspr r23,SPRG3 /* if from user, fix up THREAD.regs */ - beq 2f + addi r2,r23,-THREAD /* set r2 to current */ + beq 0f addi r24,r1,STACK_FRAME_OVERHEAD stw r24,PT_REGS(r23) -2: addi r2,r23,-THREAD /* set r2 to current */ - tovirt(r2,r2) +0: tovirt(r2,r2) mflr r23 andi. r24,r23,0x3f00 /* get vector offset */ stw r24,TRAP(r21)
@@ -683,7 +683,13 @@ cmplw 1,r1,r24 crand 1,1,4 bgt- stack_ovf /* if r2 < r1 < r2+TASK_STRUCT_SIZE */ + lwz r24,0(r23) /* virtual address of handler */ +#ifdef CONFIG_8xx_IDLE + mtctr r24 /* save to ctr */ + lis r24,power_save_8xx_restore@h + ori r24,r24,power_save_8xx_restore@l +#endif lwz r23,4(r23) /* where to go when done */ mtspr SRR0,r24 mtspr SRR1,r20
arch/ppc/kernel/idle_8xx.S +114 -0
114 lines not on this page · raw message
arch/ppc/kernel/m8xx_setup.c +109 -26
207 lines not on this page · raw message
}