diff options
author | Yatharth Kochar <yatharth.kochar@arm.com> | 2016-11-22 12:56:00 +0000 |
---|---|---|
committer | dp-arm <dimitris.papastamos@arm.com> | 2017-05-05 09:49:55 +0100 |
commit | addbe339968a102e5af3fb40d492043ccf9beb1d (patch) | |
tree | 35bbbff221818e13afb655fa93f29b16ce16875c /plat | |
parent | 57c10cb1df38c0c4befb31822d61ff651f2ffab2 (diff) |
AArch32: Add JUNO platform support
With A53_0 as the primary CPU and TFTF in release mode,
basic test cases are passing. Including powering off/on
the other CPU. Following are open issues:
* TFTF hangs in DEBUG mode, while testing System suspend cases.
* TFTF is not able to initialize NVM, so currently TFTF is
compiled with USE_NVM=0
Change-Id: I84ec23a32fff1b51a360ef6b253f846a77b75280
Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
Diffstat (limited to 'plat')
-rw-r--r-- | plat/arm/board/juno/aarch32/plat_helpers.S | 45 | ||||
-rw-r--r-- | plat/arm/board/juno/include/platform_def.h | 9 | ||||
-rw-r--r-- | plat/arm/board/juno/platform.mk | 9 | ||||
-rw-r--r-- | plat/common/tftf_nvm_accessors.c | 6 |
4 files changed, 63 insertions, 6 deletions
diff --git a/plat/arm/board/juno/aarch32/plat_helpers.S b/plat/arm/board/juno/aarch32/plat_helpers.S new file mode 100644 index 0000000..1f07d38 --- /dev/null +++ b/plat/arm/board/juno/aarch32/plat_helpers.S @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * Neither the name of ARM nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include <arch.h> +#include <asm_macros.S> + + .globl platform_get_core_pos + + /* + * Return 0 to 3 for the A53s and 4 or 5 for the A57s + */ +func platform_get_core_pos + and r1, r0, #MPIDR_CPU_MASK + and r0, r0, #MPIDR_CLUSTER_MASK + eor r0, r0, #(1 << MPIDR_AFF1_SHIFT) // swap A53/A57 order + add r0, r1, r0, LSR #6 + bx lr +endfunc platform_get_core_pos diff --git a/plat/arm/board/juno/include/platform_def.h b/plat/arm/board/juno/include/platform_def.h index 2c68ee6..25415dc 100644 --- a/plat/arm/board/juno/include/platform_def.h +++ b/plat/arm/board/juno/include/platform_def.h @@ -41,8 +41,13 @@ /******************************************************************************* * Platform binary types for linking ******************************************************************************/ -#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" -#define PLATFORM_LINKER_ARCH aarch64 +#ifndef AARCH32 +#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" +#define PLATFORM_LINKER_ARCH aarch64 +#else +#define PLATFORM_LINKER_FORMAT "elf32-littlearm" +#define PLATFORM_LINKER_ARCH arm +#endif /******************************************************************************* * Run-time address of the TFTF image. diff --git a/plat/arm/board/juno/platform.mk b/plat/arm/board/juno/platform.mk index 718e62d..daa0ce3 100644 --- a/plat/arm/board/juno/platform.mk +++ b/plat/arm/board/juno/platform.mk @@ -34,7 +34,7 @@ PLAT_SOURCES := drivers/arm/gic/arm_gic_v2.c \ drivers/arm/gic/gic_v2.c \ drivers/arm/sp805/sp805.c \ drivers/arm/timer/sp804.c \ - plat/arm/board/juno/aarch64/plat_helpers.S \ + plat/arm/board/juno/${ARCH}/plat_helpers.S \ plat/arm/board/juno/juno_pwr_state.c \ plat/arm/board/juno/juno_timers.c \ plat/arm/board/juno/juno_topology.c \ @@ -46,7 +46,12 @@ PLAT_SUPPORTS_NS_RESET := 1 $(eval $(call assert_boolean,PLAT_SUPPORTS_NS_RESET)) $(eval $(call add_define,PLAT_SUPPORTS_NS_RESET)) -# Firmware update is implemented on Juno. +ifeq (${ARCH},aarch32) +ifeq (${FIRMWARE_UPDATE},1) +$(error "FIRMWARE_UPDATE is not supported on Juno aarch32") +endif +else FIRMWARE_UPDATE := 1 +endif include plat/arm/common/arm_common.mk diff --git a/plat/common/tftf_nvm_accessors.c b/plat/common/tftf_nvm_accessors.c index 7bcca9b..853b8a8 100644 --- a/plat/common/tftf_nvm_accessors.c +++ b/plat/common/tftf_nvm_accessors.c @@ -77,7 +77,8 @@ fail: return STATUS_FAIL; #else - memcpy((void *)(DRAM_BASE + TFTF_NVM_OFFSET + offset), buffer, size); + uintptr_t addr = DRAM_BASE + TFTF_NVM_OFFSET + offset; + memcpy((void *)addr, buffer, size); #endif return STATUS_SUCCESS; @@ -115,7 +116,8 @@ fail: if (ret != IO_SUCCESS) return STATUS_FAIL; #else - memcpy(buffer, (void *)(DRAM_BASE + TFTF_NVM_OFFSET + offset), size); + uintptr_t addr = DRAM_BASE + TFTF_NVM_OFFSET + offset; + memcpy(buffer, (void *)addr, size); #endif return STATUS_SUCCESS; |