Skip to content

Commit

Permalink
kmp204x/qrio: support for setting the CPU reset request mode
Browse files Browse the repository at this point in the history
To acheive this, the qrio_uprstreq() function that sets the UPRSTREQN
flag in the qrio RESCNF reg is added.

Signed-off-by: Rainer Boschung <[email protected]>
Signed-off-by: Valentin Longchamp <[email protected]>
Reviewed-by: York Sun <[email protected]>
  • Loading branch information
Boschung, Rainer authored and York Sun committed Aug 1, 2014
1 parent a09f470 commit 6caa185
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions board/keymile/kmp204x/kmp204x.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ void qrio_enable_app_buffer(void);
void qrio_cpuwd_flag(bool flag);
int qrio_reset_reason(void);

#define UPREQ_UNIT_RST 0x0
#define UPREQ_CORE_RST 0x1

void qrio_uprstreq(u8 mode);

void pci_of_setup(void *blob, bd_t *bd);
17 changes: 17 additions & 0 deletions board/keymile/kmp204x/qrio.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,20 @@ void qrio_cpuwd_flag(bool flag)
reason1 &= ~REASON1_CPUWD;
out_8(qrio_base + REASON1_OFF, reason1);
}

#define RSTCFG_OFF 0x11

void qrio_uprstreq(u8 mode)
{
u32 rstcfg;
void __iomem *qrio_base = (void *)CONFIG_SYS_QRIO_BASE;

rstcfg = in_8(qrio_base + RSTCFG_OFF);

if (mode & UPREQ_CORE_RST)
rstcfg |= UPREQ_CORE_RST;
else
rstcfg &= ~UPREQ_CORE_RST;

out_8(qrio_base + RSTCFG_OFF, rstcfg);
}

0 comments on commit 6caa185

Please sign in to comment.