[Skiboot] [PATCH 5/9] phb4: Add register access helpers

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Jul 8 22:46:26 AEST 2017


On Sat, 2017-07-08 at 19:23 +1000, Michael Neuling wrote:
> This doesn't compile alone with the below.
> 
> Benh, I have a bunch of additional patches to fix some addition phb4 recovery
> issues that depend on this series.  I might just fix this up and repost with my
> stuff on top.

Ah that error is because we only start using it with the next patch.
Ugh.

> HEAD is now at 9b14cc79a5 phb4: Add register access helpers
> hw/phb4.c:166:13: error: ‘phb4_write_reg’ defined but not used [-Werror=unused-
> function]
>  static void phb4_write_reg(struct phb4 *p, uint32_t offset, uint64_t val)
>              ^~~~~~~~~~~~~~
> hw/phb4.c:158:17: error: ‘phb4_read_reg’ defined but not used [-Werror=unused-
> function]
>  static uint64_t phb4_read_reg(struct phb4 *p, uint32_t offset)
>                  ^~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> /home/mikey/src/skiboot/Makefile.rules:56: recipe for target 'hw/phb4.o' failed
> make: *** [hw/phb4.o] Error 1
> 
> 
> 
> 
> On Fri, 2017-07-07 at 16:08 -0500, Benjamin Herrenschmidt wrote:
> > Those will pick between ASB (ie, XSCOM) accesses and direct MMIO
> > based on PHB flags, thus allowing transparent access whether the
> > PHB is fenced or not.
> > 
> > Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> > ---
> >  hw/phb4.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/hw/phb4.c b/hw/phb4.c
> > index 30122ed..03b357d 100644
> > --- a/hw/phb4.c
> > +++ b/hw/phb4.c
> > @@ -155,6 +155,22 @@ static inline void phb4_write_reg_asb(struct phb4 *p,
> >  #endif
> >  }
> >  
> > +static uint64_t phb4_read_reg(struct phb4 *p, uint32_t offset)
> > +{
> > +	if (p->flags & PHB4_CFG_USE_ASB)
> > +		return phb4_read_reg_asb(p, offset);
> > +	else
> > +		return in_be64(p->regs + offset);
> > +}
> > +
> > +static void phb4_write_reg(struct phb4 *p, uint32_t offset, uint64_t val)
> > +{
> > +	if (p->flags & PHB4_CFG_USE_ASB)
> > +		phb4_write_reg_asb(p, offset, val);
> > +	else
> > +		return out_be64(p->regs + offset, val);
> > +}
> > +
> >  /* Helper to select an IODA table entry */
> >  static inline void phb4_ioda_sel(struct phb4 *p, uint32_t table,
> >  				 uint32_t addr, bool autoinc)


More information about the Skiboot mailing list