aboutsummaryrefslogtreecommitdiffstats
path: root/plat
diff options
context:
space:
mode:
authorAntonio Niño Díaz <antonio.ninodiaz@arm.com>2018-10-25 15:00:38 +0200
committerGitHub <noreply@github.com>2018-10-25 15:00:38 +0200
commit31abc7c45428398a330a3a940fe4dd7efa6c96f2 (patch)
treea2f331f87347189eff75fea67b937e9463167145 /plat
parentdeca6584fffc4be70e07fca9e88c6fab5580e4db (diff)
parent8c7b55f9322351db6b23b8e928efc9546313dcdf (diff)
downloadplatform_external_arm-trusted-firmware-31abc7c45428398a330a3a940fe4dd7efa6c96f2.tar.gz
platform_external_arm-trusted-firmware-31abc7c45428398a330a3a940fe4dd7efa6c96f2.tar.bz2
platform_external_arm-trusted-firmware-31abc7c45428398a330a3a940fe4dd7efa6c96f2.zip
Merge pull request #1638 from chandnich/sgi575-update
Sgi575 update
Diffstat (limited to 'plat')
-rw-r--r--plat/arm/board/sgi575/fdts/sgi575.dts21
-rw-r--r--plat/arm/board/sgi575/fdts/sgi575_tb_fw_config.dts (renamed from plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts)0
-rw-r--r--plat/arm/board/sgi575/include/platform_def.h18
-rw-r--r--plat/arm/board/sgi575/platform.mk24
-rw-r--r--plat/arm/css/sgi/fdts/sgi575.dts11
-rw-r--r--plat/arm/css/sgi/include/sgi_base_platform_def.h (renamed from plat/arm/css/sgi/include/platform_def.h)13
-rw-r--r--plat/arm/css/sgi/include/sgi_plat_config.h43
-rw-r--r--plat/arm/css/sgi/sgi-common.mk26
-rw-r--r--plat/arm/css/sgi/sgi_bl1_setup.c19
-rw-r--r--plat/arm/css/sgi/sgi_bl31_setup.c4
-rw-r--r--plat/arm/css/sgi/sgi_image_load.c29
-rw-r--r--plat/arm/css/sgi/sgi_interconnect.c1
-rw-r--r--plat/arm/css/sgi/sgi_plat_config.c55
-rw-r--r--plat/arm/css/sgi/sgi_topology.c11
14 files changed, 87 insertions, 188 deletions
diff --git a/plat/arm/board/sgi575/fdts/sgi575.dts b/plat/arm/board/sgi575/fdts/sgi575.dts
new file mode 100644
index 000000000..1e1ea14b0
--- /dev/null
+++ b/plat/arm/board/sgi575/fdts/sgi575.dts
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/dts-v1/;
+/ {
+ /* compatible string */
+ compatible = "arm,sgi575";
+
+ /*
+ * Place holder for system-id node with default values. The
+ * value of platform-id and config-id will be set to the
+ * correct values during the BL2 stage of boot.
+ */
+ system-id {
+ platform-id = <0x0>;
+ config-id = <0x0>;
+ };
+};
diff --git a/plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts b/plat/arm/board/sgi575/fdts/sgi575_tb_fw_config.dts
index 315fa6999..315fa6999 100644
--- a/plat/arm/css/sgi/fdts/sgi575_tb_fw_config.dts
+++ b/plat/arm/board/sgi575/fdts/sgi575_tb_fw_config.dts
diff --git a/plat/arm/board/sgi575/include/platform_def.h b/plat/arm/board/sgi575/include/platform_def.h
new file mode 100644
index 000000000..1870fc78a
--- /dev/null
+++ b/plat/arm/board/sgi575/include/platform_def.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef PLATFORM_DEF_H
+#define PLATFORM_DEF_H
+
+#include <sgi_base_platform_def.h>
+
+#define PLAT_ARM_CLUSTER_COUNT 2
+#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
+#define CSS_SGI_MAX_PE_PER_CPU 1
+
+#define PLAT_CSS_MHU_BASE 0x45000000
+
+#endif /* PLATFORM_DEF_H */
diff --git a/plat/arm/board/sgi575/platform.mk b/plat/arm/board/sgi575/platform.mk
index 078f393c9..8df8b1292 100644
--- a/plat/arm/board/sgi575/platform.mk
+++ b/plat/arm/board/sgi575/platform.mk
@@ -6,9 +6,31 @@
include plat/arm/css/sgi/sgi-common.mk
+SGI575_BASE = plat/arm/board/sgi575
+
+PLAT_INCLUDES += -I${SGI575_BASE}/include/
+
+SGI_CPU_SOURCES := lib/cpus/aarch64/cortex_a75.S
+
+BL1_SOURCES += ${SGI_CPU_SOURCES}
+
BL2_SOURCES += lib/utils/mem_region.c \
plat/arm/common/arm_nor_psci_mem_protect.c
-BL31_SOURCES += drivers/cfi/v2m/v2m_flash.c \
+BL31_SOURCES += ${SGI_CPU_SOURCES} \
+ drivers/cfi/v2m/v2m_flash.c \
lib/utils/mem_region.c \
plat/arm/common/arm_nor_psci_mem_protect.c
+
+# Add the FDT_SOURCES and options for Dynamic Config
+FDT_SOURCES += ${SGI575_BASE}/fdts/${PLAT}_tb_fw_config.dts
+TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
+
+# Add the TB_FW_CONFIG to FIP and specify the same to certtool
+$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config))
+
+FDT_SOURCES += ${SGI575_BASE}/fdts/${PLAT}.dts
+HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
+
+# Add the HW_CONFIG to FIP and specify the same to certtool
+$(eval $(call TOOL_ADD_PAYLOAD,${HW_CONFIG},--hw-config))
diff --git a/plat/arm/css/sgi/fdts/sgi575.dts b/plat/arm/css/sgi/fdts/sgi575.dts
deleted file mode 100644
index be9920cbc..000000000
--- a/plat/arm/css/sgi/fdts/sgi575.dts
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/dts-v1/;
-/ {
- /* compatible string */
- compatible = "arm,sgi575";
-};
diff --git a/plat/arm/css/sgi/include/platform_def.h b/plat/arm/css/sgi/include/sgi_base_platform_def.h
index 629749056..90eb3360b 100644
--- a/plat/arm/css/sgi/include/platform_def.h
+++ b/plat/arm/css/sgi/include/sgi_base_platform_def.h
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef PLATFORM_DEF_H
-#define PLATFORM_DEF_H
+#ifndef SGI_BASE_PLATFORM_DEF_H
+#define SGI_BASE_PLATFORM_DEF_H
#include <arm_def.h>
#include <arm_spm_def.h>
@@ -17,11 +17,6 @@
#include <v2m_def.h>
#include <xlat_tables_defs.h>
-#define CSS_SGI_MAX_CPUS_PER_CLUSTER 4
-
-/* CPU topology */
-#define PLAT_ARM_CLUSTER_COUNT 2
-#define CSS_SGI_MAX_PE_PER_CPU 1
#define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \
CSS_SGI_MAX_CPUS_PER_CLUSTER * \
CSS_SGI_MAX_PE_PER_CPU)
@@ -118,8 +113,6 @@
#define PLAT_ARM_NSTIMER_FRAME_ID 0
-#define PLAT_CSS_MHU_BASE 0x45000000
-
#define PLAT_ARM_TRUSTED_ROM_BASE 0x0
#define PLAT_ARM_TRUSTED_ROM_SIZE 0x00080000 /* 512KB */
@@ -216,4 +209,4 @@
V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE)
-#endif /* PLATFORM_DEF_H */
+#endif /* SGI_BASE_PLATFORM_DEF_H */
diff --git a/plat/arm/css/sgi/include/sgi_plat_config.h b/plat/arm/css/sgi/include/sgi_plat_config.h
deleted file mode 100644
index 9b29d74e4..000000000
--- a/plat/arm/css/sgi/include/sgi_plat_config.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef __SGI_PLAT_CONFIG_H__
-#define __SGI_PLAT_CONFIG_H__
-
-#include <ccn.h>
-#include <gicv3.h>
-
-/* The type of interconnect */
-typedef enum {
- ARM_CCI = 0,
- ARM_CCN,
- ARM_CMN
-} css_inteconn_type_t;
-
-typedef ccn_desc_t inteconn_desc_t;
-
-/* Interconnect configurations */
-typedef struct css_inteconn_config {
- css_inteconn_type_t ip_type;
- const inteconn_desc_t *plat_inteconn_desc;
-} css_inteconn_config_t;
-
-/* Topology configurations */
-typedef struct css_topology {
- const unsigned char *power_tree;
- unsigned int plat_cluster_core_count;
-} css_topology_t;
-
-typedef struct css_plat_config {
- const gicv3_driver_data_t *gic_data;
- const css_inteconn_config_t *inteconn;
- const css_topology_t *topology;
-} css_plat_config_t;
-
-void plat_config_init(void);
-css_plat_config_t *get_plat_config(void);
-
-#endif /* __SGI_PLAT_CONFIG_H__ */
diff --git a/plat/arm/css/sgi/sgi-common.mk b/plat/arm/css/sgi/sgi-common.mk
index 24f03dd4b..d6e5448de 100644
--- a/plat/arm/css/sgi/sgi-common.mk
+++ b/plat/arm/css/sgi/sgi-common.mk
@@ -22,8 +22,6 @@ INTERCONNECT_SOURCES := ${CSS_ENT_BASE}/sgi_interconnect.c
PLAT_INCLUDES += -I${CSS_ENT_BASE}/include
-ENT_CPU_SOURCES := lib/cpus/aarch64/cortex_a75.S
-
ENT_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v3/gicv3_main.c \
drivers/arm/gic/v3/gicv3_helpers.c \
@@ -35,38 +33,20 @@ ENT_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
PLAT_BL_COMMON_SOURCES += ${CSS_ENT_BASE}/sgi_plat.c \
${CSS_ENT_BASE}/aarch64/sgi_helper.S
-BL1_SOURCES += ${INTERCONNECT_SOURCES} \
- ${ENT_CPU_SOURCES} \
- ${CSS_ENT_BASE}/sgi_bl1_setup.c \
- ${CSS_ENT_BASE}/sgi_plat_config.c
+BL1_SOURCES += ${INTERCONNECT_SOURCES}
BL2_SOURCES += ${CSS_ENT_BASE}/sgi_security.c \
${CSS_ENT_BASE}/sgi_image_load.c
-BL31_SOURCES += ${ENT_CPU_SOURCES} \
- ${INTERCONNECT_SOURCES} \
+BL31_SOURCES += ${INTERCONNECT_SOURCES} \
${ENT_GIC_SOURCES} \
${CSS_ENT_BASE}/sgi_bl31_setup.c \
- ${CSS_ENT_BASE}/sgi_topology.c \
- ${CSS_ENT_BASE}/sgi_plat_config.c
+ ${CSS_ENT_BASE}/sgi_topology.c
ifeq (${RAS_EXTENSION},1)
BL31_SOURCES += ${CSS_ENT_BASE}/sgi_ras.c
endif
-# Add the FDT_SOURCES and options for Dynamic Config
-FDT_SOURCES += ${CSS_ENT_BASE}/fdts/${PLAT}_tb_fw_config.dts
-TB_FW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}_tb_fw_config.dtb
-
-# Add the TB_FW_CONFIG to FIP and specify the same to certtool
-$(eval $(call TOOL_ADD_PAYLOAD,${TB_FW_CONFIG},--tb-fw-config))
-
-FDT_SOURCES += ${CSS_ENT_BASE}/fdts/${PLAT}.dts
-HW_CONFIG := ${BUILD_PLAT}/fdts/${PLAT}.dtb
-
-# Add the HW_CONFIG to FIP and specify the same to certtool
-$(eval $(call TOOL_ADD_PAYLOAD,${HW_CONFIG},--hw-config))
-
ifneq (${RESET_TO_BL31},0)
$(error "Using BL31 as the reset vector is not supported on ${PLATFORM} platform. \
Please set RESET_TO_BL31 to 0.")
diff --git a/plat/arm/css/sgi/sgi_bl1_setup.c b/plat/arm/css/sgi/sgi_bl1_setup.c
deleted file mode 100644
index d3d98d92a..000000000
--- a/plat/arm/css/sgi/sgi_bl1_setup.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <bl_common.h>
-#include <debug.h>
-#include <plat_arm.h>
-#include <sgi_plat_config.h>
-#include <soc_css.h>
-
-void bl1_early_platform_setup(void)
-{
- /* Initialize the platform configuration structure */
- plat_config_init();
-
- arm_bl1_early_platform_setup();
-}
diff --git a/plat/arm/css/sgi/sgi_bl31_setup.c b/plat/arm/css/sgi/sgi_bl31_setup.c
index 3b651f3dc..a16343cf0 100644
--- a/plat/arm/css/sgi/sgi_bl31_setup.c
+++ b/plat/arm/css/sgi/sgi_bl31_setup.c
@@ -7,7 +7,6 @@
#include <bl_common.h>
#include <debug.h>
#include <plat_arm.h>
-#include <sgi_plat_config.h>
#include <sgi_ras.h>
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
@@ -28,9 +27,6 @@ scmi_channel_plat_info_t *plat_css_get_scmi_info()
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
- /* Initialize the platform configuration structure */
- plat_config_init();
-
arm_bl31_early_platform_setup((void *)arg0, arg1, arg2, (void *)arg3);
}
diff --git a/plat/arm/css/sgi/sgi_image_load.c b/plat/arm/css/sgi/sgi_image_load.c
index 09403f884..52dcf889e 100644
--- a/plat/arm/css/sgi/sgi_image_load.c
+++ b/plat/arm/css/sgi/sgi_image_load.c
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <arch_helpers.h>
#include <debug.h>
#include <desc_image_load.h>
#include <libfdt.h>
@@ -13,6 +14,7 @@
* This function inserts Platform information via device tree nodes as,
* system-id {
* platform-id = <0>;
+ * config-id = <0>;
* }
******************************************************************************/
static int plat_sgi_append_config_node(void)
@@ -20,7 +22,7 @@ static int plat_sgi_append_config_node(void)
bl_mem_params_node_t *mem_params;
void *fdt;
int nodeoffset, err;
- unsigned int platid = 0;
+ unsigned int platid = 0, platcfg = 0;
char *platform_name;
mem_params = get_bl_mem_params_node(HW_CONFIG_ID);
@@ -45,31 +47,34 @@ static int plat_sgi_append_config_node(void)
}
if (strcmp(platform_name, "arm,sgi575") == 0) {
- platid = mmio_read_32(SSC_VERSION);
+ platid = mmio_read_32(SSC_VERSION) & SSC_VERSION_PART_NUM_MASK;
+ platcfg = (mmio_read_32(SSC_VERSION) >> SSC_VERSION_CONFIG_SHIFT)
+ & SSC_VERSION_CONFIG_MASK;
} else {
WARN("Invalid platform\n");
return -1;
}
- /* Increase DTB blob by 512 byte */
- err = fdt_open_into(fdt, fdt, mem_params->image_info.image_size + 512);
- if (err < 0) {
- ERROR("Failed to open HW_CONFIG DTB\n");
+ nodeoffset = fdt_subnode_offset(fdt, 0, "system-id");
+ if (nodeoffset < 0) {
+ ERROR("Failed to get system-id node offset\n");
return -1;
}
- /* Create "/system-id" node */
- nodeoffset = fdt_add_subnode(fdt, 0, "system-id");
- if (nodeoffset < 0) {
- ERROR("Failed to add node system-id\n");
+ err = fdt_setprop_u32(fdt, nodeoffset, "platform-id", platid);
+ if (err < 0) {
+ ERROR("Failed to set platform-id\n");
return -1;
}
- err = fdt_setprop_u32(fdt, nodeoffset, "platform-id", platid);
+ err = fdt_setprop_u32(fdt, nodeoffset, "config-id", platcfg);
if (err < 0) {
- ERROR("Failed to add node platform-id\n");
+ ERROR("Failed to set config-id\n");
return -1;
}
+
+ flush_dcache_range((uintptr_t)fdt, mem_params->image_info.image_size);
+
return 0;
}
diff --git a/plat/arm/css/sgi/sgi_interconnect.c b/plat/arm/css/sgi/sgi_interconnect.c
index 325b5b152..074f8a274 100644
--- a/plat/arm/css/sgi/sgi_interconnect.c
+++ b/plat/arm/css/sgi/sgi_interconnect.c
@@ -6,7 +6,6 @@
#include <arch_helpers.h>
#include <debug.h>
-#include <sgi_plat_config.h>
/*
* For SGI575 which support FCM (with automatic interconnect enter/exit),
diff --git a/plat/arm/css/sgi/sgi_plat_config.c b/plat/arm/css/sgi/sgi_plat_config.c
deleted file mode 100644
index 29b99a3c2..000000000
--- a/plat/arm/css/sgi/sgi_plat_config.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include <assert.h>
-#include <debug.h>
-#include <plat_arm.h>
-#include <platform_def.h>
-#include <sgi_variant.h>
-#include <sgi_plat_config.h>
-#include <string.h>
-
-static css_plat_config_t *css_plat_info;
-
-/* GIC */
-/* The GICv3 driver only needs to be initialized in EL3 */
-uintptr_t rdistif_base_addrs[PLATFORM_CORE_COUNT];
-
-/* Interconnect configuration for SGI575 */
-const css_inteconn_config_t sgi575_inteconn = {
- .ip_type = ARM_CMN,
- .plat_inteconn_desc = NULL
-};
-
-/* Configuration structure for SGI575 */
-css_plat_config_t sgi575_config = {
- .inteconn = &sgi575_inteconn,
-};
-
-/*******************************************************************************
- * This function initializes the platform sturcture.
- ******************************************************************************/
-void plat_config_init(void)
-{
- /* Get the platform configurations */
- switch (GET_SGI_PART_NUM) {
- case SGI575_SSC_VER_PART_NUM:
- css_plat_info = &sgi575_config;
- break;
- default:
- ERROR("Not a valid sgi variant!\n");
- panic();
- }
-}
-
-/*******************************************************************************
- * This function returns the platform structure pointer.
- ******************************************************************************/
-css_plat_config_t *get_plat_config(void)
-{
- assert(css_plat_info != NULL);
- return css_plat_info;
-}
diff --git a/plat/arm/css/sgi/sgi_topology.c b/plat/arm/css/sgi/sgi_topology.c
index 3f6357bd1..3b7a57ad2 100644
--- a/plat/arm/css/sgi/sgi_topology.c
+++ b/plat/arm/css/sgi/sgi_topology.c
@@ -5,7 +5,6 @@
*/
#include <plat_arm.h>
-#include <sgi_plat_config.h>
/* Topology */
/*
@@ -20,18 +19,12 @@ const unsigned char sgi_pd_tree_desc[] = {
CSS_SGI_MAX_CPUS_PER_CLUSTER
};
-/* Topology configuration for sgi platform */
-const css_topology_t sgi_topology = {
- .power_tree = sgi_pd_tree_desc,
- .plat_cluster_core_count = CSS_SGI_MAX_CPUS_PER_CLUSTER
-};
-
/*******************************************************************************
* This function returns the topology tree information.
******************************************************************************/
const unsigned char *plat_get_power_domain_tree_desc(void)
{
- return sgi_topology.power_tree;
+ return sgi_pd_tree_desc;
}
/*******************************************************************************
@@ -40,7 +33,7 @@ const unsigned char *plat_get_power_domain_tree_desc(void)
******************************************************************************/
unsigned int plat_arm_get_cluster_core_count(u_register_t mpidr)
{
- return sgi_topology.plat_cluster_core_count;
+ return CSS_SGI_MAX_CPUS_PER_CLUSTER;
}
/*******************************************************************************