ci: use FVP_Base_RevC-2xAEMvA for aemva models

Currently base-aemv8a uses FVP_Base_RevC-2xAEMvA model, which is the
default choice whereas base-aemva is using FVP_Base_AEMvA model. To make
the a common naming let base-aemva also use the default model.

So after this patch both base-aemv8a and base-aemva are exactly same
which will be changed in a future patch to use only base-aemva
everywhere.

Change-Id: I2e071b504f755eae2b40ddecd5bb8df1def0d25e
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
(cherry picked from commit a60d807ca2a9977d9d240f64f963b5314051bf0c)
diff --git a/fvp_utils.sh b/fvp_utils.sh
index 5678b90..574b3da 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -48,7 +48,6 @@
 fvp_arm_std_library_11_17="fvp:fvp_arm_std_library_${model_version_11_17}_${model_build_11_17};/opt/model/FVP_ARM_Std_Library/FVP_Base"
 
 fvp_arm_std_library="fvp:fvp_arm_std_library_${model_version}_${model_build};/opt/model/FVP_ARM_Std_Library/FVP_Base"
-fvp_base_aemva="fvp:fvp_base_aemva_${model_version}_${model_build};/opt/model/FVP_Base_AEMvA/models/${model_flavour}"
 fvp_base_revc_2xaemva="fvp:fvp_base_revc-2xaemva_${model_version}_${model_build};/opt/model/Base_RevC_AEMvA_pkg/models/${model_flavour}"
 fvp_base_aemv8a_gic600ae="fvp:fvp_base_aemv8a-gic600ae_${model_version_11_17}_${model_build_11_17};/opt/model/FVP_Base_AEMv8A-GIC600AE_pkg/models/${model_flavour_11_17}"
 fvp_base_aemv8a_aemv8a_aemv8a_aemv8a_ccn502="fvp:fvp_base_aemv8a-aemv8a-aemv8a-aemv8a-ccn502_${model_version}_${model_build};/opt/model/FVP_Base_AEMv8A-AEMv8A-AEMv8A-AEMv8A-CCN502_pkg/models/${model_flavour}"
@@ -71,7 +70,7 @@
 [base-aemv8a-quad]="${fvp_base_aemv8a_aemv8a_aemv8a_aemv8a_ccn502};FVP_Base_AEMv8A-AEMv8A-AEMv8A-AEMv8A-CCN502"
 [base-aemv8a-revb]="${fvp_arm_std_library};FVP_Base_AEMvA-AEMvA"
 [base-aemv8a-latest-revb]="${fvp_arm_std_library};FVP_Base_AEMvA-AEMvA"
-[base-aemva]="${fvp_base_aemva};FVP_Base_AEMvA"
+[base-aemva]="${fvp_base_revc_2xaemva};FVP_Base_RevC-2xAEMvA"
 [base-aemv8a-gic600ae]="${fvp_base_aemv8a_gic600ae};FVP_Base_AEMv8A-GIC600AE"
 [base-aemv8a]="${fvp_base_revc_2xaemva};FVP_Base_RevC-2xAEMvA"
 [cortex-a32x4]="${fvp_arm_std_library};FVP_Base_Cortex-A32x4"
diff --git a/model/base-aemva.sh b/model/base-aemva.sh
index 58cf23b..595068d 100644
--- a/model/base-aemva.sh
+++ b/model/base-aemva.sh
@@ -1,19 +1,33 @@
 #!/usr/bin/env bash
 #
-# Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2019-2021, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 
-set_model_path "$warehouse/SysGen/Models/$model_version/$model_build/external/models/$model_flavour/FVP_Base_AEMvA"
+# Use revc model
+if  is_arm_jenkins_env || upon "$local_ci"; then
+	set_model_path "$warehouse/SysGen/Models/$model_version/$model_build/external/models/$model_flavour/FVP_Base_RevC-2xAEMvA"
 
-default_var sve_plugin_path "$warehouse/SysGen/PVModelLib/$model_version/$model_build/external/plugins/$model_flavour/sve2-HEAD/ScalableVectorExtension.so"
+	default_var sve_plugin_path "$warehouse/SysGen/PVModelLib/$model_version/$model_build/external/plugins/$model_flavour/sve2-HEAD/ScalableVectorExtension.so"
+	default_var etm_plugin_path "$warehouse/SysGen/PVModelLib/$model_version/$model_build/external/plugins/$model_flavour/ETMv4ExamplePlugin.so"
+	default_var ete_plugin_path "$warehouse/SysGen/PVModelLib/$model_version/$model_build/external/plugins/$model_flavour/libete-plugin.so"
+else
+        # OpenCI enviroment
+        source "$ci_root/fvp_utils.sh"
 
-default_var etm_plugin_path "$warehouse/SysGen/PVModelLib/$model_version/$model_build/external/plugins/$model_flavour/ETMv4ExamplePlugin.so"
+        # fvp_models variable contains the information for FVP paths, where 2nd field
+	# points to the /opt/model/*/models/${model_flavour}
+	models_dir="$(echo ${fvp_models[$model]} | awk -F ';' '{print $2}')"
+        set_model_path "$models_dir"
 
-default_var ete_plugin_path "$warehouse/SysGen/PVModelLib/$model_version/$model_build/external/plugins/$model_flavour/libete-plugin.so"
+        # ScalableVectorExtension is located at /opt/model/*/plugins/${model_flavour}
+        default_var sve_plugin_path "${models_dir/models/plugins}/ScalableVectorExtension.so"
+	default_var etm_plugin_path "${models_dir/models/plugins}/ETMv4ExamplePlugin.so"
+	default_var ete_plugin_path "${models_dir/models/plugins}/libete-plugin.so"
+fi
 
-default_var is_dual_cluster 0
+default_var is_dual_cluster 1
 
 source "$ci_root/model/base-aemva-common.sh"
 
@@ -23,3 +37,21 @@
 -C bp.terminal_2.start_port=5002
 -C bp.terminal_3.start_port=5003
 EOF
+
+# Base address for each redistributor
+if [ "$gicd_virtual_lpi" = "1" ]; then
+	cat <<EOF >>"$model_param_file"
+-C gic_distributor.reg-base-per-redistributor=0.0.0.0=0x2f100000,0.0.1.0=0x2f140000,0.0.2.0=0x2f180000,0.0.3.0=0x2f1c0000,0.1.0.0=0x2f200000,0.1.1.0=0x2f240000,0.1.2.0=0x2f280000,0.1.3.0=0x2f2c0000
+-C gic_distributor.print-memory-map=1
+EOF
+fi
+
+# GIC and pctl CPU affinity properties for aarch32.gicv2
+if [ "$aarch32" = "1" ] && [ "$gicv3_gicv2_only" = "1" ]; then
+        cat <<EOF >>"$model_param_file"
+-C gic_distributor.CPU-affinities=0.0.0.0,0.0.0.1,0.0.0.2,0.0.0.3,0.0.1.0,0.0.1.1,0.0.1.2,0.0.1.3
+-C pctl.CPU-affinities=0.0.0.0,0.0.0.1,0.0.0.2,0.0.0.3,0.0.1.0,0.0.1.1,0.0.1.2,0.0.1.3
+-C gic_distributor.reg-base-per-redistributor=0.0.0.0=0x2f100000,0.0.0.1=0x2f120000,0.0.0.2=0x2f140000,0.0.0.3=0x2f160000,0.0.1.0=0x2f180000,0.0.1.1=0x2f1a0000,0.0.1.2=0x2f1c0000,0.0.1.3=0x2f1e0000
+-C pctl.Affinity-shifted=0
+EOF
+fi