[U-Boot] [PATCH v3 3/4] arm: socfpga: Convert system manager from struct to defines

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Thu Oct 10 09:41:00 UTC 2019


On Thu, Oct 10, 2019 at 11:29 AM Anatolij Gustschin <agust at denx.de> wrote:
>
> On Thu, 10 Oct 2019 10:43:46 +0200
> Simon Goldschmidt simon.k.r.goldschmidt at gmail.com wrote:
> ...
> > > Why is this required? In the past we have rejected all new code adding
> > > defines instead of structs for register accesses. Have we changed our mind now?
> >
> > Who is we?
>
> U-Boot maintainers/community.
>
> > I haven't noticed that in the last 2 years. Plus Linux is rather
> > using structs than defines, or am I wrong?
>
> The preferred way for I/O access is documented in [1], see "Use structures
> for I/O access" section.

[1] also states "This may need to change to the kernel model if we allow for
more run-time detection of what drivers are appropriate for what we're
running on."

This seems to apply here as well.

Regards,
Simon

>
> > This started because Ley introduced a new platform where the structs were
> > nearly the same but *some* registers have changed. Adding new structs
> > that were nearly the same seemed more mess than using the same defines.
> >
> > I'm not pressing this into any direction, we can continue using structs
> > if that's the consensus.
>
> If there is no other easy way to continue using struct, then this should
> be mentioned in the commit description/cover letter to justify the changes.
>
> [1] http://www.denx.de/wiki/U-Boot/CodingStyle
>
> --
> Anatolij


More information about the U-Boot mailing list