reset_source: rename set_reset_source to reset_source_set
To get all reset source related functions into the same function namespace. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
b34140af5b
commit
0099a887c0
|
@ -30,13 +30,13 @@ static void imx1_detect_reset_source(void)
|
||||||
|
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case RSR_EXR:
|
case RSR_EXR:
|
||||||
set_reset_source(RESET_RST);
|
reset_source_set(RESET_RST);
|
||||||
return;
|
return;
|
||||||
case RSR_WDR:
|
case RSR_WDR:
|
||||||
set_reset_source(RESET_WDG);
|
reset_source_set(RESET_WDG);
|
||||||
return;
|
return;
|
||||||
case 0:
|
case 0:
|
||||||
set_reset_source(RESET_POR);
|
reset_source_set(RESET_POR);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
/* else keep the default 'unknown' state */
|
/* else keep the default 'unknown' state */
|
||||||
|
|
|
@ -25,15 +25,15 @@ static int pxa_detect_reset_source(void)
|
||||||
* Order is important, as many bits can be set together
|
* Order is important, as many bits can be set together
|
||||||
*/
|
*/
|
||||||
if (reg & RCSR_GPR)
|
if (reg & RCSR_GPR)
|
||||||
set_reset_source(RESET_RST);
|
reset_source_set(RESET_RST);
|
||||||
else if (reg & RCSR_WDR)
|
else if (reg & RCSR_WDR)
|
||||||
set_reset_source(RESET_WDG);
|
reset_source_set(RESET_WDG);
|
||||||
else if (reg & RCSR_HWR)
|
else if (reg & RCSR_HWR)
|
||||||
set_reset_source(RESET_POR);
|
reset_source_set(RESET_POR);
|
||||||
else if (reg & RCSR_SMR)
|
else if (reg & RCSR_SMR)
|
||||||
set_reset_source(RESET_WKE);
|
reset_source_set(RESET_WKE);
|
||||||
else
|
else
|
||||||
set_reset_source(RESET_UKWN);
|
reset_source_set(RESET_UKWN);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,21 +29,21 @@ static int s3c_detect_reset_source(void)
|
||||||
u32 reg = readl(S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
u32 reg = readl(S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||||
|
|
||||||
if (reg & S3C2440_GSTATUS2_PWRST) {
|
if (reg & S3C2440_GSTATUS2_PWRST) {
|
||||||
set_reset_source(RESET_POR);
|
reset_source_set(RESET_POR);
|
||||||
writel(S3C2440_GSTATUS2_PWRST,
|
writel(S3C2440_GSTATUS2_PWRST,
|
||||||
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reg & S3C2440_GSTATUS2_SLEEPRST) {
|
if (reg & S3C2440_GSTATUS2_SLEEPRST) {
|
||||||
set_reset_source(RESET_WKE);
|
reset_source_set(RESET_WKE);
|
||||||
writel(S3C2440_GSTATUS2_SLEEPRST,
|
writel(S3C2440_GSTATUS2_SLEEPRST,
|
||||||
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reg & S3C2440_GSTATUS2_WDRST) {
|
if (reg & S3C2440_GSTATUS2_WDRST) {
|
||||||
set_reset_source(RESET_WDG);
|
reset_source_set(RESET_WDG);
|
||||||
writel(S3C2440_GSTATUS2_WDRST,
|
writel(S3C2440_GSTATUS2_WDRST,
|
||||||
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
S3C_GPIO_BASE + S3C2440_GSTATUS2);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -27,18 +27,18 @@ static const char * const reset_src_names[] = {
|
||||||
[RESET_JTAG] = "JTAG",
|
[RESET_JTAG] = "JTAG",
|
||||||
};
|
};
|
||||||
|
|
||||||
void set_reset_source(enum reset_src_type st)
|
void reset_source_set(enum reset_src_type st)
|
||||||
{
|
{
|
||||||
setenv("global.system.reset", reset_src_names[st]);
|
setenv("global.system.reset", reset_src_names[st]);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(set_reset_source);
|
EXPORT_SYMBOL(reset_source_set);
|
||||||
|
|
||||||
/* ensure this runs after the 'global' device is already registerd */
|
/* ensure this runs after the 'global' device is already registerd */
|
||||||
static int init_reset_source(void)
|
static int reset_source_init(void)
|
||||||
{
|
{
|
||||||
globalvar_add_simple("system.reset", reset_src_names[RESET_UKWN]);
|
globalvar_add_simple("system.reset", reset_src_names[RESET_UKWN]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
coredevice_initcall(init_reset_source);
|
coredevice_initcall(reset_source_init);
|
||||||
|
|
|
@ -163,20 +163,20 @@ static void __maybe_unused imx28_detect_reset_source(const struct imx28_wd *p)
|
||||||
if (reg & MXS_RTC_PERSISTENT0_ALARM_WAKE) {
|
if (reg & MXS_RTC_PERSISTENT0_ALARM_WAKE) {
|
||||||
writel(MXS_RTC_PERSISTENT0_ALARM_WAKE,
|
writel(MXS_RTC_PERSISTENT0_ALARM_WAKE,
|
||||||
p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
|
p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
|
||||||
set_reset_source(RESET_WKE);
|
reset_source_set(RESET_WKE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
set_reset_source(RESET_POR);
|
reset_source_set(RESET_POR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (reg & MXS_RTC_PERSISTENT0_THM_RST) {
|
if (reg & MXS_RTC_PERSISTENT0_THM_RST) {
|
||||||
writel(MXS_RTC_PERSISTENT0_THM_RST,
|
writel(MXS_RTC_PERSISTENT0_THM_RST,
|
||||||
p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
|
p->regs + MXS_RTC_PERSISTENT0 + MXS_RTC_CLR_ADDR);
|
||||||
set_reset_source(RESET_RST);
|
reset_source_set(RESET_RST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_reset_source(RESET_RST);
|
reset_source_set(RESET_RST);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int imx28_wd_probe(struct device_d *dev)
|
static int imx28_wd_probe(struct device_d *dev)
|
||||||
|
|
|
@ -130,17 +130,17 @@ static void imx_watchdog_detect_reset_source(struct imx_wd *priv)
|
||||||
u16 val = readw(priv->base + IMX21_WDOG_WSTR);
|
u16 val = readw(priv->base + IMX21_WDOG_WSTR);
|
||||||
|
|
||||||
if (val & WSTR_COLDSTART) {
|
if (val & WSTR_COLDSTART) {
|
||||||
set_reset_source(RESET_POR);
|
reset_source_set(RESET_POR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val & (WSTR_HARDRESET | WSTR_WARMSTART)) {
|
if (val & (WSTR_HARDRESET | WSTR_WARMSTART)) {
|
||||||
set_reset_source(RESET_RST);
|
reset_source_set(RESET_RST);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val & WSTR_WDOG) {
|
if (val & WSTR_WDOG) {
|
||||||
set_reset_source(RESET_WDG);
|
reset_source_set(RESET_WDG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ enum reset_src_type {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_RESET_SOURCE
|
#ifdef CONFIG_RESET_SOURCE
|
||||||
void set_reset_source(enum reset_src_type);
|
void reset_source_set(enum reset_src_type);
|
||||||
#else
|
#else
|
||||||
static inline void set_reset_source(enum reset_src_type unused)
|
static inline void reset_source_set(enum reset_src_type unused)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue