Merge pull request #1638 from chandnich/sgi575-update

Sgi575 update
This commit is contained in:
Antonio Niño Díaz 2018-10-25 15:00:38 +02:00 committed by GitHub
commit 31abc7c454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 88 additions and 189 deletions

View File

@ -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>;
};
};

View File

@ -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 */

View File

@ -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))

View File

@ -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";
};

View File

@ -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 */

View File

@ -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__ */

View File

@ -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.")

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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");
return -1;
}
/* Create "/system-id" node */
nodeoffset = fdt_add_subnode(fdt, 0, "system-id");
nodeoffset = fdt_subnode_offset(fdt, 0, "system-id");
if (nodeoffset < 0) {
ERROR("Failed to add node system-id\n");
ERROR("Failed to get system-id node offset\n");
return -1;
}
err = fdt_setprop_u32(fdt, nodeoffset, "platform-id", platid);
if (err < 0) {
ERROR("Failed to add node platform-id\n");
ERROR("Failed to set platform-id\n");
return -1;
}
err = fdt_setprop_u32(fdt, nodeoffset, "config-id", platcfg);
if (err < 0) {
ERROR("Failed to set config-id\n");
return -1;
}
flush_dcache_range((uintptr_t)fdt, mem_params->image_info.image_size);
return 0;
}

View File

@ -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),

View File

@ -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;
}

View File

@ -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;
}
/*******************************************************************************