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

module: timer: add API to update timer status without alarm #794

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d92b3ff
scmi: Shorten long error messages
nicola-mazzucato-arm Dec 22, 2023
b9b7aa9
module/cmn_cyprus: suppress release build warnings
shriram-k-arm Dec 28, 2023
82f04c2
module/cmn_cyprus: fix incorrect format specifier for clang
shriram-k-arm Dec 28, 2023
843f2f0
rdfremont: add sid module config data for scp_ramfw
shriram-k-arm Sep 14, 2023
90da07c
rdfremont: add system info module config data for scp_ramfw
shriram-k-arm Sep 11, 2023
c1beb21
rdfremont: add pl011 module config data for scp_ramfw
shriram-k-arm Sep 11, 2023
d7fcf08
rdfremont: configure I/O stream for scp_ramfw
shriram-k-arm Sep 11, 2023
e6b12ca
rdfremont: add MPU module config data for scp_ramfw
shriram-k-arm Sep 11, 2023
1df315d
rdfremont: add SCP power control block register declaration
shriram-k-arm Sep 11, 2023
3e325b9
rdfremont: add core manager register block declaration
shriram-k-arm Sep 12, 2023
f43b715
rdfremont: add System PIK register space declaration
shriram-k-arm Sep 12, 2023
522e4f5
rdfremont: add config data for system pll driver in scp_ramfw
shriram-k-arm Sep 14, 2023
d762551
rdfremont: add config data for PIK clock driver in scp_ramfw
shriram-k-arm Sep 14, 2023
ce8e70f
rdfremont: add config data for subsystem clock driver in scp_ramfw
shriram-k-arm Sep 14, 2023
caa5b48
rdfremont: add helpers to obtain platform topology in scp_ramfw
shriram-k-arm Sep 14, 2023
a39e8ab
rdfremont: add config data for power domain module in scp_ramfw
shriram-k-arm Sep 12, 2023
f29ae1c
module: timer: add API to update timer status without alarm
Joe-Zhucg May 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions module/cmn_cyprus/src/cmn_cyprus_discovery_setup.c
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 Down Expand Up @@ -66,6 +66,7 @@ static struct cmn_cyprus_ctx *shared_ctx;
/* RNSAM table index */
static unsigned int rnsam_entry;

#if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_INFO
/* CMN Revision Numbers */
enum cmn_cyprus_revision {
REV_R0_P0,
Expand Down Expand Up @@ -104,6 +105,7 @@ static const char *const node_type_to_name[NODE_TYPE_COUNT] = {
[NODE_TYPE_HN_S_MPAM_S] = "HN-S MPAM-S",
[NODE_TYPE_HN_S_MPAM_NS] = "HN-S MPAM-NS",
};
#endif

/*
* Determine the number of bits used to represent each node coordinate based
Expand Down Expand Up @@ -156,6 +158,7 @@ static unsigned int get_node_pos_y(
return (node_id >> NODE_ID_Y_POS) & mask_bits;
}

#if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_INFO
/* Get node type name */
static const char *get_node_type_name(enum cmn_cyprus_node_type node_type)
{
Expand Down Expand Up @@ -187,6 +190,7 @@ static const char *get_cmn_cyprus_revision_name(

return cmn_cyprus_rev_to_name[revision];
}
#endif

static inline unsigned int get_child_count(FWK_R uint64_t child_info)
{
Expand Down Expand Up @@ -486,22 +490,15 @@ static void disable_hns_isolation(struct cmn_cyprus_mxp_reg *mxp)
}
}

static int discover_mxp_nodes(struct cmn_cyprus_mxp_reg *mxp)
#if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_INFO
static void print_node_info(struct cmn_cyprus_mxp_reg *mxp)
{
int status;
unsigned int node_count;
uint8_t mesh_size_x;
uint8_t mesh_size_y;
unsigned int node_id;
unsigned int node_idx;
unsigned int node_pos_x;
unsigned int node_pos_y;
uint8_t mesh_size_x;
uint8_t mesh_size_y;
struct cmn_cyprus_node_cfg_reg *node;

/* Get number of children connected to the cross point */
node_count = get_child_count(mxp->CHILD_INFO);

/* Get node id */
node_id = node_info_get_id(mxp->NODE_INFO);

mesh_size_x = shared_ctx->config->mesh_size_x;
Expand All @@ -516,6 +513,22 @@ static int discover_mxp_nodes(struct cmn_cyprus_mxp_reg *mxp)
node_pos_y,
node_id,
node_info_get_ldid(mxp->NODE_INFO));
}
#endif

static int discover_mxp_nodes(struct cmn_cyprus_mxp_reg *mxp)
{
int status;
unsigned int node_count;
unsigned int node_idx;
struct cmn_cyprus_node_cfg_reg *node;

/* Get number of children connected to the cross point */
node_count = get_child_count(mxp->CHILD_INFO);

#if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_INFO
print_node_info(mxp);
#endif

/* Traverse nodes connected to the cross point */
for (node_idx = 0; node_idx < node_count; node_idx++) {
Expand Down
8 changes: 5 additions & 3 deletions module/cmn_cyprus/src/cmn_cyprus_rnsam_setup.c
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 Down Expand Up @@ -98,7 +98,8 @@ static int program_io_region(

if (region_idx >= RNSAM_NON_HASH_MEM_REGION_COUNT) {
FWK_LOG_ERR(
MOD_NAME "Error! Invalid non-hashed region %lu", region_idx);
MOD_NAME "Error! Invalid non-hashed region %u",
(unsigned int)region_idx);
FWK_LOG_ERR(
MOD_NAME "Max non-hashed region supported is %u",
RNSAM_NON_HASH_MEM_REGION_COUNT);
Expand Down Expand Up @@ -228,7 +229,8 @@ static int program_scg_region(
->rnsam_scg_config;

if (scg_idx >= MAX_SCG_COUNT) {
FWK_LOG_ERR(MOD_NAME "Error! Invalid SCG region %lu", scg_idx);
FWK_LOG_ERR(
MOD_NAME "Error! Invalid SCG region %u", (unsigned int)scg_idx);
FWK_LOG_ERR(MOD_NAME "Max SCG region supported is %u ", MAX_SCG_COUNT);
return FWK_E_DATA;
}
Expand Down
5 changes: 2 additions & 3 deletions module/scmi/src/mod_scmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static const char *get_message_type_str(const struct scmi_service_ctx *ctx)
return "Notif";

default:
return "Invalid message";
return "Invalid msg";
}
}

Expand Down Expand Up @@ -1044,8 +1044,7 @@ static int scmi_process_event(const struct fwk_event *event,
if (protocol_idx == 0) {
#if FWK_LOG_LEVEL <= FWK_LOG_LEVEL_ERROR
FWK_LOG_ERR(
"[SCMI] %s: %s [%" PRIu16
"(0x%x:0x%x)] requested an unsupported protocol",
"[SCMI] %s: %s [%" PRIu16 "(0x%x:0x%x)] Unsupported protocol",
service_name,
message_type_name,
ctx->scmi_token,
Expand Down
9 changes: 8 additions & 1 deletion module/timer/include/mod_timer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2017-2022, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down Expand Up @@ -120,6 +120,13 @@ struct mod_timer_driver_api {

/*! Get counter frequency */
int (*get_frequency)(fwk_id_t dev_id, uint32_t *value);

/*!
* Timer device may need to update internal status in alarm or overflow
* event. This handler is used to process overflow event when there is no
* active alarm. Optional
*/
void (*overflow_handler)(fwk_id_t dev_id);
};

/*!
Expand Down
13 changes: 10 additions & 3 deletions module/timer/src/mod_timer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down Expand Up @@ -557,8 +557,15 @@ static void timer_isr(uintptr_t ctx_ptr)
(struct alarm_sub_element_ctx *)fwk_list_pop_head(&ctx->alarms_active);

if (alarm == NULL) {
/* Timer interrupt triggered without any alarm in the active queue */
fwk_unexpected();
if (ctx->driver->overflow_handler != NULL) {
ctx->driver->overflow_handler(ctx->driver_dev_id);
} else {
/*
* Timer interrupt triggered without any alarm in the active queue nor an
* overflow handler provided.
*/
fwk_unexpected();
}
return;
}

Expand Down
103 changes: 103 additions & 0 deletions product/neoverse-rd/rdfremont/scp_ramfw/config_armv7m_mpu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Description:
* Configuration data for module 'armv7m_mpu'.
*/

#include "scp_css_mmap.h"
#include "scp_fw_mmap.h"

#include <mod_armv7m_mpu.h>

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

#include <fmw_cmsis.h>

/* Number of regions to be configured in SCP's MPU */
#define SCP_MPU_REGION_COUNT 5

static const ARM_MPU_Region_t regions[SCP_MPU_REGION_COUNT] = {
{
/* 0x0000_0000 - 0xFFFF_FFFF */
.RBAR = ARM_MPU_RBAR(0, 0x00000000),
.RASR = ARM_MPU_RASR(
1,
ARM_MPU_AP_PRIV,
0,
1,
0,
1,
0,
ARM_MPU_REGION_SIZE_4GB),
},
{
/* 0x0000_0000 - 0x0003_FFFF */
.RBAR = ARM_MPU_RBAR(1, SCP_ITC_RAM_BASE),
.RASR = ARM_MPU_RASR(
0,
ARM_MPU_AP_PRO,
0,
0,
1,
0,
0,
ARM_MPU_REGION_SIZE_256KB),
},
{
/* 0x2000_0000 - 0x2003_FFFF */
.RBAR = ARM_MPU_RBAR(2, SCP_DTC_RAM_BASE),
.RASR = ARM_MPU_RASR(
1,
ARM_MPU_AP_PRIV,
0,
0,
1,
1,
0,
ARM_MPU_REGION_SIZE_256KB),
},
{
/*
* 0x7000_0000 - 0x7000_1FFF
* This is mapped to 0x0000_0000 - 0x0000_1FFF in AP memory map.
*/
.RBAR = ARM_MPU_RBAR(3, SCP_AP_PERIPHERAL_SRAM_TRUSTED_BASE),
.RASR = ARM_MPU_RASR(
1,
ARM_MPU_AP_PRIV,
0,
1,
1,
1,
0,
ARM_MPU_REGION_SIZE_8KB),
},
{
/*
* 0x7000_2000 - 0x7000_3000
* This is mapped to 0x0000_2000 - 0x0000_3000 in AP memory map.
*/
.RBAR = ARM_MPU_RBAR(4, SCP_AP_PERIPHERAL_SRAM_NONTRUSTED_BASE),
.RASR = ARM_MPU_RASR(
1,
ARM_MPU_AP_PRIV,
0,
1,
1,
1,
0,
ARM_MPU_REGION_SIZE_4KB),
},
};

const struct fwk_module_config config_armv7m_mpu = {
.data = &((struct mod_armv7m_mpu_config){
.region_count = FWK_ARRAY_SIZE(regions),
.regions = regions,
}),
};
Loading