[top,sw/dv] Clk pwr rst smoke tests#460
[top,sw/dv] Clk pwr rst smoke tests#460csabakiss-semify wants to merge 4 commits intolowRISC:mainfrom
Conversation
Signed-off-by: Csaba Kiss <csaba.kiss@semify-eda.com>
Signed-off-by: Csaba Kiss <csaba.kiss@semify-eda.com>
8f4c502 to
2dbcd22
Compare
Signed-off-by: Csaba Kiss <csaba.kiss@semify-eda.com>
2dbcd22 to
7adf270
Compare
…ests to top level smoke regression and top level sim config Signed-off-by: Csaba Kiss <csaba.kiss@semify-eda.com>
marnovandermaas
left a comment
There was a problem hiding this comment.
Some initial comments from my end.
|
|
||
| if (rstmgr_software_reset_info_get(rstmgr)) { | ||
| return true; | ||
| if (reason & RSTMGR_RESET_INFO_POR) { |
There was a problem hiding this comment.
Nice, this is a good change!
| DEV_WRITE(rstmgr + RSTMGR_RESET_REQ_REG, RSTMGR_RESET_REQ_TRUE); | ||
| } | ||
|
|
||
| bool rstmgr_software_reset_info_get(rstmgr_t rstmgr) |
There was a problem hiding this comment.
I think we can now remove this function. I think it was only used in the software_reset test.
| static uint32_t clkmgr_read(clkmgr_t clkmgr, uintptr_t reg) | ||
| { | ||
| return DEV_READ(clkmgr + reg); | ||
| } | ||
|
|
||
| static void clkmgr_write(clkmgr_t clkmgr, uintptr_t reg, uint32_t value) | ||
| { | ||
| DEV_WRITE(clkmgr + reg, value); | ||
| } | ||
|
|
||
| static uint32_t clkmgr_bit(size_t clock) | ||
| { | ||
| return 1u << clock; | ||
| } | ||
|
|
There was a problem hiding this comment.
These don't look like clock manager specific functions. Do they already exist elsewhere in the repo?
| bool toggled = !initial; | ||
|
|
||
| clkmgr_gateable_clock_set_enabled(clkmgr, CLKMGR_GATEABLE_CLOCK_IO_PERI, toggled); | ||
| if (clkmgr_gateable_clock_get_enabled(clkmgr, CLKMGR_GATEABLE_CLOCK_IO_PERI) != toggled) { |
There was a problem hiding this comment.
Is there any way that we can confirm that the peripherals are actually stopped? I'm not sure whether reading a register will cause a bus error or just hang the design.
| pwrmgr_t mocha_system_pwrmgr(void) | ||
| { | ||
| #if defined(__riscv_zcherihybrid) | ||
| return (pwrmgr_t)create_mmio_capability(pwrmgr_base, 0x80u); |
There was a problem hiding this comment.
I think this length can be 0x44
| static uint32_t pwrmgr_read(pwrmgr_t pwrmgr, uintptr_t reg) | ||
| { | ||
| return DEV_READ(pwrmgr + reg); | ||
| } | ||
|
|
||
| static void pwrmgr_write(pwrmgr_t pwrmgr, uintptr_t reg, uint32_t value) | ||
| { | ||
| DEV_WRITE(pwrmgr + reg, value); | ||
| } | ||
|
|
||
| uint32_t pwrmgr_control_get(pwrmgr_t pwrmgr) | ||
| { | ||
| return pwrmgr_read(pwrmgr, PWRMGR_CONTROL_REG); | ||
| } |
There was a problem hiding this comment.
Replicated from clock manager.
I can see the conflicts, even if I just finished the rebase. However, I am opening this PR to start the review process. I will fix the further conflicts just before the merge.