Skip to content
GitLab
Menu
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
18ff0b61
Unverified
Commit
18ff0b61
authored
Apr 01, 2019
by
Antonio Niño Díaz
Committed by
GitHub
Apr 01, 2019
Browse files
Merge pull request #1886 from ambroise-arm/av/static-checks
Fix extra compilation warnings
parents
9cadccdf
279faa6d
Changes
33
Show whitespace changes
Inline
Side-by-side
plat/arm/board/juno/juno_bl1_setup.c
View file @
18ff0b61
...
...
@@ -61,7 +61,7 @@ static int is_watchdog_reset(void)
******************************************************************************/
int
plat_arm_bl1_fwu_needed
(
void
)
{
const
u
int32_t
*
nv_flags_ptr
=
(
const
u
int32_t
*
)
V2M_SYS_NVFLAGS_ADDR
;
const
int32_t
*
nv_flags_ptr
=
(
const
int32_t
*
)
V2M_SYS_NVFLAGS_ADDR
;
/* Check if TOC is invalid or watchdog reset happened. */
if
((
arm_io_is_toc_valid
()
!=
1
)
||
...
...
plat/arm/board/juno/juno_err.c
View file @
18ff0b61
/*
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
9
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -7,6 +7,7 @@
#include <errno.h>
#include <arch_helpers.h>
#include <plat/arm/common/plat_arm.h>
#include <plat/common/platform.h>
#include <platform_def.h>
...
...
plat/arm/board/juno/juno_topology.c
View file @
18ff0b61
/*
* Copyright (c) 2016-201
8
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-201
9
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -20,7 +20,7 @@ static scmi_channel_plat_info_t juno_scmi_plat_info = {
.
ring_doorbell
=
&
mhu_ring_doorbell
,
};
scmi_channel_plat_info_t
*
plat_css_get_scmi_info
()
scmi_channel_plat_info_t
*
plat_css_get_scmi_info
(
void
)
{
return
&
juno_scmi_plat_info
;
}
...
...
plat/arm/board/sgi575/sgi575_plat.c
View file @
18ff0b61
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018
-2019
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <plat/common/platform.h>
#include <sgi_variant.h>
unsigned
int
plat_arm_sgi_get_platform_id
(
void
)
{
return
mmio_read_32
(
SSC_VERSION
)
&
SSC_VERSION_PART_NUM_MASK
;
...
...
plat/arm/board/sgi575/sgi575_security.c
View file @
18ff0b61
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018
-2019
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -8,6 +8,7 @@
#include <common/debug.h>
#include <drivers/arm/tzc_dmc620.h>
#include <plat/arm/common/plat_arm.h>
uintptr_t
sgi575_dmc_base
[]
=
{
SGI575_DMC620_BASE0
,
...
...
plat/arm/css/sgi/sgi_bl31_setup.c
View file @
18ff0b61
...
...
@@ -13,6 +13,7 @@
#include <drivers/arm/css/css_mhu_doorbell.h>
#include <drivers/arm/css/scmi.h>
#include <plat/arm/common/plat_arm.h>
#include <plat/common/platform.h>
#include <sgi_ras.h>
#include <sgi_variant.h>
...
...
@@ -35,7 +36,7 @@ static scmi_channel_plat_info_t rd_n1e1_edge_scmi_plat_info = {
.
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
(
void
)
{
if
(
sgi_plat_info
.
platform_id
==
RD_N1E1_EDGE_SID_VER_PART_NUM
)
return
&
rd_n1e1_edge_scmi_plat_info
;
...
...
@@ -43,7 +44,7 @@ scmi_channel_plat_info_t *plat_css_get_scmi_info()
return
&
sgi575_scmi_plat_info
;
else
panic
();
}
;
}
void
bl31_early_platform_setup2
(
u_register_t
arg0
,
u_register_t
arg1
,
u_register_t
arg2
,
u_register_t
arg3
)
...
...
plat/arm/css/sgi/sgi_interconnect.c
View file @
18ff0b61
/*
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2018
-2019
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <common/debug.h>
#include <plat/arm/common/plat_arm.h>
/*
* For SGI575 which support FCM (with automatic interconnect enter/exit),
...
...
plat/arm/css/sgi/sgi_topology.c
View file @
18ff0b61
...
...
@@ -5,6 +5,7 @@
*/
#include <plat/arm/common/plat_arm.h>
#include <plat/common/platform.h>
#include <sgi_variant.h>
...
...
plat/common/plat_spm_rd.c
View file @
18ff0b61
/*
* Copyright (c) 2018, Arm Limited. All rights reserved.
* Copyright (c) 2018
-2019
, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -14,6 +14,7 @@
#include <common/debug.h>
#include <common/fdt_wrappers.h>
#include <lib/object_pool.h>
#include <plat/common/platform.h>
#include <services/sp_res_desc.h>
/*******************************************************************************
...
...
plat/common/plat_spm_sp.c
View file @
18ff0b61
/*
* Copyright (c) 2018, Arm Limited. All rights reserved.
* Copyright (c) 2018
-2019
, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -9,6 +9,7 @@
#include <platform_def.h>
#include <common/debug.h>
#include <plat/common/platform.h>
#include <tools_share/sptool.h>
static
unsigned
int
sp_next
;
...
...
services/std_svc/spm/spci.c
View file @
18ff0b61
...
...
@@ -379,6 +379,41 @@ static uint64_t spci_service_request_blocking(void *handle,
SMC_RET4
(
handle
,
SPCI_SUCCESS
,
rx1
,
rx2
,
rx3
);
}
/*******************************************************************************
* This function handles the returned values from the Secure Partition.
******************************************************************************/
static
void
spci_handle_returned_values
(
const
cpu_context_t
*
cpu_ctx
,
uint64_t
ret
)
{
if
(
ret
==
SPRT_PUT_RESPONSE_AARCH64
)
{
uint32_t
token
;
uint64_t
x3
,
x4
,
x5
,
x6
;
token
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X1
);
x3
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X3
);
x4
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X4
);
x5
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X5
);
x6
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X6
);
uint16_t
client_id
=
x6
&
0xFFFFU
;
uint16_t
service_handle
=
x6
>>
16
;
int
rc
=
spm_response_add
(
client_id
,
service_handle
,
token
,
x3
,
x4
,
x5
);
if
(
rc
!=
0
)
{
/*
* This is error fatal because we can't return to the SP
* from this SMC. The SP has crashed.
*/
panic
();
}
}
else
if
((
ret
!=
SPRT_YIELD_AARCH64
)
&&
(
ret
!=
SPM_SECURE_PARTITION_PREEMPTED
))
{
ERROR
(
"SPM: %s: Unexpected x0 value 0x%llx
\n
"
,
__func__
,
ret
);
panic
();
}
}
/*******************************************************************************
* This function requests a Secure Service from a given handle and client ID.
******************************************************************************/
...
...
@@ -465,34 +500,8 @@ static uint64_t spci_service_request_start(void *handle,
/* Jump to the Secure Partition. */
uint64_t
ret
=
spm_sp_synchronous_entry
(
sp_ctx
,
1
);
/* Verify returned values */
if
(
ret
==
SPRT_PUT_RESPONSE_AARCH64
)
{
uint32_t
token
;
uint64_t
rx1
,
rx2
,
rx3
,
x6
;
token
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X1
);
rx1
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X3
);
rx2
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X4
);
rx3
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X5
);
x6
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X6
);
uint16_t
client_id
=
x6
&
0xFFFFU
;
uint16_t
service_handle
=
x6
>>
16
;
int
rc
=
spm_response_add
(
client_id
,
service_handle
,
token
,
rx1
,
rx2
,
rx3
);
if
(
rc
!=
0
)
{
/*
* This is error fatal because we can't return to the SP
* from this SMC. The SP has crashed.
*/
panic
();
}
}
else
if
((
ret
!=
SPRT_YIELD_AARCH64
)
&&
(
ret
!=
SPM_SECURE_PARTITION_PREEMPTED
))
{
ERROR
(
"SPM: %s: Unexpected x0 value 0x%llx
\n
"
,
__func__
,
ret
);
panic
();
}
/* Handle returned values */
spci_handle_returned_values
(
cpu_ctx
,
ret
);
/* Flag Secure Partition as idle. */
assert
(
sp_ctx
->
state
==
SP_STATE_BUSY
);
...
...
@@ -572,34 +581,8 @@ static uint64_t spci_service_request_resume(void *handle, u_register_t x1,
/* Jump to the Secure Partition. */
uint64_t
ret
=
spm_sp_synchronous_entry
(
sp_ctx
,
1
);
/* Verify returned values */
if
(
ret
==
SPRT_PUT_RESPONSE_AARCH64
)
{
uint32_t
token
;
uint64_t
rx1
,
rx2
,
rx3
,
x6
;
token
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X1
);
rx1
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X3
);
rx2
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X4
);
rx3
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X5
);
x6
=
read_ctx_reg
(
get_gpregs_ctx
(
cpu_ctx
),
CTX_GPREG_X6
);
uint16_t
client_id
=
x6
&
0xFFFFU
;
uint16_t
service_handle
=
x6
>>
16
;
int
rc
=
spm_response_add
(
client_id
,
service_handle
,
token
,
rx1
,
rx2
,
rx3
);
if
(
rc
!=
0
)
{
/*
* This is error fatal because we can't return to the SP
* from this SMC. The SP has crashed.
*/
panic
();
}
}
else
if
((
ret
!=
SPRT_YIELD_AARCH64
)
&&
(
ret
!=
SPM_SECURE_PARTITION_PREEMPTED
))
{
ERROR
(
"SPM: %s: Unexpected x0 value 0x%llx
\n
"
,
__func__
,
ret
);
panic
();
}
/* Handle returned values */
spci_handle_returned_values
(
cpu_ctx
,
ret
);
/* Flag Secure Partition as idle. */
assert
(
sp_ctx
->
state
==
SP_STATE_BUSY
);
...
...
services/std_svc/spm/spm_buffers.c
View file @
18ff0b61
/*
* Copyright (c) 2018, Arm Limited. All rights reserved.
* Copyright (c) 2018
-2019
, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -9,6 +9,8 @@
#include <lib/utils_def.h>
#include <platform_def.h>
#include "./spm_private.h"
/*******************************************************************************
* Secure Service response global array. All the responses to the requests done
* to the Secure Partition are stored here. They are removed from the array as
...
...
@@ -40,7 +42,7 @@ int spm_response_add(uint16_t client_id, uint16_t handle, uint32_t token,
}
}
for
(
int
i
=
0
;
i
<
ARRAY_SIZE
(
responses
);
i
++
)
{
for
(
unsigned
int
i
=
0
U
;
i
<
ARRAY_SIZE
(
responses
);
i
++
)
{
struct
sprt_response
*
resp
=
&
(
responses
[
i
]);
if
(
resp
->
is_valid
==
0
)
{
...
...
services/std_svc/spm/spm_main.c
View file @
18ff0b61
/*
* Copyright (c) 2017-201
8
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017-201
9
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -20,6 +20,7 @@
#include <lib/utils.h>
#include <lib/xlat_tables/xlat_tables_v2.h>
#include <plat/common/platform.h>
#include <services/spm_svc.h>
#include <services/sprt_svc.h>
#include <smccc_helpers.h>
...
...
Prev
1
2
Next
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