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
4731e8f0
Commit
4731e8f0
authored
Apr 29, 2015
by
danh-arm
Browse files
Merge pull request #295 from danh-arm/dh/plat-port-reorg
ARM platform port reorganization
parents
6403a306
4a75b84a
Changes
101
Show whitespace changes
Inline
Side-by-side
plat/fvp/drivers/pwrc/fvp_pwrc.h
→
plat/
arm/board/
fvp/drivers/pwrc/fvp_pwrc.h
View file @
4731e8f0
/*
* Copyright (c) 2013-201
4
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
5
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -63,7 +63,6 @@
/*******************************************************************************
* Function & variable prototypes
******************************************************************************/
int
fvp_pwrc_setup
(
void
);
void
fvp_pwrc_write_pcoffr
(
unsigned
long
);
void
fvp_pwrc_write_ppoffr
(
unsigned
long
);
void
fvp_pwrc_write_pponr
(
unsigned
long
);
...
...
plat/arm/board/fvp/fvp_bl1_setup.c
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <plat_arm.h>
#include "fvp_private.h"
/*******************************************************************************
* Perform any BL1 specific platform actions.
******************************************************************************/
void
bl1_early_platform_setup
(
void
)
{
arm_bl1_early_platform_setup
();
/* Initialize the platform config for future decision making */
fvp_config_setup
();
/*
* Initialize CCI for this cluster during cold boot.
* No need for locks as no other CPU is active.
*/
fvp_cci_init
();
/*
* Enable CCI coherency for the primary CPU's cluster.
*/
fvp_cci_enable
();
}
plat/arm/board/fvp/fvp_bl2_setup.c
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <plat_arm.h>
#include "fvp_private.h"
void
bl2_early_platform_setup
(
meminfo_t
*
mem_layout
)
{
arm_bl2_early_platform_setup
(
mem_layout
);
/* Initialize the platform config for future decision making */
fvp_config_setup
();
}
plat/arm/board/fvp/fvp_bl31_setup.c
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <plat_arm.h>
#include "fvp_private.h"
void
bl31_early_platform_setup
(
bl31_params_t
*
from_bl2
,
void
*
plat_params_from_bl2
)
{
arm_bl31_early_platform_setup
(
from_bl2
,
plat_params_from_bl2
);
/* Initialize the platform config for future decision making */
fvp_config_setup
();
/*
* Initialize CCI for this cluster during cold boot.
* No need for locks as no other CPU is active.
*/
fvp_cci_init
();
#if RESET_TO_BL31
/*
* Enable CCI coherency for the primary CPU's cluster
* (if earlier BL has not already done so).
* FVP PSCI code will enable coherency for other clusters.
*/
fvp_cci_enable
();
#endif
/* RESET_TO_BL31 */
}
plat/
juno/tsp/tsp_plat_setup.c
→
plat/
arm/board/fvp/fvp_def.h
View file @
4731e8f0
/*
* Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2014
-2015
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -28,81 +28,103 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <bl_common.h>
#include <console.h>
#include <platform_tsp.h>
#include "../juno_def.h"
#include "../juno_private.h"
#ifndef __FVP_DEF_H__
#define __FVP_DEF_H__
#include <arm_def.h>
#define FVP_MAX_CPUS_PER_CLUSTER 4
#define FVP_PRIMARY_CPU 0x0
/*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout
* of trusted SRAM
* FVP memory map related constants
******************************************************************************/
extern
unsigned
long
__RO_START__
;
extern
unsigned
long
__RO_END__
;
extern
unsigned
long
__BL32_END__
;
#if USE_COHERENT_MEM
extern
unsigned
long
__COHERENT_RAM_START__
;
extern
unsigned
long
__COHERENT_RAM_END__
;
#endif
#define FLASH1_BASE 0x0c000000
#define FLASH1_SIZE 0x04000000
/*
* The next 3 constants identify the extents of the code, RO data region and the
* limit of the BL3-2 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__ & __BL32_END__ linker symbols
* refer to page-aligned addresses.
*/
#define BL32_RO_BASE (unsigned long)(&__RO_START__)
#define BL32_RO_LIMIT (unsigned long)(&__RO_END__)
#define BL32_END (unsigned long)(&__BL32_END__)
#define PSRAM_BASE 0x14000000
#define PSRAM_SIZE 0x04000000
#define VRAM_BASE 0x18000000
#define VRAM_SIZE 0x02000000
/* Aggregate of all devices in the first GB */
#define DEVICE0_BASE 0x20000000
#define DEVICE0_SIZE 0x0c200000
#define DEVICE1_BASE 0x2f000000
#define DEVICE1_SIZE 0x200000
#define NSRAM_BASE 0x2e000000
#define NSRAM_SIZE 0x10000
#define PCIE_EXP_BASE 0x40000000
#define TZRNG_BASE 0x7fe60000
#define TZNVCTR_BASE 0x7fe70000
#define TZROOTKEY_BASE 0x7fe80000
/* Constants to distinguish FVP type */
#define HBI_BASE_FVP 0x020
#define REV_BASE_FVP_V0 0x0
#define HBI_FOUNDATION_FVP 0x010
#define REV_FOUNDATION_FVP_V2_0 0x0
#define REV_FOUNDATION_FVP_V2_1 0x1
#define REV_FOUNDATION_FVP_v9_1 0x2
#define BLD_GIC_VE_MMAP 0x0
#define BLD_GIC_A53A57_MMAP 0x1
#define ARCH_MODEL 0x1
/* FVP Power controller base address*/
#define PWRC_BASE 0x1c100000
#if USE_COHERENT_MEM
/*
* 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 BL32_COHERENT_RAM_BASE (unsigned long)(&__COHERENT_RAM_START__)
#define BL32_COHERENT_RAM_LIMIT (unsigned long)(&__COHERENT_RAM_END__)
#endif
/*******************************************************************************
*
Initialize the UART
*
GIC-400 & interrupt handling related constants
******************************************************************************/
void
tsp_early_platform_setup
(
void
)
{
/*
* Initialize a different console than already in use to display
* messages from TSP
*/
console_init
(
PL011_UART0_BASE
,
PL011_UART0_CLK_IN_HZ
,
PL011_BAUDRATE
);
}
/* VE compatible GIC memory map */
#define VE_GICD_BASE 0x2c001000
#define VE_GICC_BASE 0x2c002000
#define VE_GICH_BASE 0x2c004000
#define VE_GICV_BASE 0x2c006000
/* Base FVP compatible GIC memory map */
#define BASE_GICD_BASE 0x2f000000
#define BASE_GICR_BASE 0x2f100000
#define BASE_GICC_BASE 0x2c000000
#define BASE_GICH_BASE 0x2c010000
#define BASE_GICV_BASE 0x2c02f000
#define IRQ_TZ_WDOG 56
/*******************************************************************************
*
Perform platform specific setup placeholder
*
TrustZone address space controller related constants
******************************************************************************/
void
tsp_platform_setup
(
void
)
{
plat_gic_init
();
}
/* NSAIDs used by devices in TZC filter 0 on FVP */
#define FVP_NSAID_DEFAULT 0
#define FVP_NSAID_PCI 1
#define FVP_NSAID_VIRTIO 8
/* from FVP v5.6 onwards */
#define FVP_NSAID_AP 9
/* Application Processors */
#define FVP_NSAID_VIRTIO_OLD 15
/* until FVP v5.5 */
/* NSAIDs used by devices in TZC filter 2 on FVP */
#define FVP_NSAID_HDLCD0 2
#define FVP_NSAID_CLCD 7
/*******************************************************************************
* Perform the very early platform specific architectural setup here. At the
* moment this only intializes the MMU
* Shared Data
******************************************************************************/
void
tsp_plat_arch_setup
(
void
)
{
configure_mmu_el1
(
BL32_RO_BASE
,
(
BL32_END
-
BL32_RO_BASE
),
BL32_RO_BASE
,
BL32_RO_LIMIT
#if USE_COHERENT_MEM
,
BL32_COHERENT_RAM_BASE
,
BL32_COHERENT_RAM_LIMIT
#endif
);
}
/* Entrypoint mailboxes */
#define MBOX_BASE ARM_SHARED_RAM_BASE
#define MBOX_SIZE 0x200
#endif
/* __FVP_DEF_H__ */
plat/arm/board/fvp/fvp_io_storage.c
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <assert.h>
#include <debug.h>
#include <io_driver.h>
#include <io_storage.h>
#include <io_semihosting.h>
#include <plat_arm.h>
/* IO devices */
static
const
io_dev_connector_t
*
sh_dev_con
;
static
uintptr_t
sh_dev_handle
;
static
int
open_semihosting
(
const
uintptr_t
spec
)
{
int
result
=
IO_FAIL
;
uintptr_t
local_image_handle
;
/* See if the file exists on semi-hosting.*/
result
=
io_dev_init
(
sh_dev_handle
,
(
uintptr_t
)
NULL
);
if
(
result
==
IO_SUCCESS
)
{
result
=
io_open
(
sh_dev_handle
,
spec
,
&
local_image_handle
);
if
(
result
==
IO_SUCCESS
)
{
VERBOSE
(
"Using Semi-hosting IO
\n
"
);
io_close
(
local_image_handle
);
}
}
return
result
;
}
void
plat_arm_io_setup
(
void
)
{
int
io_result
;
arm_io_setup
();
/* Register the additional IO devices on this platform */
io_result
=
register_io_dev_sh
(
&
sh_dev_con
);
assert
(
io_result
==
IO_SUCCESS
);
/* Open connections to devices and cache the handles */
io_result
=
io_dev_open
(
sh_dev_con
,
(
uintptr_t
)
NULL
,
&
sh_dev_handle
);
assert
(
io_result
==
IO_SUCCESS
);
/* Ignore improbable errors in release builds */
(
void
)
io_result
;
}
int
plat_arm_get_alt_image_source
(
const
uintptr_t
image_spec
,
uintptr_t
*
dev_handle
)
{
int
result
=
open_semihosting
(
image_spec
);
if
(
result
==
IO_SUCCESS
)
*
dev_handle
=
sh_dev_handle
;
return
result
;
}
plat/fvp/fvp_pm.c
→
plat/
arm/board/
fvp/fvp_pm.c
View file @
4731e8f0
/*
* Copyright (c) 2013-201
4
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
5
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -29,21 +29,25 @@
*/
#include <arch_helpers.h>
#include <arm_config.h>
#include <arm_gic.h>
#include <assert.h>
#include <bakery_lock.h>
#include <cci.h>
#include <debug.h>
#include <errno.h>
#include <mmio.h>
#include <platform.h>
#include <plat_config.h>
#include <platform_def.h>
#include <plat_arm.h>
#include <psci.h>
#include <
errno
.h>
#include <
v2m_def
.h>
#include "drivers/pwrc/fvp_pwrc.h"
#include "fvp_def.h"
#include "fvp_private.h"
typedef
volatile
struct
mailbox
{
unsigned
long
value
__aligned
(
CACHE_WRITEBACK_GRANULE
);
}
mailbox_t
;
/*******************************************************************************
* Private FVP function to program the mailbox for a cpu before it is released
* from reset.
...
...
@@ -88,33 +92,6 @@ static void fvp_cluster_pwrdwn_common(void)
fvp_pwrc_write_pcoffr
(
mpidr
);
}
/*******************************************************************************
* Private FVP function which is used to determine if any platform actions
* should be performed for the specified affinity instance given its
* state. Nothing needs to be done if the 'state' is not off or if this is not
* the highest affinity level which will enter the 'state'.
******************************************************************************/
static
int32_t
fvp_do_plat_actions
(
unsigned
int
afflvl
,
unsigned
int
state
)
{
unsigned
int
max_phys_off_afflvl
;
assert
(
afflvl
<=
MPIDR_AFFLVL1
);
if
(
state
!=
PSCI_STATE_OFF
)
return
-
EAGAIN
;
/*
* Find the highest affinity level which will be suspended and postpone
* all the platform specific actions until that level is hit.
*/
max_phys_off_afflvl
=
psci_get_max_phys_off_afflvl
();
assert
(
max_phys_off_afflvl
!=
PSCI_INVALID_DATA
);
if
(
afflvl
!=
max_phys_off_afflvl
)
return
-
EAGAIN
;
return
0
;
}
/*******************************************************************************
* FVP handler called when an affinity instance is about to enter standby.
******************************************************************************/
...
...
@@ -179,7 +156,7 @@ void fvp_affinst_off(unsigned int afflvl,
unsigned
int
state
)
{
/* Determine if any platform actions need to be executed */
if
(
fvp
_do_
pla
t_actions
(
afflvl
,
state
)
==
-
EAGAIN
)
if
(
arm
_do_
affins
t_actions
(
afflvl
,
state
)
==
-
EAGAIN
)
return
;
/*
...
...
@@ -212,7 +189,7 @@ void fvp_affinst_suspend(unsigned long sec_entrypoint,
unsigned
long
mpidr
;
/* Determine if any platform actions need to be executed. */
if
(
fvp
_do_
pla
t_actions
(
afflvl
,
state
)
==
-
EAGAIN
)
if
(
arm
_do_
affins
t_actions
(
afflvl
,
state
)
==
-
EAGAIN
)
return
;
/* Get the mpidr for this cpu */
...
...
@@ -245,7 +222,7 @@ void fvp_affinst_on_finish(unsigned int afflvl,
unsigned
long
mpidr
;
/* Determine if any platform actions need to be executed. */
if
(
fvp
_do_
pla
t_actions
(
afflvl
,
state
)
==
-
EAGAIN
)
if
(
arm
_do_
affins
t_actions
(
afflvl
,
state
)
==
-
EAGAIN
)
return
;
/* Get the mpidr for this cpu */
...
...
@@ -303,8 +280,10 @@ void fvp_affinst_suspend_finish(unsigned int afflvl,
static
void
__dead2
fvp_system_off
(
void
)
{
/* Write the System Configuration Control Register */
mmio_write_32
(
VE_SYSREGS_BASE
+
V2M_SYS_CFGCTRL
,
CFGCTRL_START
|
CFGCTRL_RW
|
CFGCTRL_FUNC
(
FUNC_SHUTDOWN
));
mmio_write_32
(
V2M_SYSREGS_BASE
+
V2M_SYS_CFGCTRL
,
V2M_CFGCTRL_START
|
V2M_CFGCTRL_RW
|
V2M_CFGCTRL_FUNC
(
V2M_FUNC_SHUTDOWN
));
wfi
();
ERROR
(
"FVP System Off: operation not handled.
\n
"
);
panic
();
...
...
@@ -313,37 +292,15 @@ static void __dead2 fvp_system_off(void)
static
void
__dead2
fvp_system_reset
(
void
)
{
/* Write the System Configuration Control Register */
mmio_write_32
(
VE_SYSREGS_BASE
+
V2M_SYS_CFGCTRL
,
CFGCTRL_START
|
CFGCTRL_RW
|
CFGCTRL_FUNC
(
FUNC_REBOOT
));
mmio_write_32
(
V2M_SYSREGS_BASE
+
V2M_SYS_CFGCTRL
,
V2M_CFGCTRL_START
|
V2M_CFGCTRL_RW
|
V2M_CFGCTRL_FUNC
(
V2M_FUNC_REBOOT
));
wfi
();
ERROR
(
"FVP System Reset: operation not handled.
\n
"
);
panic
();
}
/*******************************************************************************
* FVP handler called to check the validity of the power state parameter.
******************************************************************************/
int
fvp_validate_power_state
(
unsigned
int
power_state
)
{
/* Sanity check the requested state */
if
(
psci_get_pstate_type
(
power_state
)
==
PSTATE_TYPE_STANDBY
)
{
/*
* It's possible to enter standby only on affinity level 0
* i.e. a cpu on the fvp. Ignore any other affinity level.
*/
if
(
psci_get_pstate_afflvl
(
power_state
)
!=
MPIDR_AFFLVL0
)
return
PSCI_E_INVALID_PARAMS
;
}
/*
* We expect the 'state id' to be zero.
*/
if
(
psci_get_pstate_id
(
power_state
))
return
PSCI_E_INVALID_PARAMS
;
return
PSCI_E_SUCCESS
;
}
/*******************************************************************************
* Export the platform handlers to enable psci to invoke them
******************************************************************************/
...
...
@@ -356,7 +313,7 @@ static const plat_pm_ops_t fvp_plat_pm_ops = {
.
affinst_suspend_finish
=
fvp_affinst_suspend_finish
,
.
system_off
=
fvp_system_off
,
.
system_reset
=
fvp_system_reset
,
.
validate_power_state
=
fvp
_validate_power_state
.
validate_power_state
=
arm
_validate_power_state
};
/*******************************************************************************
...
...
plat/arm/board/fvp/fvp_private.h
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __FVP_PRIVATE_H__
#define __FVP_PRIVATE_H__
#include <plat_arm.h>
/*******************************************************************************
* Function and variable prototypes
******************************************************************************/
void
fvp_config_setup
(
void
);
void
fvp_cci_init
(
void
);
void
fvp_cci_enable
(
void
);
void
fvp_cci_disable
(
void
);
#endif
/* __FVP_PRIVATE_H__ */
plat/arm/board/fvp/fvp_security.c
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arm_config.h>
#include <plat_arm.h>
/*
* We assume that all security programming is done by the primary core.
*/
void
plat_arm_security_setup
(
void
)
{
/*
* The Base FVP has a TrustZone address space controller, the Foundation
* FVP does not. Trying to program the device on the foundation FVP will
* cause an abort.
*
* If the platform had additional peripheral specific security
* configurations, those would be configured here.
*/
if
(
get_arm_config
()
->
flags
&
ARM_CONFIG_HAS_TZC
)
arm_tzc_setup
();
}
plat/fvp/fvp_topology.c
→
plat/
arm/board/
fvp/fvp_topology.c
View file @
4731e8f0
/*
* Copyright (c) 2013-201
4
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
5
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -28,11 +28,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <arch.h>
#include <assert.h>
#include <platform_def.h>
/* TODO: Reusing psci error codes & state information. Get our own! */
#include <psci.h>
#include "drivers/pwrc/fvp_pwrc.h"
#include "fvp_def.h"
/* We treat '255' as an invalid affinity instance */
#define AFFINST_INVAL 0xff
...
...
@@ -57,7 +59,7 @@ typedef struct affinity_info {
* is a separate array for each affinity level i.e. cpus and clusters. The child
* and sibling references allow traversal inside and in between the two arrays.
******************************************************************************/
static
affinity_info_t
fvp_aff1_topology_map
[
PLATFO
RM_CLUSTER_COUNT
];
static
affinity_info_t
fvp_aff1_topology_map
[
A
RM_CLUSTER_COUNT
];
static
affinity_info_t
fvp_aff0_topology_map
[
PLATFORM_CORE_COUNT
];
/* Simple global variable to safeguard us from stupidity */
...
...
@@ -113,7 +115,7 @@ unsigned int plat_get_aff_count(unsigned int aff_lvl,
case
0
:
/* Assert if the cluster id is anything apart from 0 or 1 */
parent_aff_id
=
(
mpidr
>>
MPIDR_AFF1_SHIFT
)
&
MPIDR_AFFLVL_MASK
;
assert
(
parent_aff_id
<
PLATFO
RM_CLUSTER_COUNT
);
assert
(
parent_aff_id
<
A
RM_CLUSTER_COUNT
);
/* Fetch the starting index in the aff0 array */
for
(
ctr
=
fvp_aff1_topology_map
[
parent_aff_id
].
child
;
...
...
@@ -181,19 +183,19 @@ unsigned int plat_get_aff_state(unsigned int aff_lvl,
* the FVP flavour its running on. We construct all the mpidrs we can handle
* and rely on the PWRC.PSYSR to flag absent cpus when their status is queried.
******************************************************************************/
int
fvp_setup
_topology
(
void
)
int
plat_arm
_topology
_setup
(
void
)
{
unsigned
char
aff0
,
aff1
,
aff_state
,
aff0_offset
=
0
;
unsigned
long
mpidr
;
topology_setup_done
=
0
;
for
(
aff1
=
0
;
aff1
<
PLATFO
RM_CLUSTER_COUNT
;
aff1
++
)
{
for
(
aff1
=
0
;
aff1
<
A
RM_CLUSTER_COUNT
;
aff1
++
)
{
fvp_aff1_topology_map
[
aff1
].
child
=
aff0_offset
;
fvp_aff1_topology_map
[
aff1
].
sibling
=
aff1
+
1
;
for
(
aff0
=
0
;
aff0
<
PLATFORM
_MAX_CPUS_PER_CLUSTER
;
aff0
++
)
{
for
(
aff0
=
0
;
aff0
<
FVP
_MAX_CPUS_PER_CLUSTER
;
aff0
++
)
{
mpidr
=
aff1
<<
MPIDR_AFF1_SHIFT
;
mpidr
|=
aff0
<<
MPIDR_AFF0_SHIFT
;
...
...
plat/arm/board/fvp/include/plat_macros.S
0 → 100644
View file @
4731e8f0
/*
*
Copyright
(
c
)
2014
-
2015
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
Redistribution
and
use
in
source
and
binary
forms
,
with
or
without
*
modification
,
are
permitted
provided
that
the
following
conditions
are
met
:
*
*
Redistributions
of
source
code
must
retain
the
above
copyright
notice
,
this
*
list
of
conditions
and
the
following
disclaimer
.
*
*
Redistributions
in
binary
form
must
reproduce
the
above
copyright
notice
,
*
this
list
of
conditions
and
the
following
disclaimer
in
the
documentation
*
and
/
or
other
materials
provided
with
the
distribution
.
*
*
Neither
the
name
of
ARM
nor
the
names
of
its
contributors
may
be
used
*
to
endorse
or
promote
products
derived
from
this
software
without
specific
*
prior
written
permission
.
*
*
THIS
SOFTWARE
IS
PROVIDED
BY
THE
COPYRIGHT
HOLDERS
AND
CONTRIBUTORS
"AS IS"
*
AND
ANY
EXPRESS
OR
IMPLIED
WARRANTIES
,
INCLUDING
,
BUT
NOT
LIMITED
TO
,
THE
*
IMPLIED
WARRANTIES
OF
MERCHANTABILITY
AND
FITNESS
FOR
A
PARTICULAR
PURPOSE
*
ARE
DISCLAIMED
.
IN
NO
EVENT
SHALL
THE
COPYRIGHT
HOLDER
OR
CONTRIBUTORS
BE
*
LIABLE
FOR
ANY
DIRECT
,
INDIRECT
,
INCIDENTAL
,
SPECIAL
,
EXEMPLARY
,
OR
*
CONSEQUENTIAL
DAMAGES
(
INCLUDING
,
BUT
NOT
LIMITED
TO
,
PROCUREMENT
OF
*
SUBSTITUTE
GOODS
OR
SERVICES
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
*
INTERRUPTION
)
HOWEVER
CAUSED
AND
ON
ANY
THEORY
OF
LIABILITY
,
WHETHER
IN
*
CONTRACT
,
STRICT
LIABILITY
,
OR
TORT
(
INCLUDING
NEGLIGENCE
OR
OTHERWISE
)
*
ARISING
IN
ANY
WAY
OUT
OF
THE
USE
OF
THIS
SOFTWARE
,
EVEN
IF
ADVISED
OF
THE
*
POSSIBILITY
OF
SUCH
DAMAGE
.
*/
#ifndef __PLAT_MACROS_S__
#define __PLAT_MACROS_S__
#include <arm_macros.S>
#include <v2m_def.h>
#include "../fvp_def.h"
/
*
---------------------------------------------
*
The
below
required
platform
porting
macro
*
prints
out
relevant
GIC
registers
whenever
an
*
unhandled
exception
is
taken
in
BL3
-
1
.
*
Clobbers
:
x0
-
x10
,
x16
,
x17
,
sp
*
---------------------------------------------
*/
.
macro
plat_print_gic_regs
/
*
*
Detect
if
we
're using the base memory map or
*
the
legacy
VE
memory
map
*/
mov_imm
x0
,
(
V2M_SYSREGS_BASE
+
V2M_SYS_ID
)
ldr
w16
,
[
x0
]
/
*
Extract
BLD
(
12
th
-
15
th
bits
)
from
the
SYS_ID
*/
ubfx
x16
,
x16
,
#
V2M_SYS_ID_BLD_SHIFT
,
#
4
/
*
Check
if
VE
mmap
*/
cmp
w16
,
#
BLD_GIC_VE_MMAP
b.eq
use_ve_mmap
/
*
Check
if
Cortex
-
A53
/
A57
mmap
*/
cmp
w16
,
#
BLD_GIC_A53A57_MMAP
b.ne
exit_print_gic_regs
mov_imm
x17
,
BASE_GICC_BASE
mov_imm
x16
,
BASE_GICD_BASE
b
print_gicc_regs
use_ve_mmap
:
mov_imm
x17
,
VE_GICC_BASE
mov_imm
x16
,
VE_GICD_BASE
print_gicc_regs
:
arm_print_gic_regs
.
endm
#endif /* __PLAT_MACROS_S__ */
plat/arm/board/fvp/include/platform_def.h
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __PLATFORM_DEF_H__
#define __PLATFORM_DEF_H__
#include <arm_def.h>
#include <board_arm_def.h>
#include <common_def.h>
#include <tzc400.h>
#include <v2m_def.h>
#include "../fvp_def.h"
/*
* Most platform porting definitions provided by included headers
*/
/*
* Required ARM standard platform porting definitions
*/
#define PLAT_ARM_CLUSTER0_CORE_COUNT 4
#define PLAT_ARM_CLUSTER1_CORE_COUNT 4
#define PLAT_ARM_TRUSTED_ROM_BASE 0x00000000
#define PLAT_ARM_TRUSTED_ROM_SIZE 0x04000000
/* 64 MB */
#define PLAT_ARM_TRUSTED_DRAM_BASE 0x06000000
#define PLAT_ARM_TRUSTED_DRAM_SIZE 0x02000000
/* 32 MB */
/* No SCP in FVP */
#define PLAT_ARM_SCP_TZC_DRAM1_SIZE MAKE_ULL(0x0)
#define PLAT_ARM_DRAM2_SIZE MAKE_ULL(0x780000000)
#define PLAT_ARM_SHARED_RAM_CACHED 1
/*
* Load address of BL3-3 for this platform port
*/
#define PLAT_ARM_NS_IMAGE_OFFSET (ARM_DRAM1_BASE + 0x8000000)
/*
* PL011 related constants
*/
#define PLAT_ARM_BOOT_UART_BASE V2M_IOFPGA_UART0_BASE
#define PLAT_ARM_BOOT_UART_CLK_IN_HZ V2M_IOFPGA_UART0_CLK_IN_HZ
#define PLAT_ARM_CRASH_UART_BASE V2M_IOFPGA_UART1_BASE
#define PLAT_ARM_CRASH_UART_CLK_IN_HZ V2M_IOFPGA_UART1_CLK_IN_HZ
#define PLAT_ARM_TSP_UART_BASE V2M_IOFPGA_UART2_BASE
#define PLAT_ARM_TSP_UART_CLK_IN_HZ V2M_IOFPGA_UART2_CLK_IN_HZ
/* CCI related constants */
#define PLAT_ARM_CCI_BASE 0x2c090000
#define PLAT_ARM_CCI_CLUSTER0_SL_IFACE_IX 3
#define PLAT_ARM_CCI_CLUSTER1_SL_IFACE_IX 4
/* TrustZone controller related constants
*
* Currently only filters 0 and 2 are connected on Base FVP.
* Filter 0 : CPU clusters (no access to DRAM by default)
* Filter 1 : not connected
* Filter 2 : LCDs (access to VRAM allowed by default)
* Filter 3 : not connected
* Programming unconnected filters will have no effect at the
* moment. These filter could, however, be connected in future.
* So care should be taken not to configure the unused filters.
*
* Allow only non-secure access to all DRAM to supported devices.
* Give access to the CPUs and Virtio. Some devices
* would normally use the default ID so allow that too.
*/
#define PLAT_ARM_TZC_FILTERS REG_ATTR_FILTER_BIT(0)
#define PLAT_ARM_TZC_NS_DEV_ACCESS ( \
TZC_REGION_ACCESS_RDWR(FVP_NSAID_DEFAULT) | \
TZC_REGION_ACCESS_RDWR(FVP_NSAID_PCI) | \
TZC_REGION_ACCESS_RDWR(FVP_NSAID_AP) | \
TZC_REGION_ACCESS_RDWR(FVP_NSAID_VIRTIO) | \
TZC_REGION_ACCESS_RDWR(FVP_NSAID_VIRTIO_OLD))
#endif
/* __PLATFORM_DEF_H__ */
plat/
juno/plat-tsp.l
d.
S
→
plat/
arm/board/fvp/include/platform_oi
d.
h
View file @
4731e8f0
/*
*
Copyright
(
c
)
201
4
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
* Copyright (c) 201
5
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -27,5 +27,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "../../../../../include/plat/arm/board/common/board_arm_oid.h"
ASSERT
(
__BL32_END__
<=
BL2_BASE
,
"BL3-2 image overlaps BL2 image."
)
/*
* Required platform OIDs
* (Provided by included header)
*/
plat/arm/board/fvp/platform.mk
0 → 100644
View file @
4731e8f0
#
# Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# Neither the name of ARM nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
PLAT_INCLUDES
:=
-Iinclude
/plat/arm/board/common
\
-Iplat
/arm/board/fvp/include
PLAT_BL_COMMON_SOURCES
:=
drivers/arm/pl011/pl011_console.S
\
plat/arm/board/fvp/aarch64/fvp_common.c
BL1_SOURCES
+=
drivers/io/io_semihosting.c
\
lib/cpus/aarch64/aem_generic.S
\
lib/cpus/aarch64/cortex_a53.S
\
lib/cpus/aarch64/cortex_a57.S
\
lib/semihosting/semihosting.c
\
lib/semihosting/aarch64/semihosting_call.S
\
plat/arm/board/fvp/aarch64/fvp_helpers.S
\
plat/arm/board/fvp/fvp_bl1_setup.c
\
plat/arm/board/fvp/fvp_io_storage.c
BL2_SOURCES
+=
drivers/io/io_semihosting.c
\
lib/semihosting/semihosting.c
\
lib/semihosting/aarch64/semihosting_call.S
\
plat/arm/board/fvp/fvp_bl2_setup.c
\
plat/arm/board/fvp/fvp_io_storage.c
\
plat/arm/board/fvp/fvp_security.c
BL31_SOURCES
+=
lib/cpus/aarch64/aem_generic.S
\
lib/cpus/aarch64/cortex_a53.S
\
lib/cpus/aarch64/cortex_a57.S
\
plat/arm/board/fvp/fvp_bl31_setup.c
\
plat/arm/board/fvp/fvp_pm.c
\
plat/arm/board/fvp/fvp_security.c
\
plat/arm/board/fvp/fvp_topology.c
\
plat/arm/board/fvp/aarch64/fvp_helpers.S
\
plat/arm/board/fvp/drivers/pwrc/fvp_pwrc.c
ifneq
(${TRUSTED_BOARD_BOOT},0)
BL1_SOURCES
+=
plat/arm/board/common/board_arm_trusted_boot.c
BL2_SOURCES
+=
plat/arm/board/common/board_arm_trusted_boot.c
endif
include
plat/arm/common/arm_common.mk
plat/arm/board/fvp/tsp/fvp_tsp_setup.c
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <plat_arm.h>
#include "../fvp_private.h"
void
tsp_early_platform_setup
(
void
)
{
arm_tsp_early_platform_setup
();
/* Initialize the platform config for future decision making */
fvp_config_setup
();
}
plat/fvp/tsp/tsp-fvp.mk
→
plat/
arm/board/
fvp/tsp/tsp-fvp.mk
View file @
4731e8f0
#
# Copyright (c) 2013-201
4
, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2013-201
5
, ARM Limited and Contributors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
...
...
@@ -29,10 +29,6 @@
#
# TSP source files specific to FVP platform
BL32_SOURCES
+=
drivers/arm/gic/arm_gic.c
\
drivers/arm/gic/gic_v2.c
\
plat/common/aarch64/platform_mp_stack.S
\
plat/common/plat_gic.c
\
plat/fvp/aarch64/fvp_common.c
\
plat/fvp/aarch64/fvp_helpers.S
\
plat/fvp/tsp/tsp_fvp_setup.c
BL32_SOURCES
+=
plat/arm/board/fvp/tsp/fvp_tsp_setup.c
include
plat/arm/common/tsp/arm_tsp.mk
plat/juno/aarch64/
plat
_helpers.S
→
plat/
arm/board/
juno/aarch64/
juno
_helpers.S
View file @
4731e8f0
/*
*
Copyright
(
c
)
2013
-
201
4
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2013
-
201
5
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
Redistribution
and
use
in
source
and
binary
forms
,
with
or
without
*
modification
,
are
permitted
provided
that
the
following
conditions
are
met
:
...
...
@@ -32,90 +32,12 @@
#include <asm_macros.S>
#include <bl_common.h>
#include <cortex_a57.h>
#include <cpu_macros.S>
#include <platform_def.h>
#include <v2m_def.h>
#include "../juno_def.h"
.
globl
plat_crash_console_init
.
globl
plat_crash_console_putc
.
globl
plat_report_exception
.
globl
plat_reset_handler
.
globl
platform_get_core_pos
.
globl
platform_mem_init
/
*
Define
a
crash
console
for
the
plaform
*/
#define JUNO_CRASH_CONSOLE_BASE PL011_UART3_BASE
/
*
---------------------------------------------
*
int
plat_crash_console_init
(
void
)
*
Function
to
initialize
the
crash
console
*
without
a
C
Runtime
to
print
crash
report
.
*
Clobber
list
:
x0
,
x1
,
x2
*
---------------------------------------------
*/
func
plat_crash_console_init
mov_imm
x0
,
JUNO_CRASH_CONSOLE_BASE
mov_imm
x1
,
PL011_UART3_CLK_IN_HZ
mov_imm
x2
,
PL011_BAUDRATE
b
console_core_init
endfunc
plat_crash_console_init
/
*
---------------------------------------------
*
int
plat_crash_console_putc
(
int
c
)
*
Function
to
print
a
character
on
the
crash
*
console
without
a
C
Runtime
.
*
Clobber
list
:
x1
,
x2
*
---------------------------------------------
*/
func
plat_crash_console_putc
mov_imm
x1
,
JUNO_CRASH_CONSOLE_BASE
b
console_core_putc
endfunc
plat_crash_console_putc
/
*
---------------------------------------------
*
void
plat_report_exception
(
unsigned
int
type
)
*
Function
to
report
an
unhandled
exception
*
with
platform
-
specific
means
.
*
On
Juno
platform
,
it
updates
the
LEDs
*
to
indicate
where
we
are
*
---------------------------------------------
*/
func
plat_report_exception
mrs
x1
,
CurrentEl
lsr
x1
,
x1
,
#
MODE_EL_SHIFT
lsl
x1
,
x1
,
#
SYS_LED_EL_SHIFT
lsl
x0
,
x0
,
#
SYS_LED_EC_SHIFT
mov
x2
,
#(
SECURE
<<
SYS_LED_SS_SHIFT
)
orr
x0
,
x0
,
x2
orr
x0
,
x0
,
x1
mov
x1
,
#
VE_SYSREGS_BASE
add
x1
,
x1
,
#
V2M_SYS_LED
str
w0
,
[
x1
]
ret
endfunc
plat_report_exception
/
*
*
Return
0
to
3
for
the
A53s
and
4
or
5
for
the
A57s
*/
func
platform_get_core_pos
and
x1
,
x0
,
#
MPIDR_CPU_MASK
and
x0
,
x0
,
#
MPIDR_CLUSTER_MASK
eor
x0
,
x0
,
#(
1
<<
MPIDR_AFFINITY_BITS
)
//
swap
A53
/
A57
order
add
x0
,
x1
,
x0
,
LSR
#
6
ret
endfunc
platform_get_core_pos
.
globl
plat_reset_handler
/
*
-----------------------------------------------------
*
void
platform_mem_init
(
void
)
;
*
*
We
don
't need to carry out any memory initialization
*
on
Juno
.
The
Secure
RAM
is
accessible
straight
away
.
*
-----------------------------------------------------
*/
func
platform_mem_init
ret
endfunc
platform_mem_init
/
*
--------------------------------------------------------------------
*
void
plat_reset_handler
(
void
)
;
...
...
@@ -149,10 +71,10 @@ func plat_reset_handler
*
--------------------------------------------------------------------
*/
/
*
Read
the
V2M
SYS_ID
register
*/
mov_imm
x0
,
(
V
E
_SYSREGS_BASE
+
V2M_SYS_ID
)
mov_imm
x0
,
(
V
2M
_SYSREGS_BASE
+
V2M_SYS_ID
)
ldr
w1
,
[
x0
]
/
*
Extract
board
revision
from
the
SYS_ID
*/
ubfx
x1
,
x1
,
#
SYS_ID_REV_SHIFT
,
#
4
ubfx
x1
,
x1
,
#
V2M_
SYS_ID_REV_SHIFT
,
#
4
/
*
*
On
Juno
R0
:
x2
:
=
REV_JUNO_R0
-
1
=
0
*
On
Juno
R1
:
x2
:
=
REV_JUNO_R1
-
1
=
1
...
...
@@ -183,7 +105,8 @@ A57:
mov
x0
,
#
L2_DATA_RAM_LATENCY_3_CYCLES
cbnz
x2
,
apply_l2_ram_latencies
/
*
On
Juno
r0
,
also
change
the
L2
Tag
RAM
latency
to
3
cycles
*/
orr
x0
,
x0
,
#(
L2_TAG_RAM_LATENCY_3_CYCLES
<<
L2CTLR_TAG_RAM_LATENCY_SHIFT
)
orr
x0
,
x0
,
#(
L2_TAG_RAM_LATENCY_3_CYCLES
<<
\
L2CTLR_TAG_RAM_LATENCY_SHIFT
)
apply_l2_ram_latencies
:
msr
L2CTLR_EL1
,
x0
...
...
plat/arm/board/juno/include/plat_macros.S
0 → 100644
View file @
4731e8f0
/*
*
Copyright
(
c
)
2014
-
2015
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
Redistribution
and
use
in
source
and
binary
forms
,
with
or
without
*
modification
,
are
permitted
provided
that
the
following
conditions
are
met
:
*
*
Redistributions
of
source
code
must
retain
the
above
copyright
notice
,
this
*
list
of
conditions
and
the
following
disclaimer
.
*
*
Redistributions
in
binary
form
must
reproduce
the
above
copyright
notice
,
*
this
list
of
conditions
and
the
following
disclaimer
in
the
documentation
*
and
/
or
other
materials
provided
with
the
distribution
.
*
*
Neither
the
name
of
ARM
nor
the
names
of
its
contributors
may
be
used
*
to
endorse
or
promote
products
derived
from
this
software
without
specific
*
prior
written
permission
.
*
*
THIS
SOFTWARE
IS
PROVIDED
BY
THE
COPYRIGHT
HOLDERS
AND
CONTRIBUTORS
"AS IS"
*
AND
ANY
EXPRESS
OR
IMPLIED
WARRANTIES
,
INCLUDING
,
BUT
NOT
LIMITED
TO
,
THE
*
IMPLIED
WARRANTIES
OF
MERCHANTABILITY
AND
FITNESS
FOR
A
PARTICULAR
PURPOSE
*
ARE
DISCLAIMED
.
IN
NO
EVENT
SHALL
THE
COPYRIGHT
HOLDER
OR
CONTRIBUTORS
BE
*
LIABLE
FOR
ANY
DIRECT
,
INDIRECT
,
INCIDENTAL
,
SPECIAL
,
EXEMPLARY
,
OR
*
CONSEQUENTIAL
DAMAGES
(
INCLUDING
,
BUT
NOT
LIMITED
TO
,
PROCUREMENT
OF
*
SUBSTITUTE
GOODS
OR
SERVICES
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
*
INTERRUPTION
)
HOWEVER
CAUSED
AND
ON
ANY
THEORY
OF
LIABILITY
,
WHETHER
IN
*
CONTRACT
,
STRICT
LIABILITY
,
OR
TORT
(
INCLUDING
NEGLIGENCE
OR
OTHERWISE
)
*
ARISING
IN
ANY
WAY
OUT
OF
THE
USE
OF
THIS
SOFTWARE
,
EVEN
IF
ADVISED
OF
THE
*
POSSIBILITY
OF
SUCH
DAMAGE
.
*/
#ifndef __PLAT_MACROS_S__
#define __PLAT_MACROS_S__
#include <css_macros.S>
/*
*
Required
platform
porting
macros
*
(
Provided
by
included
headers
)
*/
#endif /* __PLAT_MACROS_S__ */
plat/arm/board/juno/include/platform_def.h
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2014-2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __PLATFORM_DEF_H__
#define __PLATFORM_DEF_H__
#include <arm_def.h>
#include <board_arm_def.h>
#include <board_css_def.h>
#include <common_def.h>
#include <css_def.h>
#include <soc_css_def.h>
#include <tzc400.h>
#include <v2m_def.h>
#include "../juno_def.h"
/*
* Most platform porting definitions provided by included headers
*/
/*
* Required ARM standard platform porting definitions
*/
#define PLAT_ARM_CLUSTER0_CORE_COUNT 2
#define PLAT_ARM_CLUSTER1_CORE_COUNT 4
/* Use the bypass address */
#define PLAT_ARM_TRUSTED_ROM_BASE V2M_FLASH0_BASE + BL1_ROM_BYPASS_OFFSET
/*
* Actual ROM size on Juno is 64 KB, but TBB currently requires at least 80 KB
* in debug mode. We can test TBB on Juno bypassing the ROM and using 128 KB of
* flash
*/
#if TRUSTED_BOARD_BOOT
#define PLAT_ARM_TRUSTED_ROM_SIZE 0x00020000
#else
#define PLAT_ARM_TRUSTED_ROM_SIZE 0x00010000
#endif
/* TRUSTED_BOARD_BOOT */
/* CCI related constants */
#define PLAT_ARM_CCI_BASE 0x2c090000
#define PLAT_ARM_CCI_CLUSTER0_SL_IFACE_IX 4
#define PLAT_ARM_CCI_CLUSTER1_SL_IFACE_IX 3
/* TZC related constants */
#define PLAT_ARM_TZC_NS_DEV_ACCESS ( \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_CCI400) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_PCIE) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_HDLCD0) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_HDLCD1) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_USB) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_DMA330) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_THINLINKS) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_AP) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_GPU) | \
TZC_REGION_ACCESS_RDWR(TZC400_NSAID_CORESIGHT))
/*
* Required ARM CSS based platform porting definitions
*/
/* GIC related constants (no GICR in GIC-400) */
#define PLAT_CSS_GICD_BASE 0x2c010000
#define PLAT_CSS_GICR_BASE 0x0
#define PLAT_CSS_GICC_BASE 0x2c02f000
#define PLAT_CSS_GICH_BASE 0x2c04f000
#define PLAT_CSS_GICV_BASE 0x2c06f000
#define PLAT_CSS_IRQ_SEC_LIST CSS_IRQ_MHU, \
CSS_IRQ_GPU_SMMU_0, \
CSS_IRQ_GPU_SMMU_1, \
CSS_IRQ_ETR_SMMU, \
CSS_IRQ_TZC, \
CSS_IRQ_TZ_WDOG
/*
* Required ARM CSS SoC based platform porting definitions
*/
/* CSS SoC NIC-400 Global Programmers View (GPV) */
#define PLAT_SOC_CSS_NIC400_BASE 0x2a000000
#endif
/* __PLATFORM_DEF_H__ */
plat/arm/board/juno/include/platform_oid.h
0 → 100644
View file @
4731e8f0
/*
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of ARM nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "../../../../../include/plat/arm/board/common/board_arm_oid.h"
/*
* Required platform OIDs
* (Provided by included header)
*/
Prev
1
2
3
4
5
6
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