Skip to content

Commit

Permalink
Revert "tests: benchmarks: multicore: idle_with_pwm: Disable GD2 and …
Browse files Browse the repository at this point in the history
…GD3 manually"

This reverts commit 7909484.
  • Loading branch information
nordic-segl committed Nov 7, 2024
1 parent 540f139 commit 9f3bde3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
1 change: 0 additions & 1 deletion tests/benchmarks/multicore/idle_with_pwm/prj_s2ram.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ CONFIG_BOOT_BANNER=n
CONFIG_NRFS_MRAM_SERVICE_ENABLED=n

CONFIG_PWM=y
CONFIG_NRFS=y
53 changes: 0 additions & 53 deletions tests/benchmarks/multicore/idle_with_pwm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ LOG_MODULE_REGISTER(idle_with_pwm, LOG_LEVEL_INF);
#include <zephyr/drivers/pwm.h>
#include <zephyr/pm/device_runtime.h>

#include <nrfs_backend_ipc_service.h>
#include <nrfs_gdpwr.h>

#if IS_ENABLED(CONFIG_SOC_NRF54H20_CPUAPP_COMMON)
/* Alias pwm-led0 = &pwm_led2 */
static const struct pwm_dt_spec pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0));
Expand All @@ -26,53 +23,6 @@ static const struct pwm_dt_spec pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0));

#define PWM_STEPS_PER_SEC (50)

/* Required to power off the GD2 and GD3 domains
* Will be removed when GD handling
* is implemented in sdk-zephyr
*/
static void gdpwr_handler(nrfs_gdpwr_evt_t const *p_evt, void *context)
{
switch (p_evt->type) {
case NRFS_GDPWR_REQ_APPLIED:
printk("GDPWR handler - response received: 0x%x, CTX=%d\n", p_evt->type,
(uint32_t)context);
break;
case NRFS_GDPWR_REQ_REJECTED:
printk("GDPWR handler - request rejected: 0x%x, CTX=%d\n", p_evt->type,
(uint32_t)context);
break;
default:
printk("GDPWR handler - unexpected event: 0x%x, CTX=%d\n", p_evt->type,
(uint32_t)context);
break;
}
}

/* Required to power off the GD2 and GD3 domains
* Will be removed when GD handling
* is implemented in sdk-zephyr
*/
static void clear_global_power_domains_requests(void)
{
int service_status;
int tst_ctx = 1;

service_status = nrfs_gdpwr_init(gdpwr_handler);
printk("Response: %d\n", service_status);
printk("Sending GDPWR DISABLE request for: GDPWR_POWER_DOMAIN_ACTIVE_SLOW\n");
service_status = nrfs_gdpwr_power_request(GDPWR_POWER_DOMAIN_ACTIVE_SLOW,
GDPWR_POWER_REQUEST_CLEAR, (void *)tst_ctx++);
printk("Response: %d\n", service_status);
printk("Sending GDPWR DISABLE request for: GDPWR_POWER_DOMAIN_ACTIVE_FAST\n");
service_status = nrfs_gdpwr_power_request(GDPWR_POWER_DOMAIN_ACTIVE_FAST,
GDPWR_POWER_REQUEST_CLEAR, (void *)tst_ctx++);
printk("Response: %d\n", service_status);
printk("Sending GDPWR DISABLE request for: GDPWR_POWER_DOMAIN_MAIN_SLOW\n");
service_status = nrfs_gdpwr_power_request(GDPWR_POWER_DOMAIN_MAIN_SLOW,
GDPWR_POWER_REQUEST_CLEAR, (void *)tst_ctx);
printk("Response: %d\n", service_status);
}

int main(void)
{
int ret;
Expand All @@ -83,9 +33,6 @@ int main(void)
int32_t pulse_step;
uint32_t current_pulse_width;

nrfs_backend_wait_for_connection(K_FOREVER);
clear_global_power_domains_requests();

if (!pwm_is_ready_dt(&pwm_led)) {
LOG_ERR("Device %s is not ready.", pwm_led.dev->name);
return -ENODEV;
Expand Down

0 comments on commit 9f3bde3

Please sign in to comment.