diff options
author | danh-arm <dan.handley@arm.com> | 2014-07-28 14:24:52 +0100 |
---|---|---|
committer | danh-arm <dan.handley@arm.com> | 2014-07-28 14:24:52 +0100 |
commit | d9b1128b438748ce7ccfd33804321da2eed6fcfd (patch) | |
tree | 838d8022c6db8516721432ec43bd64f7614516a9 /plat | |
parent | 592dd7cbe658cc33ae2818c9ed543ac57e97f784 (diff) | |
parent | 539a7b383d52493a94df4f5da8f74aa102429fa0 (diff) | |
download | trusted-firmware-a-d9b1128b438748ce7ccfd33804321da2eed6fcfd.tar.gz |
Merge pull request #169 from achingupta/ag/tf-issues#198
Ag/tf issues#198
Diffstat (limited to 'plat')
-rw-r--r-- | plat/common/aarch64/plat_common.c | 8 | ||||
-rw-r--r-- | plat/common/aarch64/platform_mp_stack.S | 34 | ||||
-rw-r--r-- | plat/common/aarch64/platform_up_stack.S | 25 | ||||
-rw-r--r-- | plat/fvp/aarch64/fvp_common.c | 2 | ||||
-rw-r--r-- | plat/fvp/fvp_pm.c | 18 | ||||
-rw-r--r-- | plat/fvp/include/platform_def.h | 7 |
6 files changed, 15 insertions, 79 deletions
diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c index 94b9dfdf02..90574fd664 100644 --- a/plat/common/aarch64/plat_common.c +++ b/plat/common/aarch64/plat_common.c @@ -38,12 +38,12 @@ #pragma weak bl31_plat_enable_mmu #pragma weak bl32_plat_enable_mmu -void bl31_plat_enable_mmu(void) +void bl31_plat_enable_mmu(uint32_t flags) { - enable_mmu_el3(); + enable_mmu_el3(flags); } -void bl32_plat_enable_mmu(void) +void bl32_plat_enable_mmu(uint32_t flags) { - enable_mmu_el1(); + enable_mmu_el1(flags); } diff --git a/plat/common/aarch64/platform_mp_stack.S b/plat/common/aarch64/platform_mp_stack.S index 801ec7fab6..8eb1aa6899 100644 --- a/plat/common/aarch64/platform_mp_stack.S +++ b/plat/common/aarch64/platform_mp_stack.S @@ -33,29 +33,12 @@ #include <platform_def.h> - .local pcpu_dv_mem_stack .local platform_normal_stacks .weak platform_set_stack .weak platform_get_stack - .weak platform_set_coherent_stack /* ----------------------------------------------------- - * void platform_set_coherent_stack (unsigned long mpidr) - * - * For a given CPU, this function sets the stack pointer - * to a stack allocated in device memory. This stack can - * be used by C code which enables/disables the SCTLR.M - * SCTLR.C bit e.g. while powering down a cpu - * ----------------------------------------------------- - */ -func platform_set_coherent_stack - mov x5, x30 // lr - get_mp_stack pcpu_dv_mem_stack, PCPU_DV_MEM_STACK_SIZE - mov sp, x0 - ret x5 - - /* ----------------------------------------------------- * unsigned long platform_get_stack (unsigned long mpidr) * * For a given CPU, this function returns the stack @@ -81,22 +64,9 @@ func platform_set_stack ret x9 /* ----------------------------------------------------- - * Per-cpu stacks in normal memory. - * Used for C code during runtime execution (when coherent - * stacks are not required). - * Each cpu gets a stack of PLATFORM_STACK_SIZE bytes. + * Per-cpu stacks in normal memory. Each cpu gets a + * stack of PLATFORM_STACK_SIZE bytes. * ----------------------------------------------------- */ declare_stack platform_normal_stacks, tzfw_normal_stacks, \ PLATFORM_STACK_SIZE, PLATFORM_CORE_COUNT - - /* ----------------------------------------------------- - * Per-cpu stacks in device memory. - * Used for C code just before power down or right after - * power up when the MMU or caches need to be turned on - * or off. - * Each cpu gets a stack of PCPU_DV_MEM_STACK_SIZE bytes. - * ----------------------------------------------------- - */ -declare_stack pcpu_dv_mem_stack, tzfw_coherent_mem, \ - PCPU_DV_MEM_STACK_SIZE, PLATFORM_CORE_COUNT diff --git a/plat/common/aarch64/platform_up_stack.S b/plat/common/aarch64/platform_up_stack.S index 45a96a6469..73b74b2eed 100644 --- a/plat/common/aarch64/platform_up_stack.S +++ b/plat/common/aarch64/platform_up_stack.S @@ -33,26 +33,9 @@ #include <platform_def.h> - .local pcpu_dv_mem_stack .local platform_normal_stacks .globl platform_set_stack .globl platform_get_stack - .globl platform_set_coherent_stack - - - /* ----------------------------------------------------- - * void platform_set_coherent_stack (unsigned long) - * - * For cold-boot BL images, only the primary CPU needs a - * stack. This function sets the stack pointer to a stack - * allocated in device memory. - * ----------------------------------------------------- - */ -func platform_set_coherent_stack - get_up_stack pcpu_dv_mem_stack, PCPU_DV_MEM_STACK_SIZE - mov sp, x0 - ret - /* ----------------------------------------------------- * unsigned long platform_get_stack (unsigned long) @@ -87,11 +70,3 @@ func platform_set_stack */ declare_stack platform_normal_stacks, tzfw_normal_stacks, \ PLATFORM_STACK_SIZE, 1 - - /* ----------------------------------------------------- - * Single cpu stack in device/coherent memory. - * PCPU_DV_MEM_STACK_SIZE bytes are allocated. - * ----------------------------------------------------- - */ -declare_stack pcpu_dv_mem_stack, tzfw_coherent_mem, \ - PCPU_DV_MEM_STACK_SIZE, 1 diff --git a/plat/fvp/aarch64/fvp_common.c b/plat/fvp/aarch64/fvp_common.c index 3fe3a218fa..3926239713 100644 --- a/plat/fvp/aarch64/fvp_common.c +++ b/plat/fvp/aarch64/fvp_common.c @@ -119,7 +119,7 @@ const unsigned int num_sec_irqs = sizeof(irq_sec_array) / mmap_add(fvp_mmap); \ init_xlat_tables(); \ \ - enable_mmu_el##_el(); \ + enable_mmu_el##_el(0); \ } /* Define EL1 and EL3 variants of the function initialising the MMU */ diff --git a/plat/fvp/fvp_pm.c b/plat/fvp/fvp_pm.c index 55f465ba14..22e53e123f 100644 --- a/plat/fvp/fvp_pm.c +++ b/plat/fvp/fvp_pm.c @@ -120,11 +120,10 @@ exit: * platform to decide whether the cluster is being turned off and take apt * actions. * - * CAUTION: This function is called with coherent stacks so that caches can be - * turned off, flushed and coherency disabled. There is no guarantee that caches - * will remain turned on across calls to this function as each affinity level is - * dealt with. So do not write & read global variables across calls. It will be - * wise to do flush a write to the global to prevent unpredictable results. + * CAUTION: There is no guarantee that caches will remain turned on across calls + * to this function as each affinity level is dealt with. So do not write & read + * global variables across calls. It will be wise to do flush a write to the + * global to prevent unpredictable results. ******************************************************************************/ int fvp_affinst_off(unsigned long mpidr, unsigned int afflvl, @@ -192,11 +191,10 @@ int fvp_affinst_off(unsigned long mpidr, * platform to decide whether the cluster is being turned off and take apt * actions. * - * CAUTION: This function is called with coherent stacks so that caches can be - * turned off, flushed and coherency disabled. There is no guarantee that caches - * will remain turned on across calls to this function as each affinity level is - * dealt with. So do not write & read global variables across calls. It will be - * wise to do flush a write to the global to prevent unpredictable results. + * CAUTION: There is no guarantee that caches will remain turned on across calls + * to this function as each affinity level is dealt with. So do not write & read + * global variables across calls. It will be wise to do flush a write to the + * global to prevent unpredictable results. ******************************************************************************/ int fvp_affinst_suspend(unsigned long mpidr, unsigned long sec_entrypoint, diff --git a/plat/fvp/include/platform_def.h b/plat/fvp/include/platform_def.h index ec4cf525eb..9983266309 100644 --- a/plat/fvp/include/platform_def.h +++ b/plat/fvp/include/platform_def.h @@ -47,13 +47,6 @@ /* Size of cacheable stacks */ #define PLATFORM_STACK_SIZE 0x800 -/* Size of coherent stacks for debug and release builds */ -#if DEBUG -#define PCPU_DV_MEM_STACK_SIZE 0x400 -#else -#define PCPU_DV_MEM_STACK_SIZE 0x300 -#endif - #define FIRMWARE_WELCOME_STR "Booting trusted firmware boot loader stage 1\n\r" /* Trusted Boot Firmware BL2 */ |