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
e74af2af
Unverified
Commit
e74af2af
authored
Mar 29, 2018
by
Dimitris Papastamos
Committed by
GitHub
Mar 29, 2018
Browse files
Merge pull request #1335 from JoelHutton/jh/cleanup_void_pointers
Clean usage of void pointers to access symbols
parents
0b747723
9f85f9e3
Changes
18
Show whitespace changes
Inline
Side-by-side
bl1/bl1_private.h
View file @
e74af2af
/*
/*
* Copyright (c) 2013-201
6
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -8,18 +8,16 @@
...
@@ -8,18 +8,16 @@
#define __BL1_PRIVATE_H__
#define __BL1_PRIVATE_H__
#include <types.h>
#include <types.h>
#include <utils_def.h>
/*******************************************************************************
/*******************************************************************************
* Declarations of linker defined symbols which will tell us where BL1 lives
* Declarations of linker defined symbols which will tell us where BL1 lives
* in Trusted ROM and RAM
* in Trusted ROM and RAM
******************************************************************************/
******************************************************************************/
extern
uintptr_t
__BL1_ROM_END__
;
IMPORT_SYM
(
uintptr_t
,
__BL1_ROM_END__
,
BL1_ROM_END
);
#define BL1_ROM_END (uintptr_t)(&__BL1_ROM_END__)
extern
uintptr_t
__BL1_RAM_START__
;
IMPORT_SYM
(
uintptr_t
,
__BL1_RAM_START__
,
BL1_RAM_BASE
);
extern
uintptr_t
__BL1_RAM_END__
;
IMPORT_SYM
(
uintptr_t
,
__BL1_RAM_END__
,
BL1_RAM_LIMIT
);
#define BL1_RAM_BASE (uintptr_t)(&__BL1_RAM_START__)
#define BL1_RAM_LIMIT (uintptr_t)(&__BL1_RAM_END__)
/******************************************
/******************************************
* Function prototypes
* Function prototypes
...
...
common/runtime_svc.c
View file @
e74af2af
/*
/*
* Copyright (c) 2013-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -19,8 +19,6 @@
...
@@ -19,8 +19,6 @@
* 'rt_svc_descs_indices' array. This gives the index of the descriptor in the
* 'rt_svc_descs_indices' array. This gives the index of the descriptor in the
* 'rt_svc_descs' array which contains the SMC handler.
* 'rt_svc_descs' array which contains the SMC handler.
******************************************************************************/
******************************************************************************/
#define RT_SVC_DESCS_START ((uintptr_t) (&__RT_SVC_DESCS_START__))
#define RT_SVC_DESCS_END ((uintptr_t) (&__RT_SVC_DESCS_END__))
uint8_t
rt_svc_descs_indices
[
MAX_RT_SVCS
];
uint8_t
rt_svc_descs_indices
[
MAX_RT_SVCS
];
static
rt_svc_desc_t
*
rt_svc_descs
;
static
rt_svc_desc_t
*
rt_svc_descs
;
...
...
drivers/auth/img_parser_mod.c
View file @
e74af2af
/*
/*
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015
-2018
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -12,11 +12,10 @@
...
@@ -12,11 +12,10 @@
#include <limits.h>
#include <limits.h>
#include <stdint.h>
#include <stdint.h>
#include <string.h>
#include <string.h>
#include <utils_def.h>
extern
uintptr_t
__PARSER_LIB_DESCS_START__
;
IMPORT_SYM
(
uintptr_t
,
__PARSER_LIB_DESCS_START__
,
PARSER_LIB_DESCS_START
);
extern
uintptr_t
__PARSER_LIB_DESCS_END__
;
IMPORT_SYM
(
uintptr_t
,
__PARSER_LIB_DESCS_END__
,
PARSER_LIB_DESCS_END
);
#define PARSER_LIB_DESCS_START ((uintptr_t) (&__PARSER_LIB_DESCS_START__))
#define PARSER_LIB_DESCS_END ((uintptr_t) (&__PARSER_LIB_DESCS_END__))
static
unsigned
int
parser_lib_indices
[
IMG_MAX_TYPES
];
static
unsigned
int
parser_lib_indices
[
IMG_MAX_TYPES
];
static
img_parser_lib_desc_t
*
parser_lib_descs
;
static
img_parser_lib_desc_t
*
parser_lib_descs
;
...
...
include/common/bl_common.h
View file @
e74af2af
...
@@ -64,33 +64,41 @@
...
@@ -64,33 +64,41 @@
#include <types.h>
#include <types.h>
#include <utils_def.h>
/* To retain compatibility */
#include <utils_def.h>
/* To retain compatibility */
/*
/*
* Declarations of linker defined symbols to help determine memory layout of
* Declarations of linker defined symbols to help determine memory layout of
* BL images
* BL images
*/
*/
#if SEPARATE_CODE_AND_RODATA
#if SEPARATE_CODE_AND_RODATA
extern
uintptr_t
__TEXT_START__
;
IMPORT_SYM
(
unsigned
long
,
__TEXT_START__
,
BL_CODE_BASE
)
;
extern
uintptr_t
__TEXT_END__
;
IMPORT_SYM
(
unsigned
long
,
__TEXT_END__
,
BL_CODE_END
)
;
extern
uintptr_t
__RODATA_START__
;
IMPORT_SYM
(
unsigned
long
,
__RODATA_START__
,
BL_RO_DATA_BASE
)
;
extern
uintptr_t
__RODATA_END__
;
IMPORT_SYM
(
unsigned
long
,
__RODATA_END__
,
BL_RO_DATA_END
)
;
#else
#else
extern
uintptr_t
__RO_START__
;
IMPORT_SYM
(
unsigned
long
,
__RO_START__
,
BL_CODE_BASE
)
;
extern
uintptr_t
__RO_END__
;
IMPORT_SYM
(
unsigned
long
,
__RO_END__
,
BL_CODE_END
)
;
#endif
#endif
#if defined(IMAGE_BL2)
#if defined(IMAGE_BL2)
extern
uintptr_t
__BL2_END__
;
IMPORT_SYM
(
unsigned
long
,
__BL2_END__
,
BL2_END
)
;
#elif defined(IMAGE_BL2U)
#elif defined(IMAGE_BL2U)
extern
uintptr_t
__BL2U_END__
;
IMPORT_SYM
(
unsigned
long
,
__BL2U_END__
,
BL2U_END
)
;
#elif defined(IMAGE_BL31)
#elif defined(IMAGE_BL31)
extern
uintptr_t
__BL31_END__
;
IMPORT_SYM
(
unsigned
long
,
__BL31_END__
,
BL31_END
)
;
#elif defined(IMAGE_BL32)
#elif defined(IMAGE_BL32)
extern
uintptr_t
__BL32_END__
;
IMPORT_SYM
(
unsigned
long
,
__BL32_END__
,
BL32_END
)
;
#endif
/* IMAGE_BLX */
#endif
/* IMAGE_BLX */
/*
* The next 2 constants identify the extents of the coherent memory region.
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* __COHERENT_RAM_START__ and __COHERENT_RAM_END__ linker symbols refer to
* page-aligned addresses.
*/
#if USE_COHERENT_MEM
#if USE_COHERENT_MEM
extern
uintptr_t
__COHERENT_RAM_START__
;
IMPORT_SYM
(
unsigned
long
,
__COHERENT_RAM_START__
,
BL_COHERENT_RAM_BASE
)
;
extern
uintptr_t
__COHERENT_RAM_END__
;
IMPORT_SYM
(
unsigned
long
,
__COHERENT_RAM_END__
,
BL_COHERENT_RAM_END
)
;
#endif
#endif
/*******************************************************************************
/*******************************************************************************
...
...
include/common/runtime_svc.h
View file @
e74af2af
...
@@ -122,8 +122,8 @@ CASSERT(RT_SVC_DESC_HANDLE == __builtin_offsetof(rt_svc_desc_t, handle), \
...
@@ -122,8 +122,8 @@ CASSERT(RT_SVC_DESC_HANDLE == __builtin_offsetof(rt_svc_desc_t, handle), \
void
runtime_svc_init
(
void
);
void
runtime_svc_init
(
void
);
uintptr_t
handle_runtime_svc
(
uint32_t
smc_fid
,
void
*
cookie
,
void
*
handle
,
uintptr_t
handle_runtime_svc
(
uint32_t
smc_fid
,
void
*
cookie
,
void
*
handle
,
unsigned
int
flags
);
unsigned
int
flags
);
extern
uintptr_t
__RT_SVC_DESCS_START__
;
IMPORT_SYM
(
uintptr_t
,
__RT_SVC_DESCS_START__
,
RT_SVC_DESCS_START
)
;
extern
uintptr_t
__RT_SVC_DESCS_END__
;
IMPORT_SYM
(
uintptr_t
,
__RT_SVC_DESCS_END__
,
RT_SVC_DESCS_END
)
;
void
init_crash_reporting
(
void
);
void
init_crash_reporting
(
void
);
extern
uint8_t
rt_svc_descs_indices
[
MAX_RT_SVCS
];
extern
uint8_t
rt_svc_descs_indices
[
MAX_RT_SVCS
];
...
...
include/lib/utils_def.h
View file @
e74af2af
/*
/*
* Copyright (c) 2016-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -99,4 +99,21 @@
...
@@ -99,4 +99,21 @@
((ARM_ARCH_MAJOR > _maj) || \
((ARM_ARCH_MAJOR > _maj) || \
((ARM_ARCH_MAJOR == _maj) && (ARM_ARCH_MINOR >= _min)))
((ARM_ARCH_MAJOR == _maj) && (ARM_ARCH_MINOR >= _min)))
/*
* Import an assembly or linker symbol as a C expression with the specified
* type
*/
#define IMPORT_SYM(type, sym, name) \
extern char sym[];\
static const __attribute__((unused)) type name = (type) sym;
/*
* When the symbol is used to hold a pointer, its alignment can be asserted
* with this macro. For example, if there is a linker symbol that is going to
* be used as a 64-bit pointer, the value of the linker symbol must also be
* aligned to 64 bit. This macro makes sure this is the case.
*/
#define ASSERT_SYM_PTR_ALIGN(sym) assert(((size_t)(sym) % __alignof__(*(sym))) == 0)
#endif
/* __UTILS_DEF_H__ */
#endif
/* __UTILS_DEF_H__ */
include/plat/common/common_def.h
View file @
e74af2af
/*
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -74,33 +74,13 @@
...
@@ -74,33 +74,13 @@
* page of it with the right memory attributes.
* page of it with the right memory attributes.
*/
*/
#if SEPARATE_CODE_AND_RODATA
#if SEPARATE_CODE_AND_RODATA
#define BL_CODE_BASE (unsigned long)(&__TEXT_START__)
#define BL_CODE_END (unsigned long)(&__TEXT_END__)
#define BL_RO_DATA_BASE (unsigned long)(&__RODATA_START__)
#define BL_RO_DATA_END (unsigned long)(&__RODATA_END__)
#define BL1_CODE_END BL_CODE_END
#define BL1_CODE_END BL_CODE_END
#define BL1_RO_DATA_BASE
(unsigned long)(&_
_RODATA_
START__)
#define BL1_RO_DATA_BASE
BL
_RO
_
DATA_
BASE
#define BL1_RO_DATA_END round_up(BL1_ROM_END, PAGE_SIZE)
#define BL1_RO_DATA_END round_up(BL1_ROM_END, PAGE_SIZE)
#else
#else
#define BL_CODE_BASE (unsigned long)(&__RO_START__)
#define BL_CODE_END (unsigned long)(&__RO_END__)
#define BL_RO_DATA_BASE 0
#define BL_RO_DATA_BASE 0
#define BL_RO_DATA_END 0
#define BL_RO_DATA_END 0
#define BL1_CODE_END round_up(BL1_ROM_END, PAGE_SIZE)
#define BL1_CODE_END round_up(BL1_ROM_END, PAGE_SIZE)
#define BL1_RO_DATA_BASE 0
#define BL1_RO_DATA_END 0
#endif
/* SEPARATE_CODE_AND_RODATA */
#endif
/* SEPARATE_CODE_AND_RODATA */
/*
* The next 2 constants identify the extents of the coherent memory region.
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* __COHERENT_RAM_START__ and __COHERENT_RAM_END__ linker symbols refer to
* page-aligned addresses.
*/
#define BL_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
#define BL_COHERENT_RAM_END (unsigned long)(&__COHERENT_RAM_END__)
#endif
/* __COMMON_DEF_H__ */
#endif
/* __COMMON_DEF_H__ */
include/services/secure_partition.h
View file @
e74af2af
/*
/*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017
-2018
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -11,15 +11,11 @@
...
@@ -11,15 +11,11 @@
#include <types.h>
#include <types.h>
#include <utils_def.h>
#include <utils_def.h>
/*
L
inker symbols */
/*
Import l
inker symbols */
extern
uintptr_t
__SP_IMAGE_XLAT_TABLES_START__
;
IMPORT_SYM
(
uintptr_t
,
__SP_IMAGE_XLAT_TABLES_START__
,
SP_IMAGE_XLAT_TABLES_START
)
;
extern
uintptr_t
__SP_IMAGE_XLAT_TABLES_END__
;
IMPORT_SYM
(
uintptr_t
,
__SP_IMAGE_XLAT_TABLES_END__
,
SP_IMAGE_XLAT_TABLES_END
)
;
/* Definitions */
/* Definitions */
#define SP_IMAGE_XLAT_TABLES_START \
(uintptr_t)(&__SP_IMAGE_XLAT_TABLES_START__)
#define SP_IMAGE_XLAT_TABLES_END \
(uintptr_t)(&__SP_IMAGE_XLAT_TABLES_END__)
#define SP_IMAGE_XLAT_TABLES_SIZE \
#define SP_IMAGE_XLAT_TABLES_SIZE \
(SP_IMAGE_XLAT_TABLES_END - SP_IMAGE_XLAT_TABLES_START)
(SP_IMAGE_XLAT_TABLES_END - SP_IMAGE_XLAT_TABLES_START)
...
...
lib/locks/bakery/bakery_lock_normal.c
View file @
e74af2af
/*
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include <cpu_data.h>
#include <cpu_data.h>
#include <platform.h>
#include <platform.h>
#include <string.h>
#include <string.h>
#include <utils_def.h>
/*
/*
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
* Functions in this file implement Bakery Algorithm for mutual exclusion with the
...
@@ -49,8 +50,7 @@ CASSERT((PLAT_PERCPU_BAKERY_LOCK_SIZE & (CACHE_WRITEBACK_GRANULE - 1)) == 0, \
...
@@ -49,8 +50,7 @@ CASSERT((PLAT_PERCPU_BAKERY_LOCK_SIZE & (CACHE_WRITEBACK_GRANULE - 1)) == 0, \
* Use the linker defined symbol which has evaluated the size reqiurement.
* Use the linker defined symbol which has evaluated the size reqiurement.
* This is not as efficient as using a platform defined constant
* This is not as efficient as using a platform defined constant
*/
*/
extern
void
*
__PERCPU_BAKERY_LOCK_SIZE__
;
IMPORT_SYM
(
uintptr_t
,
__PERCPU_BAKERY_LOCK_SIZE__
,
PERCPU_BAKERY_LOCK_SIZE
);
#define PERCPU_BAKERY_LOCK_SIZE ((uintptr_t)&__PERCPU_BAKERY_LOCK_SIZE__)
#endif
#endif
#define get_bakery_info(cpu_ix, lock) \
#define get_bakery_info(cpu_ix, lock) \
...
...
lib/pmf/pmf_main.c
View file @
e74af2af
/*
/*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016
-2018
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <platform.h>
#include <platform.h>
#include <pmf.h>
#include <pmf.h>
#include <string.h>
#include <string.h>
#include <utils_def.h>
/*******************************************************************************
/*******************************************************************************
* The 'pmf_svc_descs' array holds the PMF service descriptors exported by
* The 'pmf_svc_descs' array holds the PMF service descriptors exported by
...
@@ -21,16 +22,12 @@
...
@@ -21,16 +22,12 @@
* index of the descriptor in the 'pmf_svc_descs' array which contains the
* index of the descriptor in the 'pmf_svc_descs' array which contains the
* service function pointers.
* service function pointers.
******************************************************************************/
******************************************************************************/
extern
uintptr_t
__PMF_SVC_DESCS_START__
;
extern
uintptr_t
__PMF_SVC_DESCS_END__
;
IMPORT_SYM
(
uintptr_t
,
__PMF_SVC_DESCS_START__
,
PMF_SVC_DESCS_START
);
#define PMF_SVC_DESCS_START ((uintptr_t)(&__PMF_SVC_DESCS_START__))
IMPORT_SYM
(
uintptr_t
,
__PMF_SVC_DESCS_END__
,
PMF_SVC_DESCS_END
);
#define PMF_SVC_DESCS_END ((uintptr_t)(&__PMF_SVC_DESCS_END__))
IMPORT_SYM
(
uintptr_t
,
__PERCPU_TIMESTAMP_SIZE__
,
PMF_PERCPU_TIMESTAMP_SIZE
);
extern
void
*
__PERCPU_TIMESTAMP_SIZE__
;
IMPORT_SYM
(
intptr_t
,
__PMF_TIMESTAMP_START__
,
PMF_TIMESTAMP_ARRAY_START
);
#define PMF_PERCPU_TIMESTAMP_SIZE ((uintptr_t)&__PERCPU_TIMESTAMP_SIZE__)
IMPORT_SYM
(
uintptr_t
,
__PMF_TIMESTAMP_END__
,
PMF_TIMESTAMP_ARRAY_END
);
extern
uintptr_t
__PMF_TIMESTAMP_START__
;
#define PMF_TIMESTAMP_ARRAY_START ((uintptr_t)&__PMF_TIMESTAMP_START__)
extern
uintptr_t
__PMF_TIMESTAMP_END__
;
#define PMF_TIMESTAMP_ARRAY_END ((uintptr_t)&__PMF_TIMESTAMP_END__)
#define PMF_SVC_DESCS_MAX 10
#define PMF_SVC_DESCS_MAX 10
...
...
plat/hisilicon/hikey/hikey_bl1_setup.c
View file @
e74af2af
...
@@ -23,23 +23,6 @@
...
@@ -23,23 +23,6 @@
#include "../../bl1/bl1_private.h"
#include "../../bl1/bl1_private.h"
#include "hikey_private.h"
#include "hikey_private.h"
/*
* Declarations of linker defined symbols which will help us find the layout
* of trusted RAM
*/
extern
unsigned
long
__COHERENT_RAM_START__
;
extern
unsigned
long
__COHERENT_RAM_END__
;
/*
* The next 2 constants identify the extents of the coherent memory region.
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* __COHERENT_RAM_START__ and __COHERENT_RAM_END__ linker symbols refer to
* page-aligned addresses.
*/
#define BL1_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
#define BL1_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
/* Data structure which holds the extents of the trusted RAM for BL1 */
/* Data structure which holds the extents of the trusted RAM for BL1 */
static
meminfo_t
bl1_tzram_layout
;
static
meminfo_t
bl1_tzram_layout
;
...
@@ -103,8 +86,8 @@ void bl1_plat_arch_setup(void)
...
@@ -103,8 +86,8 @@ void bl1_plat_arch_setup(void)
bl1_tzram_layout
.
total_size
,
bl1_tzram_layout
.
total_size
,
BL1_RO_BASE
,
BL1_RO_BASE
,
BL1_RO_LIMIT
,
BL1_RO_LIMIT
,
BL
1
_COHERENT_RAM_BASE
,
BL_COHERENT_RAM_BASE
,
BL
1
_COHERENT_RAM_
LIMIT
);
BL_COHERENT_RAM_
END
);
}
}
/*
/*
...
...
plat/hisilicon/hikey960/hikey960_bl1_setup.c
View file @
e74af2af
...
@@ -37,18 +37,6 @@ enum {
...
@@ -37,18 +37,6 @@ enum {
* Declarations of linker defined symbols which will help us find the layout
* Declarations of linker defined symbols which will help us find the layout
* of trusted RAM
* of trusted RAM
*/
*/
extern
unsigned
long
__COHERENT_RAM_START__
;
extern
unsigned
long
__COHERENT_RAM_END__
;
/*
* The next 2 constants identify the extents of the coherent memory region.
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* __COHERENT_RAM_START__ and __COHERENT_RAM_END__ linker symbols refer to
* page-aligned addresses.
*/
#define BL1_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
#define BL1_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
/* Data structure which holds the extents of the trusted RAM for BL1 */
/* Data structure which holds the extents of the trusted RAM for BL1 */
static
meminfo_t
bl1_tzram_layout
;
static
meminfo_t
bl1_tzram_layout
;
...
@@ -131,8 +119,8 @@ void bl1_plat_arch_setup(void)
...
@@ -131,8 +119,8 @@ void bl1_plat_arch_setup(void)
bl1_tzram_layout
.
total_size
,
bl1_tzram_layout
.
total_size
,
BL1_RO_BASE
,
BL1_RO_BASE
,
BL1_RO_LIMIT
,
BL1_RO_LIMIT
,
BL
1
_COHERENT_RAM_BASE
,
BL_COHERENT_RAM_BASE
,
BL
1
_COHERENT_RAM_
LIMIT
);
BL_COHERENT_RAM_
END
);
}
}
static
void
hikey960_ufs_reset
(
void
)
static
void
hikey960_ufs_reset
(
void
)
...
...
plat/hisilicon/poplar/bl1_plat_setup.c
View file @
e74af2af
/*
/*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017
-2018
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -23,13 +23,6 @@
...
@@ -23,13 +23,6 @@
#include "hi3798cv200.h"
#include "hi3798cv200.h"
#include "plat_private.h"
#include "plat_private.h"
/* Symbols from link script for conherent section */
extern
unsigned
long
__COHERENT_RAM_START__
;
extern
unsigned
long
__COHERENT_RAM_END__
;
#define BL1_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
#define BL1_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
/* Data structure which holds the extents of the trusted RAM for BL1 */
/* Data structure which holds the extents of the trusted RAM for BL1 */
static
meminfo_t
bl1_tzram_layout
;
static
meminfo_t
bl1_tzram_layout
;
...
@@ -92,8 +85,8 @@ void bl1_plat_arch_setup(void)
...
@@ -92,8 +85,8 @@ void bl1_plat_arch_setup(void)
bl1_tzram_layout
.
total_size
,
bl1_tzram_layout
.
total_size
,
BL1_RO_BASE
,
/* l-loader and BL1 ROM */
BL1_RO_BASE
,
/* l-loader and BL1 ROM */
BL1_RO_LIMIT
,
BL1_RO_LIMIT
,
BL
1
_COHERENT_RAM_BASE
,
BL_COHERENT_RAM_BASE
,
BL
1
_COHERENT_RAM_
LIMIT
);
BL_COHERENT_RAM_
END
);
}
}
void
bl1_platform_setup
(
void
)
void
bl1_platform_setup
(
void
)
...
...
plat/mediatek/mt6795/bl31_plat_setup.c
View file @
e74af2af
/*
/*
* Copyright (c) 2016-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -21,22 +21,21 @@
...
@@ -21,22 +21,21 @@
#include <plat_private.h>
#include <plat_private.h>
#include <platform.h>
#include <platform.h>
#include <string.h>
#include <string.h>
#include <utils_def.h>
#include <xlat_tables.h>
#include <xlat_tables.h>
/*******************************************************************************
/*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout
* Declarations of linker defined symbols which will help us find the layout
* of trusted SRAM
* of trusted SRAM
******************************************************************************/
******************************************************************************/
unsigned
long
__RO_START__
;
unsigned
long
__RO_END__
;
/*
/*
* The next 2 constants identify the extents of the code & RO data region.
* The next 2 constants identify the extents of the code & RO data region.
* These addresses are used by the MMU setup code and therefore they must be
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* page-aligned. It is the responsibility of the linker script to ensure that
* __RO_START__ and __RO_END__ linker symbols refer to page-aligned addresses.
* __RO_START__ and __RO_END__ linker symbols refer to page-aligned addresses.
*/
*/
#define BL31_RO_BASE
(unsigned long
)(&
__RO_START__
)
IMPORT_SYM
(
unsigned
long
,
__RO_START__
,
BL31_RO_BASE
);
#define BL31_RO_LIMIT
(unsigned long
)(&
__RO_END__
)
IMPORT_SYM
(
unsigned
long
,
__RO_END__
,
BL31_RO_LIMIT
);
/*
/*
* Placeholder variables for copying the arguments that have been passed to
* Placeholder variables for copying the arguments that have been passed to
...
...
plat/mediatek/mt8173/bl31_plat_setup.c
View file @
e74af2af
/*
/*
* Copyright (c) 2013-201
6
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -17,24 +17,6 @@
...
@@ -17,24 +17,6 @@
#include <platform.h>
#include <platform.h>
#include <spm.h>
#include <spm.h>
/*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout
* of trusted SRAM
******************************************************************************/
unsigned
long
__RO_START__
;
unsigned
long
__RO_END__
;
/*
* The next 3 constants identify the extents of the code, RO data region and the
* limit of the BL31 image. These addresses are used by the MMU setup code and
* therefore they must be page-aligned. It is the responsibility of the linker
* script to ensure that __RO_START__, __RO_END__ & __BL31_END__ linker symbols
* refer to page-aligned addresses.
*/
#define BL31_RO_BASE (unsigned long)(&__RO_START__)
#define BL31_RO_LIMIT (unsigned long)(&__RO_END__)
#define BL31_END (unsigned long)(&__BL31_END__)
static
entry_point_info_t
bl32_ep_info
;
static
entry_point_info_t
bl32_ep_info
;
static
entry_point_info_t
bl33_ep_info
;
static
entry_point_info_t
bl33_ep_info
;
...
@@ -156,10 +138,10 @@ void bl31_plat_arch_setup(void)
...
@@ -156,10 +138,10 @@ void bl31_plat_arch_setup(void)
plat_cci_init
();
plat_cci_init
();
plat_cci_enable
();
plat_cci_enable
();
plat_configure_mmu_el3
(
BL
31_RO
_BASE
,
plat_configure_mmu_el3
(
BL
_CODE
_BASE
,
BL_COHERENT_RAM_END
-
BL
31_RO
_BASE
,
BL_COHERENT_RAM_END
-
BL
_CODE
_BASE
,
BL
31_RO
_BASE
,
BL
_CODE
_BASE
,
BL
31_RO_LIMIT
,
BL
_CODE_END
,
BL_COHERENT_RAM_BASE
,
BL_COHERENT_RAM_BASE
,
BL_COHERENT_RAM_END
);
BL_COHERENT_RAM_END
);
}
}
...
...
plat/nvidia/tegra/common/tegra_bl31_setup.c
View file @
e74af2af
/*
/*
* Copyright (c) 2015-201
7
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2015-201
8
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <string.h>
#include <string.h>
#include <tegra_def.h>
#include <tegra_def.h>
#include <tegra_private.h>
#include <tegra_private.h>
#include <utils_def.h>
/* length of Trusty's input parameters (in bytes) */
/* length of Trusty's input parameters (in bytes) */
#define TRUSTY_PARAMS_LEN_BYTES (4096*2)
#define TRUSTY_PARAMS_LEN_BYTES (4096*2)
...
@@ -33,29 +34,17 @@ extern void zeromem16(void *mem, unsigned int length);
...
@@ -33,29 +34,17 @@ extern void zeromem16(void *mem, unsigned int length);
* Declarations of linker defined symbols which will help us find the layout
* Declarations of linker defined symbols which will help us find the layout
* of trusted SRAM
* of trusted SRAM
******************************************************************************/
******************************************************************************/
extern
unsigned
long
__TEXT_START__
;
extern
unsigned
long
__
TEXT_END__
;
IMPORT_SYM
(
unsigned
long
,
__
RW_START__
,
BL31_RW_START
)
;
extern
unsigned
long
__RW_
START__
;
IMPORT_SYM
(
unsigned
long
,
__RW_
END__
,
BL31_RW_END
)
;
extern
unsigned
long
__R
W_END__
;
IMPORT_SYM
(
unsigned
long
,
__R
ODATA_START__
,
BL31_RODATA_BASE
)
;
extern
unsigned
long
__RODATA_
START__
;
IMPORT_SYM
(
unsigned
long
,
__RODATA_
END__
,
BL31_RODATA_END
)
;
extern
unsigned
long
__
RODATA_END__
;
IMPORT_SYM
(
unsigned
long
,
__
TEXT_START__
,
TEXT_START
)
;
extern
unsigned
long
__
BL31
_END__
;
IMPORT_SYM
(
unsigned
long
,
__
TEXT
_END__
,
TEXT_END
)
;
extern
uint64_t
tegra_bl31_phys_base
;
extern
uint64_t
tegra_bl31_phys_base
;
extern
uint64_t
tegra_console_base
;
extern
uint64_t
tegra_console_base
;
/*
* The next 3 constants identify the extents of the code, RO data region and the
* limit of the BL3-1 image. These addresses are used by the MMU setup code and
* therefore they must be page-aligned. It is the responsibility of the linker
* script to ensure that __RO_START__, __RO_END__ & __BL31_END__ linker symbols
* refer to page-aligned addresses.
*/
#define BL31_RW_START (unsigned long)(&__RW_START__)
#define BL31_RW_END (unsigned long)(&__RW_END__)
#define BL31_RODATA_BASE (unsigned long)(&__RODATA_START__)
#define BL31_RODATA_END (unsigned long)(&__RODATA_END__)
#define BL31_END (unsigned long)(&__BL31_END__)
static
entry_point_info_t
bl33_image_ep_info
,
bl32_image_ep_info
;
static
entry_point_info_t
bl33_image_ep_info
,
bl32_image_ep_info
;
static
plat_params_from_bl2_t
plat_bl31_params_from_bl2
=
{
static
plat_params_from_bl2_t
plat_bl31_params_from_bl2
=
{
...
@@ -311,8 +300,8 @@ void bl31_plat_arch_setup(void)
...
@@ -311,8 +300,8 @@ void bl31_plat_arch_setup(void)
unsigned
long
rw_size
=
BL31_RW_END
-
BL31_RW_START
;
unsigned
long
rw_size
=
BL31_RW_END
-
BL31_RW_START
;
unsigned
long
rodata_start
=
BL31_RODATA_BASE
;
unsigned
long
rodata_start
=
BL31_RODATA_BASE
;
unsigned
long
rodata_size
=
BL31_RODATA_END
-
BL31_RODATA_BASE
;
unsigned
long
rodata_size
=
BL31_RODATA_END
-
BL31_RODATA_BASE
;
unsigned
long
code_base
=
(
unsigned
long
)(
&
__
TEXT_START
__
)
;
unsigned
long
code_base
=
TEXT_START
;
unsigned
long
code_size
=
(
unsigned
long
)(
&
__TEXT_END__
)
-
code_base
;
unsigned
long
code_size
=
TEXT_END
-
TEXT_START
;
const
mmap_region_t
*
plat_mmio_map
=
NULL
;
const
mmap_region_t
*
plat_mmio_map
=
NULL
;
#if USE_COHERENT_MEM
#if USE_COHERENT_MEM
unsigned
long
coh_start
,
coh_size
;
unsigned
long
coh_start
,
coh_size
;
...
...
plat/rockchip/common/bl31_plat_setup.c
View file @
e74af2af
/*
/*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2016
-2018
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -17,21 +17,14 @@
...
@@ -17,21 +17,14 @@
#include <platform_def.h>
#include <platform_def.h>
#include <uart_16550.h>
#include <uart_16550.h>
/*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout
* of trusted SRAM
******************************************************************************/
unsigned
long
__RO_START__
;
unsigned
long
__RO_END__
;
/*
/*
* The next 2 constants identify the extents of the code & RO data region.
* The next 2 constants identify the extents of the code & RO data region.
* These addresses are used by the MMU setup code and therefore they must be
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* page-aligned. It is the responsibility of the linker script to ensure that
* __RO_START__ and __RO_END__ linker symbols refer to page-aligned addresses.
* __RO_START__ and __RO_END__ linker symbols refer to page-aligned addresses.
*/
*/
#define BL31_RO_BASE
(unsigned long
)(&
__RO_START__
)
IMPORT_SYM
(
unsigned
long
,
__RO_START__
,
BL31_RO_BASE
);
#define BL31_RO_LIMIT
(unsigned long
)(&
__RO_END__
)
IMPORT_SYM
(
unsigned
long
,
__RO_END__
,
BL31_RO_LIMIT
);
static
entry_point_info_t
bl32_ep_info
;
static
entry_point_info_t
bl32_ep_info
;
static
entry_point_info_t
bl33_ep_info
;
static
entry_point_info_t
bl33_ep_info
;
...
...
services/std_svc/spm/spm_shim_private.h
View file @
e74af2af
/*
/*
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2017
-2018
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -8,21 +8,17 @@
...
@@ -8,21 +8,17 @@
#define __SPM_SHIM_PRIVATE__
#define __SPM_SHIM_PRIVATE__
#include <types.h>
#include <types.h>
#include <utils_def.h>
/* Assembly source */
/* Assembly source */
extern
uintptr_t
spm_shim_exceptions_ptr
;
IMPORT_SYM
(
uintptr_t
,
spm_shim_exceptions_ptr
,
SPM_SHIM_EXCEPTIONS_PTR
)
;
/* Linker symbols */
/* Linker symbols */
extern
uintptr_t
__SPM_SHIM_EXCEPTIONS_START__
;
IMPORT_SYM
(
uintptr_t
,
__SPM_SHIM_EXCEPTIONS_START__
,
SPM_SHIM_EXCEPTIONS_START
)
;
extern
uintptr_t
__SPM_SHIM_EXCEPTIONS_END__
;
IMPORT_SYM
(
uintptr_t
,
__SPM_SHIM_EXCEPTIONS_END__
,
SPM_SHIM_EXCEPTIONS_END
)
;
/* Definitions */
/* Definitions */
#define SPM_SHIM_EXCEPTIONS_PTR (uintptr_t)(&spm_shim_exceptions_ptr)
#define SPM_SHIM_EXCEPTIONS_START \
(uintptr_t)(&__SPM_SHIM_EXCEPTIONS_START__)
#define SPM_SHIM_EXCEPTIONS_END \
(uintptr_t)(&__SPM_SHIM_EXCEPTIONS_END__)
#define SPM_SHIM_EXCEPTIONS_SIZE \
#define SPM_SHIM_EXCEPTIONS_SIZE \
(SPM_SHIM_EXCEPTIONS_END - SPM_SHIM_EXCEPTIONS_START)
(SPM_SHIM_EXCEPTIONS_END - SPM_SHIM_EXCEPTIONS_START)
...
...
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