Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
ppu_v1: Include Unit Tests for the PPU V1
Browse files Browse the repository at this point in the history
This patch includes the UTs for the new deeper locking state changes to
the PPU V1, and for the alarm being introduced to handle the locking
time outs.

Signed-off-by: Katherine Vincent <[email protected]>
Change-Id: Ib7d4188b707e072883b617ede9f465b626804be7
  • Loading branch information
katvin01 authored and leandro-arm committed Mar 21, 2024
1 parent cbb598c commit 59c03d0
Show file tree
Hide file tree
Showing 7 changed files with 8,481 additions and 7 deletions.
10 changes: 6 additions & 4 deletions module/ppu_v1/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
# Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand All @@ -27,6 +27,8 @@ list(APPEND MOCK_REPLACEMENTS fwk_notification)

include(${SCP_ROOT}/unit_test/module_common.cmake)

target_sources(${UNIT_TEST_TARGET}
PRIVATE
${MODULE_UT_MOCK_SRC}/Mockppu_v1.c)
target_compile_definitions(${UNIT_TEST_TARGET}
PUBLIC "BUILD_HAS_MOD_POWER_DOMAIN")

target_compile_definitions(${UNIT_TEST_TARGET}
PUBLIC "BUILD_HAS_MOD_TIMER")
27 changes: 26 additions & 1 deletion module/ppu_v1/test/config_ppu_v1.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand All @@ -10,6 +10,31 @@

#include <mod_ppu_v1.h>

#include <fwk_id.h>
#include <fwk_macros.h>
#include <fwk_module.h>
#include <fwk_module_idx.h>

enum pd_ppu_idx {
PD_PPU_IDX_0,
PD_PPU_IDX_1,
PD_PPU_IDX_COUNT,
PD_PPU_IDX_NONE = UINT32_MAX
};

static const struct mod_ppu_v1_pd_config pd_ppu_ctx_config[PD_PPU_IDX_COUNT] = {
[PD_PPU_IDX_0] = {
.pd_type = MOD_PD_TYPE_CORE,
.alarm_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, PD_PPU_IDX_0, 0),
.alarm_delay = 10,
},
[PD_PPU_IDX_1] = {
.pd_type = MOD_PD_TYPE_CORE,
.alarm_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_TIMER, PD_PPU_IDX_1, 0),
.alarm_delay = 10,
},
};

static struct mod_ppu_v1_config ppu_v1_config_data_ut = {
.num_of_cores_in_cluster = 2,
};
6 changes: 5 additions & 1 deletion module/ppu_v1/test/fwk_module_idx.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand All @@ -13,6 +13,7 @@
enum fwk_module_idx {
FWK_MODULE_IDX_PPU_V1,
FWK_MODULE_IDX_POWER_DOMAIN,
FWK_MODULE_IDX_TIMER,
FWK_MODULE_IDX_COUNT,
};

Expand All @@ -22,4 +23,7 @@ static const fwk_id_t fwk_module_id_ppu_v1 =
static const fwk_id_t fwk_module_id_power_domain =
FWK_ID_MODULE_INIT(FWK_MODULE_IDX_POWER_DOMAIN);

static const fwk_id_t fwk_module_id_timer =
FWK_ID_MODULE_INIT(FWK_MODULE_IDX_TIMER);

#endif /* TEST_FWK_MODULE_MODULE_IDX_H */
Loading

0 comments on commit 59c03d0

Please sign in to comment.