Commit 808bbdcd authored by Pranav-Madhu's avatar Pranav-Madhu Committed by Thomas Abraham
Browse files

[HACK] module/ppu_v1: Disable cluster powerdown for RD-N2



For RD-N2 platform, CPU bridge interface between Neovers-N2 core and
cluster is not present. Because of this issue, functionalities like cpu
hotplug are not supported. To overcome this issue, skipping the cluster
powerdown. This patch will be reverted once the bridge is enabled in
model.

Change-Id: I43b5576480260f9c1825014aee3a37630043b0fd
Signed-off-by: Pranav-Madhu's avatarPranav Madhu <pranav.madhu@arm.com>
parent 9e8f3618
......@@ -12,6 +12,7 @@
#include <mod_power_domain.h>
#include <mod_ppu_v1.h>
#include <mod_system_info.h>
#ifdef BUILD_HAS_MOD_SYSTEM_POWER
# include <mod_system_power.h>
......@@ -59,6 +60,12 @@ struct ppu_v1_pd_ctx {
/* Context data specific to the type of power domain */
void *data;
/* Generic system information structure */
const struct mod_system_info *system_info;
/* Chip information API */
struct mod_system_info_get_info_api *system_info_api;
};
/* Cluster power domain specific context */
......@@ -439,6 +446,17 @@ static bool cluster_off(struct ppu_v1_pd_ctx *pd_ctx)
return false;
}
/*
* TODO: Revert this changes after the CPU bridge interface between core and
* cluster is implemented for RD-N2.
*/
if ((pd_ctx->system_info->product_id == 0x7B7) &&
(pd_ctx->system_info->config_id == 0x01 )) {
/* Skipping cluster powerdown for RD-N2, as CPU bridge interface
* between Neovers-N2 core and cluster is not present */
return true;
}
ppu_v1_set_power_mode(ppu, PPU_V1_MODE_OFF, pd_ctx->timer_ctx);
return true;
}
......@@ -795,6 +813,15 @@ static int ppu_v1_bind(fwk_id_t id, unsigned int round)
return status;
}
/* Bind to system info module to obtain Product id */
status = fwk_module_bind(FWK_ID_MODULE(FWK_MODULE_IDX_SYSTEM_INFO),
FWK_ID_API(FWK_MODULE_IDX_SYSTEM_INFO,
MOD_SYSTEM_INFO_GET_API_IDX),
&pd_ctx->system_info_api);
if (status != FWK_SUCCESS) {
FWK_LOG_ERR("[PPU_V1] Bind with system information module failed\n");
}
if (fwk_id_is_equal(pd_ctx->bound_id, FWK_ID_NONE))
return FWK_SUCCESS;
......@@ -918,6 +945,14 @@ static int ppu_v1_start(fwk_id_t id)
module_config = fwk_module_get_data(fwk_id_build_module_id(id));
fwk_assert(module_config != NULL);
/* Get system information */
if (pd_ctx->system_info_api != NULL) {
status = pd_ctx->system_info_api->get_system_info(&pd_ctx->system_info);
if (status != FWK_SUCCESS) {
FWK_LOG_ERR("[PPU_V1] Failed in getting system information\n");
}
}
/* Register for power domain transition notifications */
status = fwk_notification_subscribe(
module_config->pd_notification_id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment