mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 22:51:37 +00:00
omap3: Use a define for reboot reason offset
This introduces a define for the offset to the reboot reason, rather than hardcoding it. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
c5412b084b
commit
90ca5dfec4
2 changed files with 7 additions and 3 deletions
|
@ -65,7 +65,8 @@ int omap_reboot_mode(char *mode, unsigned int length)
|
||||||
if (length < 2)
|
if (length < 2)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
reboot_mode = readl((u32 *)(OMAP34XX_SCRATCHPAD + 4));
|
reboot_mode = readl((u32 *)(OMAP34XX_SCRATCHPAD +
|
||||||
|
OMAP_REBOOT_REASON_OFFSET));
|
||||||
|
|
||||||
c = (reboot_mode >> 24) & 0xff;
|
c = (reboot_mode >> 24) & 0xff;
|
||||||
if (c != 'B')
|
if (c != 'B')
|
||||||
|
@ -85,7 +86,7 @@ int omap_reboot_mode(char *mode, unsigned int length)
|
||||||
|
|
||||||
int omap_reboot_mode_clear(void)
|
int omap_reboot_mode_clear(void)
|
||||||
{
|
{
|
||||||
writel(0, (u32 *)(OMAP34XX_SCRATCHPAD + 4));
|
writel(0, (u32 *)(OMAP34XX_SCRATCHPAD + OMAP_REBOOT_REASON_OFFSET));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +97,8 @@ int omap_reboot_mode_store(char *mode)
|
||||||
|
|
||||||
reboot_mode = 'B' << 24 | 'M' << 16 | mode[0];
|
reboot_mode = 'B' << 24 | 'M' << 16 | mode[0];
|
||||||
|
|
||||||
writel(reboot_mode, (u32 *)(OMAP34XX_SCRATCHPAD + 4));
|
writel(reboot_mode, (u32 *)(OMAP34XX_SCRATCHPAD +
|
||||||
|
OMAP_REBOOT_REASON_OFFSET));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -249,6 +249,8 @@ struct gpio {
|
||||||
/* ABB tranxdone mask */
|
/* ABB tranxdone mask */
|
||||||
#define OMAP_ABB_MPU_TXDONE_MASK (0x1 << 26)
|
#define OMAP_ABB_MPU_TXDONE_MASK (0x1 << 26)
|
||||||
|
|
||||||
|
#define OMAP_REBOOT_REASON_OFFSET 0x04
|
||||||
|
|
||||||
/* Boot parameters */
|
/* Boot parameters */
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
struct omap_boot_parameters {
|
struct omap_boot_parameters {
|
||||||
|
|
Loading…
Add table
Reference in a new issue