Merge changes I36e45c0a,I69c21293 into integration

* changes:
  plat/qemu: add "max" cpu support
  Add support for QEMU "max" CPU
This commit is contained in:
Manish Pandey 2021-04-27 11:44:31 +02:00 committed by TrustedFirmware Code Review
commit 815794220b
4 changed files with 108 additions and 1 deletions

View File

@ -0,0 +1,22 @@
/*
* Copyright (c) 2014-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef QEMU_MAX_H
#define QEMU_MAX_H
#include <lib/utils_def.h>
/*
* QEMU MAX midr for revision 0
* 00 - Reserved for software use
* 0 - Variant
* F - Architectural features identified in ID_* registers
* 051 - 'Q', in a 12-bit field.
* 0 - Revision
*/
#define QEMU_MAX_MIDR U(0x000F0510)
#endif /* QEMU_MAX_H */

View File

@ -0,0 +1,81 @@
/*
* Copyright (c) 2014-2021, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch.h>
#include <asm_macros.S>
#include <cpu_macros.S>
#include <qemu_max.h>
func qemu_max_core_pwr_dwn
/* ---------------------------------------------
* Disable the Data Cache.
* ---------------------------------------------
*/
mrs x1, sctlr_el3
bic x1, x1, #SCTLR_C_BIT
msr sctlr_el3, x1
isb
/* ---------------------------------------------
* Flush L1 cache to L2.
* ---------------------------------------------
*/
mov x18, lr
mov x0, #DCCISW
bl dcsw_op_level1
mov lr, x18
ret
endfunc qemu_max_core_pwr_dwn
func qemu_max_cluster_pwr_dwn
/* ---------------------------------------------
* Disable the Data Cache.
* ---------------------------------------------
*/
mrs x1, sctlr_el3
bic x1, x1, #SCTLR_C_BIT
msr sctlr_el3, x1
isb
/* ---------------------------------------------
* Flush all caches to PoC.
* ---------------------------------------------
*/
mov x0, #DCCISW
b dcsw_op_all
endfunc qemu_max_cluster_pwr_dwn
#if REPORT_ERRATA
/*
* Errata printing function for QEMU "max". Must follow AAPCS.
*/
func qemu_max_errata_report
ret
endfunc qemu_max_errata_report
#endif
/* ---------------------------------------------
* This function provides cpu specific
* register information for crash reporting.
* It needs to return with x6 pointing to
* a list of register names in ascii and
* x8 - x15 having values of registers to be
* reported.
* ---------------------------------------------
*/
.section .rodata.qemu_max_regs, "aS"
qemu_max_regs: /* The ascii list of register names to be reported */
.asciz "" /* no registers to report */
func qemu_max_cpu_reg_dump
adr x6, qemu_max_regs
ret
endfunc qemu_max_cpu_reg_dump
/* cpu_ops for QEMU MAX */
declare_cpu_ops qemu_max, QEMU_MAX_MIDR, CPU_NO_RESET_FUNC, \
qemu_max_core_pwr_dwn, \
qemu_max_cluster_pwr_dwn

View File

@ -109,6 +109,7 @@ BL1_SOURCES += lib/cpus/aarch64/aem_generic.S \
lib/cpus/aarch64/cortex_a53.S \
lib/cpus/aarch64/cortex_a57.S \
lib/cpus/aarch64/cortex_a72.S \
lib/cpus/aarch64/qemu_max.S \
else
BL1_SOURCES += lib/cpus/${ARCH}/cortex_a15.S
@ -163,6 +164,7 @@ BL31_SOURCES += lib/cpus/aarch64/aem_generic.S \
lib/cpus/aarch64/cortex_a53.S \
lib/cpus/aarch64/cortex_a57.S \
lib/cpus/aarch64/cortex_a72.S \
lib/cpus/aarch64/qemu_max.S \
lib/semihosting/semihosting.c \
lib/semihosting/${ARCH}/semihosting_call.S \
plat/common/plat_psci_common.c \

View File

@ -48,7 +48,8 @@ BL1_SOURCES += drivers/io/io_semihosting.c \
${PLAT_QEMU_COMMON_PATH}/qemu_bl1_setup.c
BL1_SOURCES += lib/cpus/aarch64/cortex_a57.S \
lib/cpus/aarch64/cortex_a72.S
lib/cpus/aarch64/cortex_a72.S \
lib/cpus/aarch64/qemu_max.S \
BL2_SOURCES += drivers/io/io_semihosting.c \
drivers/io/io_storage.c \
@ -76,6 +77,7 @@ QEMU_GIC_SOURCES := ${GICV3_SOURCES} \
BL31_SOURCES += lib/cpus/aarch64/cortex_a57.S \
lib/cpus/aarch64/cortex_a72.S \
lib/cpus/aarch64/qemu_max.S \
lib/semihosting/semihosting.c \
lib/semihosting/${ARCH}/semihosting_call.S \
plat/common/plat_psci_common.c \