diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2011-10-07 05:13:05 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-19 19:57:52 (GMT) |
commit | 6c53cea1d6b8be0d68e10ac1fb7bd1383da24c40 (patch) | |
tree | 93329c75aab0870e16727d85426eb685d304fa33 /arch | |
parent | cb06e9191a42ce2506be575410ab9cbdbe074f1d (diff) | |
download | linux-fsl-qoriq-6c53cea1d6b8be0d68e10ac1fb7bd1383da24c40.tar.xz |
Add Freescale CodeWarrior support for kernel
Linux kernel on 85xx platform.
ppc: IPROT needs bo be cleared to boot up Linux when enabling CW debug
when CodeWarrior debug is enabled, PROT needs bo be
cleared to boot up Linux.
Signed-off-by: Bogdan Adrin <drian.bogdan@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Conflicts:
arch/powerpc/Kconfig.debug
Change-Id: Ia86a8b5e064eb52c70d5a7247fad7f025c2bc1d3
Reviewed-on: http://git.am.freescale.net:8181/1621
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Kconfig.debug | 2 | ||||
-rw-r--r-- | arch/powerpc/Makefile | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/reg_booke.h | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/fsl_booke_entry_mapping.S | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_fsl_booke.S | 11 | ||||
-rw-r--r-- | arch/powerpc/kernel/idle.c | 5 |
6 files changed, 26 insertions, 4 deletions
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index 90e85c6..ece0e7e 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug @@ -124,7 +124,7 @@ config BDI_SWITCH config DEBUG_CW bool "Include CodeWarrior kernel debugging" - depends on DEBUG_KERNEL + depends on DEBUG_KERNEL && PPC32 help Say Y here to enable CodeWarrior kernel debugging. diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 8168d06..0624909 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -131,6 +131,11 @@ KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) # often slow when they are implemented at all KBUILD_CFLAGS += -mno-string +ifeq ($(CONFIG_DEBUG_CW),y) +CFLAGS += -g2 -gdwarf-2 +AFLAGS_KERNEL += -Wa,-gdwarf2 +endif + ifeq ($(CONFIG_6xx),y) KBUILD_CFLAGS += -mcpu=powerpc endif diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h index 5dac6b2..2bc7704 100644 --- a/arch/powerpc/include/asm/reg_booke.h +++ b/arch/powerpc/include/asm/reg_booke.h @@ -42,7 +42,11 @@ #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE) #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) #else +#if defined(CONFIG_DEBUG_CW) +#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE|MSR_DE) +#else #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE) +#endif #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) #endif diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S b/arch/powerpc/kernel/fsl_booke_entry_mapping.S index 9638e50..3a8e2d8 100644 --- a/arch/powerpc/kernel/fsl_booke_entry_mapping.S +++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S @@ -121,6 +121,9 @@ skpinv: addi r6,r6,1 /* Increment */ xori r6,r4,1 slwi r6,r6,5 /* setup new context with other address space */ +#if defined(CONFIG_DEBUG_CW) + ori r6,r6,MSR_DE@l /* enable DE bit for MSR */ +#endif bl 1f /* Find our address */ 1: mflr r9 rlwimi r7,r9,0,20,31 diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S index 987a3f1..1206f0b 100644 --- a/arch/powerpc/kernel/head_fsl_booke.S +++ b/arch/powerpc/kernel/head_fsl_booke.S @@ -21,7 +21,7 @@ * debbie_chu@mvista.com * Copyright 2002-2004 MontaVista Software, Inc. * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org> - * Copyright 2004 Freescale Semiconductor, Inc + * Copyright 2004,2010 Freescale Semiconductor, Inc * PowerPC e500 modifications, Kumar Gala <galak@kernel.crashing.org> * * This program is free software; you can redistribute it and/or modify it @@ -149,7 +149,7 @@ _ENTRY(__early_start) mtspr SPRN_HID0, r2 #endif -#if !defined(CONFIG_BDI_SWITCH) +#if !defined(CONFIG_BDI_SWITCH) && !defined(CONFIG_DEBUG_CW) /* * The Abatron BDI JTAG debugger does not tolerate others * mucking with the debug registers. @@ -211,6 +211,13 @@ _ENTRY(__early_start) /* * Decide what sort of machine this is and initialize the MMU. */ +#if defined(CONFIG_DEBUG_CW) + lis r10, 0x1008 /* clear the V bit from the L2MMU_CAM8 register */ + mtspr SPRN_MAS0, r10 + lis r10, 0x0 + mtspr SPRN_MAS1, r10 + tlbwe +#endif mr r3,r30 mr r4,r31 bl machine_init diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index c6ac64b..3656e88 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c @@ -76,8 +76,11 @@ void cpu_idle(void) stop_critical_timings(); /* check again after disabling irqs */ - if (!need_resched() && !cpu_should_die()) + if (!need_resched() && !cpu_should_die()) { +#if !defined(CONFIG_DEBUG_CW) ppc_md.power_save(); +#endif + } start_critical_timings(); |