diff --git a/plat/rpi/rpi3/rpi3_private.h b/plat/rpi/common/include/rpi_shared.h similarity index 95% rename from plat/rpi/rpi3/rpi3_private.h rename to plat/rpi/common/include/rpi_shared.h index b01c40c30ea10aa00e59bbb170443bedd7fb9eed..686343892629beda47b5295c423d1839a8f70afe 100644 --- a/plat/rpi/rpi3/rpi3_private.h +++ b/plat/rpi/common/include/rpi_shared.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef RPI3_PRIVATE_H -#define RPI3_PRIVATE_H +#ifndef RPI_SHARED_H +#define RPI_SHARED_H #include <stdint.h> diff --git a/plat/rpi/rpi3/rpi3_common.c b/plat/rpi/common/rpi3_common.c similarity index 98% rename from plat/rpi/rpi3/rpi3_common.c rename to plat/rpi/common/rpi3_common.c index 85a26c22269ee101b08ae18547e5c40ebbaaf294..ac0330899c9ef7a3319e3dbee3203ce3e8fc51c5 100644 --- a/plat/rpi/rpi3/rpi3_common.c +++ b/plat/rpi/common/rpi3_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -17,7 +17,7 @@ #include <lib/xlat_tables/xlat_tables_v2.h> #include <rpi_hw.h> -#include "rpi3_private.h" +#include <rpi_shared.h> #define MAP_DEVICE0 MAP_REGION_FLAT(DEVICE0_BASE, \ DEVICE0_SIZE, \ diff --git a/plat/rpi/rpi3/rpi3_image_load.c b/plat/rpi/common/rpi3_image_load.c similarity index 100% rename from plat/rpi/rpi3/rpi3_image_load.c rename to plat/rpi/common/rpi3_image_load.c diff --git a/plat/rpi/rpi3/rpi3_io_storage.c b/plat/rpi/common/rpi3_io_storage.c similarity index 100% rename from plat/rpi/rpi3/rpi3_io_storage.c rename to plat/rpi/common/rpi3_io_storage.c diff --git a/plat/rpi/rpi3/rpi3_pm.c b/plat/rpi/common/rpi3_pm.c similarity index 100% rename from plat/rpi/rpi3/rpi3_pm.c rename to plat/rpi/common/rpi3_pm.c diff --git a/plat/rpi/rpi3/rpi3_rotpk.S b/plat/rpi/common/rpi3_rotpk.S similarity index 100% rename from plat/rpi/rpi3/rpi3_rotpk.S rename to plat/rpi/common/rpi3_rotpk.S diff --git a/plat/rpi/rpi3/rpi3_stack_protector.c b/plat/rpi/common/rpi3_stack_protector.c similarity index 93% rename from plat/rpi/rpi3/rpi3_stack_protector.c rename to plat/rpi/common/rpi3_stack_protector.c index 6f49f617beb46fe353fc43211416922b66180652..aae5fac72c29fece35eb89298b34152acd7814b1 100644 --- a/plat/rpi/rpi3/rpi3_stack_protector.c +++ b/plat/rpi/common/rpi3_stack_protector.c @@ -9,7 +9,7 @@ #include <lib/utils.h> #include <lib/utils_def.h> -#include "rpi3_private.h" +#include <drivers/rpi3/rng/rpi3_rng.h> /* Get 128 bits of entropy and fuse the values together to form the canary. */ #define TRNG_NBYTES 16U diff --git a/plat/rpi/rpi3/rpi3_topology.c b/plat/rpi/common/rpi3_topology.c similarity index 94% rename from plat/rpi/rpi3/rpi3_topology.c rename to plat/rpi/common/rpi3_topology.c index 200d41dd166c787454962b4f8c36e53dbfe96827..3747287c2fba854214b8628682c9e22efa4c5c4c 100644 --- a/plat/rpi/rpi3/rpi3_topology.c +++ b/plat/rpi/common/rpi3_topology.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -10,7 +10,7 @@ #include <arch.h> -#include "rpi3_private.h" +#include <rpi_shared.h> /* The power domain tree descriptor */ static unsigned char power_domain_tree_desc[] = { diff --git a/plat/rpi/rpi3/rpi3_trusted_boot.c b/plat/rpi/common/rpi3_trusted_boot.c similarity index 100% rename from plat/rpi/rpi3/rpi3_trusted_boot.c rename to plat/rpi/common/rpi3_trusted_boot.c diff --git a/plat/rpi/rpi3/platform.mk b/plat/rpi/rpi3/platform.mk index 21a880c0d1e1ffb31a8542bb36456401bfc60f7e..a21a7709a3d042a865d881e587e533d4a5a1783a 100644 --- a/plat/rpi/rpi3/platform.mk +++ b/plat/rpi/rpi3/platform.mk @@ -7,10 +7,11 @@ include lib/libfdt/libfdt.mk include lib/xlat_tables_v2/xlat_tables.mk -PLAT_INCLUDES := -Iplat/rpi/rpi3/include +PLAT_INCLUDES := -Iplat/rpi/common/include \ + -Iplat/rpi/rpi3/include PLAT_BL_COMMON_SOURCES := drivers/ti/uart/aarch64/16550_console.S \ - plat/rpi/rpi3/rpi3_common.c \ + plat/rpi/common/rpi3_common.c \ ${XLAT_TABLES_LIB_SRCS} BL1_SOURCES += drivers/io/io_fip.c \ @@ -20,7 +21,7 @@ BL1_SOURCES += drivers/io/io_fip.c \ plat/common/aarch64/platform_mp_stack.S \ plat/rpi/rpi3/aarch64/plat_helpers.S \ plat/rpi/rpi3/rpi3_bl1_setup.c \ - plat/rpi/rpi3/rpi3_io_storage.c \ + plat/rpi/common/rpi3_io_storage.c \ drivers/rpi3/mailbox/rpi3_mbox.c \ plat/rpi/rpi3/rpi_mbox_board.c @@ -39,15 +40,15 @@ BL2_SOURCES += common/desc_image_load.c \ plat/rpi/rpi3/aarch64/plat_helpers.S \ plat/rpi/rpi3/aarch64/rpi3_bl2_mem_params_desc.c \ plat/rpi/rpi3/rpi3_bl2_setup.c \ - plat/rpi/rpi3/rpi3_image_load.c \ - plat/rpi/rpi3/rpi3_io_storage.c + plat/rpi/common/rpi3_image_load.c \ + plat/rpi/common/rpi3_io_storage.c BL31_SOURCES += lib/cpus/aarch64/cortex_a53.S \ plat/common/plat_psci_common.c \ plat/rpi/rpi3/aarch64/plat_helpers.S \ plat/rpi/rpi3/rpi3_bl31_setup.c \ - plat/rpi/rpi3/rpi3_pm.c \ - plat/rpi/rpi3/rpi3_topology.c \ + plat/rpi/common/rpi3_pm.c \ + plat/rpi/common/rpi3_topology.c \ ${LIBFDT_SRCS} # Tune compiler for Cortex-A53 @@ -160,7 +161,7 @@ endif ifneq ($(ENABLE_STACK_PROTECTOR), 0) PLAT_BL_COMMON_SOURCES += drivers/rpi3/rng/rpi3_rng.c \ - plat/rpi/rpi3/rpi3_stack_protector.c + plat/rpi/common/rpi3_stack_protector.c endif ifeq (${SPD},opteed) @@ -190,13 +191,13 @@ ifneq (${TRUSTED_BOARD_BOOT},0) BL1_SOURCES += ${AUTH_SOURCES} \ bl1/tbbr/tbbr_img_desc.c \ plat/common/tbbr/plat_tbbr.c \ - plat/rpi/rpi3/rpi3_trusted_boot.c \ - plat/rpi/rpi3/rpi3_rotpk.S + plat/rpi/common/rpi3_trusted_boot.c \ + plat/rpi/common/rpi3_rotpk.S BL2_SOURCES += ${AUTH_SOURCES} \ plat/common/tbbr/plat_tbbr.c \ - plat/rpi/rpi3/rpi3_trusted_boot.c \ - plat/rpi/rpi3/rpi3_rotpk.S + plat/rpi/common/rpi3_trusted_boot.c \ + plat/rpi/common/rpi3_rotpk.S ROT_KEY = $(BUILD_PLAT)/rot_key.pem ROTPK_HASH = $(BUILD_PLAT)/rotpk_sha256.bin diff --git a/plat/rpi/rpi3/rpi3_bl1_setup.c b/plat/rpi/rpi3/rpi3_bl1_setup.c index b869e9da891790c193a2edb9911439a2b0818f08..31ad31c19e0291c391962425ddfbc750cbf19637 100644 --- a/plat/rpi/rpi3/rpi3_bl1_setup.c +++ b/plat/rpi/rpi3/rpi3_bl1_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -13,7 +13,7 @@ #include <lib/xlat_tables/xlat_mmu_helpers.h> #include <lib/xlat_tables/xlat_tables_defs.h> -#include "rpi3_private.h" +#include <rpi_shared.h> /* Data structure which holds the extents of the trusted SRAM for BL1 */ static meminfo_t bl1_tzram_layout; diff --git a/plat/rpi/rpi3/rpi3_bl2_setup.c b/plat/rpi/rpi3/rpi3_bl2_setup.c index b5e58352aba665b3d7097bc0f34764b624f37606..991c0fcb28c5901e8fed0d8cec983ccc65e1843f 100644 --- a/plat/rpi/rpi3/rpi3_bl2_setup.c +++ b/plat/rpi/rpi3/rpi3_bl2_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -19,7 +19,7 @@ #include <drivers/rpi3/gpio/rpi3_gpio.h> #include <drivers/rpi3/sdhost/rpi3_sdhost.h> -#include "rpi3_private.h" +#include <rpi_shared.h> /* Data structure which holds the extents of the trusted SRAM for BL2 */ static meminfo_t bl2_tzram_layout __aligned(CACHE_WRITEBACK_GRANULE); diff --git a/plat/rpi/rpi3/rpi3_bl31_setup.c b/plat/rpi/rpi3/rpi3_bl31_setup.c index 2f1bc6493e81d77666a28ca61826c5a7c606c51a..a9efc52b8231f7b06907750e3cb4795719893604 100644 --- a/plat/rpi/rpi3/rpi3_bl31_setup.c +++ b/plat/rpi/rpi3/rpi3_bl31_setup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -15,7 +15,7 @@ #include <lib/xlat_tables/xlat_tables_defs.h> #include <plat/common/platform.h> -#include "rpi3_private.h" +#include <rpi_shared.h> /* * Placeholder variables for copying the arguments that have been passed to