Skip to content

Commit

Permalink
drivers: misc: xilinx_tmr_manager.c: Add api for reset handler
Browse files Browse the repository at this point in the history
When recovery is performed need to clear the TMR Manager
FFR register contents,  This commit adds new API
xmb_manager_reset_handler() which clears the ffr
register contents.

Signed-off-by: Appana Durga Kedareswara rao <[email protected]>
  • Loading branch information
kedareswararao authored and Michal Simek committed Mar 24, 2022
1 parent 94c82ba commit d2f297d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arch/microblaze/include/asm/xilinx_mb_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* break and call the callback function.
*/
void xmb_manager_register(uintptr_t phys_baseaddr, u32 cr_val,
void (*callback)(void *data), void *priv);
void (*callback)(void *data),
void *priv, void (*reset_callback)(void *data));
asmlinkage void xmb_inject_err(void);

# endif /* __ASSEMBLY__ */
Expand Down
16 changes: 15 additions & 1 deletion drivers/misc/xilinx_tmr_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ static void xtmr_manager_unblock_break(struct xtmr_manager_dev *xtmr_manager)
xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET, xtmr_manager->cr_val);
}

/**
* xmb_manager_reset_handler - clears the ffr register contents
* @priv: Private pointer
*/
static void xmb_manager_reset_handler(void *priv)
{
struct xtmr_manager_dev *xtmr_manager = (struct xtmr_manager_dev *)priv;
/*
* Clear the FFR Register contents as a part of recovery process.
*/
xtmr_manager_write(xtmr_manager, XTMR_MANAGER_FFR_OFFSET, 0);
}

/**
* xmb_manager_update_errcnt - update the error inject count
* @priv: Private pointer
Expand Down Expand Up @@ -185,7 +198,8 @@ static void xtmr_manager_init(struct xtmr_manager_dev *xtmr_manager)
* break and call the callback function.
*/
xmb_manager_register(xtmr_manager->phys_baseaddr, xtmr_manager->cr_val,
xmb_manager_update_errcnt, xtmr_manager);
xmb_manager_update_errcnt,
xtmr_manager, xmb_manager_reset_handler);
}

/**
Expand Down

0 comments on commit d2f297d

Please sign in to comment.