Re: [PATCH v1 4/4] watchdog: npcm: sets card ext1 and ext2 bootstatus during probe

Guenter Roeck
2020-03-01T16:10:51Z

On 3/1/20 8:08 AM, Tomer Maimon wrote:
> Sorry Guenter probebly I didnt explain it well.
>
>
> On Sun, 1 Mar 2020 at 12:48, Guenter Roeck <linux@roeck-us.net <mailto:linux@roeck-us.net>> wrote:
>
> On 3/1/20 1:40 AM, Tomer Maimon wrote:
> > During probe NPCM watchdog sets the following bootstatus flags:
> >       - WDIOF_CARDRESET represent power and core reset.
> >       - WDIOF_EXTERN1 represent watchdog 0-2 reset.
> >       - WDIOF_EXTERN2 represent software 1-4 reset.
> >
> > Each flag is representing a group of bootstatus.
> > The user can configure through the device treethe exact reset
> > to each flag group.
> >
>
> Sorry, this doesn't make sense to me. I could understand reporting
> the above, but it looks to me like devicetree is used to associate
> a reset bit from the controller with one of the above.
> Devicetree only seems to be used to associate reset status bits
> from the controller with WDIOF_CARDRESET, WDIOF_EXTERN1, or
> WDIOF_EXTERN2. That adds a lot of complexity for little if any
> gain.
>
>
>
> It would make sense to set the bootstatus bits as suggested above,
> but that doesn't require devicetree properties.
>
> More comments inline.
>
> Guenter
>
>
>
> In the NPCM750 we have the following reset types:
>
> 1. board reset (Power on reset, Core reset)
> 2. WD reset (0-2 WD reset).
> 3. SW reset (1-4 SW reset).
>
>
> Each board can use different reset types, because in the WD status bit there is not enough bits to represent the entire NPCM750 resets.
>
> The NPCM750 reset groups are represent as follow:
>
>  - WDIOF_CARDRESET represent power and core reset.
>  - WDIOF_EXTERN1 represent watchdog 0-2 reset.
>  - WDIOF_EXTERN2 represent software 1-4 reset.
>
Exactly, and I don't see a need to be more specific than that.
This can be implemented without all the DT complexity.

Guenter