Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
d03823d4
Unverified
Commit
d03823d4
authored
6 years ago
by
Antonio Niño Díaz
Committed by
GitHub
6 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #1650 from chandnich/sgiclark-ares-support
Sgiclark ares support
parents
b3f7c42d
b62b5b92
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
include/plat/arm/css/common/css_def.h
+7
-0
include/plat/arm/css/common/css_def.h
plat/arm/board/sgiclarka/fdts/sgiclarka.dts
+21
-0
plat/arm/board/sgiclarka/fdts/sgiclarka.dts
plat/arm/board/sgiclarka/fdts/sgiclarka_tb_fw_config.dts
+25
-0
plat/arm/board/sgiclarka/fdts/sgiclarka_tb_fw_config.dts
plat/arm/board/sgiclarka/include/platform_def.h
+18
-0
plat/arm/board/sgiclarka/include/platform_def.h
plat/arm/board/sgiclarka/platform.mk
+38
-0
plat/arm/board/sgiclarka/platform.mk
plat/arm/css/sgi/aarch64/sgi_helper.S
+9
-0
plat/arm/css/sgi/aarch64/sgi_helper.S
plat/arm/css/sgi/include/sgi_variant.h
+14
-3
plat/arm/css/sgi/include/sgi_variant.h
plat/arm/css/sgi/sgi_bl31_setup.c
+64
-1
plat/arm/css/sgi/sgi_bl31_setup.c
plat/arm/css/sgi/sgi_image_load.c
+4
-0
plat/arm/css/sgi/sgi_image_load.c
with
200 additions
and
4 deletions
+200
-4
include/plat/arm/css/common/css_def.h
View file @
d03823d4
...
@@ -26,6 +26,11 @@
...
@@ -26,6 +26,11 @@
#define SSC_REG_BASE 0x2a420000
#define SSC_REG_BASE 0x2a420000
#define SSC_GPRETN (SSC_REG_BASE + 0x030)
#define SSC_GPRETN (SSC_REG_BASE + 0x030)
/* System ID Registers Unit */
#define SID_REG_BASE 0x2a4a0000
#define SID_SYSTEM_ID_OFFSET 0x40
#define SID_SYSTEM_CFG_OFFSET 0x70
/* The slave_bootsecure controls access to GPU, DMC and CS. */
/* The slave_bootsecure controls access to GPU, DMC and CS. */
#define CSS_NIC400_SLAVE_BOOTSECURE 8
#define CSS_NIC400_SLAVE_BOOTSECURE 8
...
@@ -123,6 +128,8 @@
...
@@ -123,6 +128,8 @@
#define SSC_VERSION_DESIGNER_ID_MASK 0xff
#define SSC_VERSION_DESIGNER_ID_MASK 0xff
#define SSC_VERSION_PART_NUM_MASK 0xfff
#define SSC_VERSION_PART_NUM_MASK 0xfff
#define SID_SYSTEM_ID_PART_NUM_MASK 0xfff
/* SSC debug configuration registers */
/* SSC debug configuration registers */
#define SSC_DBGCFG_SET 0x14
#define SSC_DBGCFG_SET 0x14
#define SSC_DBGCFG_CLR 0x18
#define SSC_DBGCFG_CLR 0x18
...
...
This diff is collapsed.
Click to expand it.
plat/arm/board/sgiclarka/fdts/sgiclarka.dts
0 → 100644
View file @
d03823d4
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/dts-v1/;
/ {
/* compatible string */
compatible = "arm,sgi-clark";
/*
* 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>;
};
};
This diff is collapsed.
Click to expand it.
plat/arm/board/sgiclarka/fdts/sgiclarka_tb_fw_config.dts
0 → 100644
View file @
d03823d4
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/dts-v1/;
/ {
/* Platform Config */
compatible = "arm,tb_fw";
hw_config_addr = <0x0 0xFEF00000>;
hw_config_max_size = <0x0100000>;
/*
* The following two entries are placeholders for Mbed TLS
* heap information. The default values don't matter since
* they will be overwritten by BL1.
* In case of having shared Mbed TLS heap between BL1 and BL2,
* BL1 will populate these two properties with the respective
* info about the shared heap. This info will be available for
* BL2 in order to locate and re-use the heap.
*/
mbedtls_heap_addr = <0x0 0x0>;
mbedtls_heap_size = <0x0>;
};
This diff is collapsed.
Click to expand it.
plat/arm/board/sgiclarka/include/platform_def.h
0 → 100644
View file @
d03823d4
/*
* 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 0x45400000
#endif
/* PLATFORM_DEF_H */
This diff is collapsed.
Click to expand it.
plat/arm/board/sgiclarka/platform.mk
0 → 100644
View file @
d03823d4
#
# Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
include
plat/arm/css/sgi/sgi-common.mk
SGICLARKA_BASE
=
plat/arm/board/sgiclarka
PLAT_INCLUDES
+=
-I
${SGICLARKA_BASE}
/include/
SGI_CPU_SOURCES
:=
lib/cpus/aarch64/cortex_ares.S
BL1_SOURCES
+=
${SGI_CPU_SOURCES}
BL2_SOURCES
+=
lib/utils/mem_region.c
\
plat/arm/common/arm_nor_psci_mem_protect.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
+=
${SGICLARKA_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
+=
${SGICLARKA_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))
override CTX_INCLUDE_AARCH32_REGS
:
= 0
This diff is collapsed.
Click to expand it.
plat/arm/css/sgi/aarch64/sgi_helper.S
View file @
d03823d4
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <asm_macros.S>
#include <asm_macros.S>
#include <platform_def.h>
#include <platform_def.h>
#include <cortex_a75.h>
#include <cortex_a75.h>
#include <cortex_ares.h>
#include <cpu_macros.S>
#include <cpu_macros.S>
.
globl
plat_arm_calc_core_pos
.
globl
plat_arm_calc_core_pos
...
@@ -58,6 +59,7 @@ endfunc plat_arm_calc_core_pos
...
@@ -58,6 +59,7 @@ endfunc plat_arm_calc_core_pos
*/
*/
func
plat_reset_handler
func
plat_reset_handler
jump_if_cpu_midr
CORTEX_A75_MIDR
,
A75
jump_if_cpu_midr
CORTEX_A75_MIDR
,
A75
jump_if_cpu_midr
CORTEX_ARES_MIDR
,
ARES
ret
ret
/
*
-----------------------------------------------------
/
*
-----------------------------------------------------
...
@@ -70,4 +72,11 @@ A75:
...
@@ -70,4 +72,11 @@ A75:
msr
CORTEX_A75_CPUPWRCTLR_EL1
,
x0
msr
CORTEX_A75_CPUPWRCTLR_EL1
,
x0
isb
isb
ret
ret
ARES
:
mrs
x0
,
CORTEX_ARES_CPUPWRCTLR_EL1
bic
x0
,
x0
,
#
CORTEX_ARES_CORE_PWRDN_EN_MASK
msr
CORTEX_ARES_CPUPWRCTLR_EL1
,
x0
isb
ret
endfunc
plat_reset_handler
endfunc
plat_reset_handler
This diff is collapsed.
Click to expand it.
plat/arm/css/sgi/include/sgi_variant.h
View file @
d03823d4
...
@@ -4,10 +4,21 @@
...
@@ -4,10 +4,21 @@
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
#ifndef
__
SGI_VARIANT_H
__
#ifndef SGI_VARIANT_H
#define
__
SGI_VARIANT_H
__
#define SGI_VARIANT_H
/* SSC_VERSION values for SGI575 */
/* SSC_VERSION values for SGI575 */
#define SGI575_SSC_VER_PART_NUM 0x0783
#define SGI575_SSC_VER_PART_NUM 0x0783
#endif
/* __SGI_VARIANT_H__ */
/* SID Version values for SGI-Clark */
#define SGI_CLARK_SID_VER_PART_NUM 0x0786
/* Structure containing SGI platform variant information */
typedef
struct
sgi_platform_info
{
unsigned
int
platform_id
;
/* Part Number of the platform */
unsigned
int
config_id
;
/* Config Id of the platform */
}
sgi_platform_info_t
;
extern
sgi_platform_info_t
sgi_plat_info
;
#endif
/* SGI_VARIANT_H */
This diff is collapsed.
Click to expand it.
plat/arm/css/sgi/sgi_bl31_setup.c
View file @
d03823d4
...
@@ -4,13 +4,18 @@
...
@@ -4,13 +4,18 @@
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
#include <assert.h>
#include <bl_common.h>
#include <bl_common.h>
#include <debug.h>
#include <debug.h>
#include <libfdt.h>
#include <plat_arm.h>
#include <plat_arm.h>
#include <sgi_ras.h>
#include <sgi_ras.h>
#include <sgi_variant.h>
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/scmi/scmi.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
#include "../../css/drivers/mhu/css_mhu_doorbell.h"
sgi_platform_info_t
sgi_plat_info
;
static
scmi_channel_plat_info_t
sgi575_scmi_plat_info
=
{
static
scmi_channel_plat_info_t
sgi575_scmi_plat_info
=
{
.
scmi_mbx_mem
=
CSS_SCMI_PAYLOAD_BASE
,
.
scmi_mbx_mem
=
CSS_SCMI_PAYLOAD_BASE
,
.
db_reg_addr
=
PLAT_CSS_MHU_BASE
+
CSS_SCMI_MHU_DB_REG_OFF
,
.
db_reg_addr
=
PLAT_CSS_MHU_BASE
+
CSS_SCMI_MHU_DB_REG_OFF
,
...
@@ -19,14 +24,72 @@ static scmi_channel_plat_info_t sgi575_scmi_plat_info = {
...
@@ -19,14 +24,72 @@ static scmi_channel_plat_info_t sgi575_scmi_plat_info = {
.
ring_doorbell
=
&
mhu_ring_doorbell
,
.
ring_doorbell
=
&
mhu_ring_doorbell
,
};
};
static
scmi_channel_plat_info_t
sgi_clark_scmi_plat_info
=
{
.
scmi_mbx_mem
=
CSS_SCMI_PAYLOAD_BASE
,
.
db_reg_addr
=
PLAT_CSS_MHU_BASE
+
SENDER_REG_SET
(
0
),
.
db_preserve_mask
=
0xfffffffe
,
.
db_modify_mask
=
0x1
,
.
ring_doorbell
=
&
mhuv2_ring_doorbell
,
};
scmi_channel_plat_info_t
*
plat_css_get_scmi_info
()
scmi_channel_plat_info_t
*
plat_css_get_scmi_info
()
{
{
return
&
sgi575_scmi_plat_info
;
if
(
sgi_plat_info
.
platform_id
==
SGI_CLARK_SID_VER_PART_NUM
)
return
&
sgi_clark_scmi_plat_info
;
else
if
(
sgi_plat_info
.
platform_id
==
SGI575_SSC_VER_PART_NUM
)
return
&
sgi575_scmi_plat_info
;
else
panic
();
};
/*******************************************************************************
* This function sets the sgi_platform_id and sgi_config_id
******************************************************************************/
int
sgi_identify_platform
(
unsigned
long
hw_config
)
{
void
*
fdt
;
int
nodeoffset
;
const
unsigned
int
*
property
;
fdt
=
(
void
*
)
hw_config
;
/* Check the validity of the fdt */
assert
(
fdt_check_header
(
fdt
)
==
0
);
nodeoffset
=
fdt_subnode_offset
(
fdt
,
0
,
"system-id"
);
if
(
nodeoffset
<
0
)
{
ERROR
(
"Failed to get system-id node offset
\n
"
);
return
-
1
;
}
property
=
fdt_getprop
(
fdt
,
nodeoffset
,
"platform-id"
,
NULL
);
if
(
property
==
NULL
)
{
ERROR
(
"Failed to get platform-id property
\n
"
);
return
-
1
;
}
sgi_plat_info
.
platform_id
=
fdt32_to_cpu
(
*
property
);
property
=
fdt_getprop
(
fdt
,
nodeoffset
,
"config-id"
,
NULL
);
if
(
property
==
NULL
)
{
ERROR
(
"Failed to get config-id property
\n
"
);
return
-
1
;
}
sgi_plat_info
.
config_id
=
fdt32_to_cpu
(
*
property
);
return
0
;
}
}
void
bl31_early_platform_setup2
(
u_register_t
arg0
,
u_register_t
arg1
,
void
bl31_early_platform_setup2
(
u_register_t
arg0
,
u_register_t
arg1
,
u_register_t
arg2
,
u_register_t
arg3
)
u_register_t
arg2
,
u_register_t
arg3
)
{
{
int
ret
;
ret
=
sgi_identify_platform
(
arg2
);
if
(
ret
==
-
1
)
panic
();
arm_bl31_early_platform_setup
((
void
*
)
arg0
,
arg1
,
arg2
,
(
void
*
)
arg3
);
arm_bl31_early_platform_setup
((
void
*
)
arg0
,
arg1
,
arg2
,
(
void
*
)
arg3
);
}
}
...
...
This diff is collapsed.
Click to expand it.
plat/arm/css/sgi/sgi_image_load.c
View file @
d03823d4
...
@@ -50,6 +50,10 @@ static int plat_sgi_append_config_node(void)
...
@@ -50,6 +50,10 @@ static int plat_sgi_append_config_node(void)
platid
=
mmio_read_32
(
SSC_VERSION
)
&
SSC_VERSION_PART_NUM_MASK
;
platid
=
mmio_read_32
(
SSC_VERSION
)
&
SSC_VERSION_PART_NUM_MASK
;
platcfg
=
(
mmio_read_32
(
SSC_VERSION
)
>>
SSC_VERSION_CONFIG_SHIFT
)
platcfg
=
(
mmio_read_32
(
SSC_VERSION
)
>>
SSC_VERSION_CONFIG_SHIFT
)
&
SSC_VERSION_CONFIG_MASK
;
&
SSC_VERSION_CONFIG_MASK
;
}
else
if
(
strcmp
(
platform_name
,
"arm,sgi-clark"
)
==
0
)
{
platid
=
mmio_read_32
(
SID_REG_BASE
+
SID_SYSTEM_ID_OFFSET
)
&
SID_SYSTEM_ID_PART_NUM_MASK
;
platcfg
=
mmio_read_32
(
SID_REG_BASE
+
SID_SYSTEM_CFG_OFFSET
);
}
else
{
}
else
{
WARN
(
"Invalid platform
\n
"
);
WARN
(
"Invalid platform
\n
"
);
return
-
1
;
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help