lkml.org 
[lkml]   [2014]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] socfpga: hotplug: put cpu1 in wfi
Hi!

> > > + __raw_writel(RSTMGR_MPUMODRST_CPU1,
> > > + rst_manager_base_addr + 0x10);
> >
> > Would it be possible to copy reset manager description struct from
> > u-boot and use it here, instead of raw offset?
>
> I will replace this 0x10 with a macro that reflects how the register is
> named in the register map.

That would be better than 0x10, but even better would be just copying

struct socfpga_reset_manager {
u32 status;
u32 ctrl;
u32 counts;
u32 padding1;
u32 mpu_mod_reset;
u32 per_mod_reset;
u32 per2_mod_reset;
u32 brg_mod_reset;
};

from u-boot. Unlike macros, structs have advantages that typos lead to
easier-to-see failure modes... (And they are easier to read/parse,
too).

Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2014-10-01 17:41    [W:0.104 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site