Skip to content

Commit 9bb6f73

Browse files
committed
fix target frequency variable was not correctly read in rountine
1 parent 651c3cf commit 9bb6f73

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

sw/tests/control-pulp-tests/clic/clic-mbox-ext-freertos/clic-mbox-ps-freertos.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ void vApplicationTickHook(void);
8181
} while (0)
8282

8383
int first = 0;
84-
uint32_t ft = 1;
84+
85+
volatile uint32_t ft = 1;
86+
8587
volatile int set_cnt = 0;
8688

8789
void clic_setup_mtvec(void);
@@ -98,9 +100,9 @@ void exit_fail(void)
98100

99101
void exit_success(void)
100102
{
101-
printf("someone wrote to mailbox!");
102-
exit(0); //---------------------------REMOVE THIS LINE IF IT IS NOT A SIMULATION
103+
// printf("someone wrote to mailbox!\r\n");
103104
callee_scmi_handler();
105+
exit(0); //---------------------------REMOVE THIS LINE IF IT IS NOT A SIMULATION
104106
}
105107

106108

@@ -129,8 +131,8 @@ void callee_scmi_handler(void)
129131
uint32_t protocol_id = 0x0;
130132
uint32_t message_id = 0x0;
131133
uint32_t payload0 = 0x0;
132-
uint32_t payload1 = 0x0;
133-
uint32_t payload2 = 0x0;
134+
// uint32_t payload1 = 0x0;
135+
// uint32_t payload2 = 0x0;
134136

135137
// read agent_id from doorbell
136138
agent_id = readw(MBOX_START_ADDRESS + SCMI_DOORBELL_C0_REG_OFFSET);
@@ -418,7 +420,8 @@ void callee_scmi_handler(void)
418420
writew(response,
419421
MBOX_START_ADDRESS + SCMI_MESSAGE_PAYLOAD_0_C0_REG_OFFSET);
420422

421-
response = ft; //current perf level
423+
response = ft;
424+
422425
writew(response,
423426
MBOX_START_ADDRESS + SCMI_MESSAGE_PAYLOAD_0_C0_REG_OFFSET + 4);
424427

@@ -613,9 +616,8 @@ void callee_scmi_handler(void)
613616
response = 0x11;
614617
writew(response,
615618
MBOX_START_ADDRESS + SCMI_MESSAGE_PAYLOAD_0_C0_REG_OFFSET + 4);
616-
//complete_msg(data, agent_id);
617-
}
618-
619+
complete_msg(data, agent_id);
620+
}
619621
}
620622

621623

@@ -692,6 +694,7 @@ int main(void)
692694
/* enable interrupt globally */
693695
irq_clint_global_enable();
694696

697+
ft = 1;
695698
/* enable interrupt on clic */
696699
writew(0x1, CLIC_BASE_ADDR + CLIC_CLICINTIE_REG_OFFSET(INTR_ID));
697700

@@ -700,7 +703,9 @@ int main(void)
700703
csr_write(CSR_MINTTHRESH, 0); /* 0 < 0xaa */
701704

702705

703-
for(volatile int i=0; i < 1000000; i++);
706+
for(volatile int i=0; i < 1000000; i++); //---------------------------REMOVE THIS LINE IF IT IS NOT A SIMULATION
707+
while(1);
708+
704709

705710
return 1;
706711
}

0 commit comments

Comments
 (0)