Skip to contentSkip to conversation

i.MX28 AUTO_RESTART, watchdog, battery and poweroff

U-Boot Hector Palacios 3 participants 3 messages Jul 24, 2013

lore
Share & tools
lore
#0 lore raw

Greetings,

I'm not sure I understand the function mxs_power_clear_auto_restart() in spl_power_init.c

The name of the function seems to indicate that its purpose is to *clear* the AUTO_RESTART bit, but it is actually setting it:

	setbits_le32(&rtc_regs->hw_rtc_persistent0,
			RTC_PERSISTENT0_AUTO_RESTART);

I believe though, that setting this bit is OK because it guarantees that the target can be reset from a reset button or a watchdog reset even when powered from the battery.

Am I missing something? Otherwise I think this function should be renamed to mxs_power_set_auto_restart().

Best regards,
--
Hector Palacios

#1 lore raw

Dear Hector Palacios,

Quoted 4 lines

Greetings,

I'm not sure I understand the function mxs_power_clear_auto_restart() in spl_power_init.c

We're on the same board there. According to FSL, this is needed on some versions of MX28 (translation from the techsupp language: we have no idea where this code came from nor what it does, so we will tell you it's important and you shouldn't touch it).

I believe the powercode will need a revision and I'll likely get to it once I'm done with my current hacking.

Quoted 6 lines

The name of the function seems to indicate that its purpose is to *clear* the AUTO_RESTART bit, but it is actually setting it:

	setbits_le32(&rtc_regs->hw_rtc_persistent0,
			RTC_PERSISTENT0_AUTO_RESTART);
Quoted 6 lines

I believe though, that setting this bit is OK because it guarantees that the target can be reset from a reset button or a watchdog reset even when powered from the battery.

Am I missing something? Otherwise I think this function should be renamed to mxs_power_set_auto_restart().

I'd ack the rename. Fabio?

Best regards,
Marek Vasut

#2 lore raw
Quoted 4 lines · Marek Vasut
Quoted 2 lines

Am I missing something? Otherwise I think this function should be renamed to mxs_power_set_auto_restart().

I'd ack the rename. Fabio?

Sounds good. Please submit a patch, Hector.

Thanks,

Fabio Estevam