[PATCH] arm: io.h: Fix io accessors for KVM
Ilias Apalodimas
ilias.apalodimas at linaro.org
Mon Jun 16 15:11:32 CEST 2025
Hi Jerome,
[...]
>
> If I'm not mistaken, this patch is doing two things that are unrelated:
> (1) fix the KVM issue and
> (2) get rid of the __arch_*() macros in favor of the __raw_*() macros
I can split it, but I don't see much point since we redefine the raw_macros.
>
> IMO this should be two separate patches.
>
> >
> > /*
> > * The compiler seems to be incapable of optimising constants
> > diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
> > index f2393c041f44..545561ad1169 100644
> > --- a/drivers/spi/fsl_dspi.c
> > +++ b/drivers/spi/fsl_dspi.c
> > @@ -123,8 +123,10 @@ static uint dspi_read32(uint flags, uint *addr)
> >
> > static void dspi_write32(uint flags, uint *addr, uint val)
> > {
> > - flags & DSPI_FLAG_REGMAP_ENDIAN_BIG ?
> > - out_be32(addr, val) : out_le32(addr, val);
> > + if (flags & DSPI_FLAG_REGMAP_ENDIAN_BIG)
> > + out_be32(addr, val);
> > + else
> > + out_le32(addr, val);
> > }
>
> Unrelated change
Due to the the new do {} while(0) macro this doesn't compile, so it
needs to go together.
>
> >
> > static void dspi_halt(struct fsl_dspi_priv *priv, u8 halt)
> > diff --git a/include/fsl_ifc.h b/include/fsl_ifc.h
> > index 3ac226879303..1c363115beb2 100644
> > --- a/include/fsl_ifc.h
> > +++ b/include/fsl_ifc.h
> > @@ -803,29 +803,29 @@ void init_final_memctl_regs(void);
> > ((struct fsl_ifc_fcm *)CFG_SYS_IFC_ADDR)
> >
> > #define get_ifc_cspr_ext(i) \
> > - (ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext))
> > + ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext)
> > #define get_ifc_cspr(i) \
> > - (ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr))
> > + ifc_in32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr)
> > #define get_ifc_csor_ext(i) \
> > - (ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext))
> > + ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext)
> > #define get_ifc_csor(i) \
> > - (ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor))
> > + ifc_in32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor)
> > #define get_ifc_amask(i) \
> > - (ifc_in32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask))
> > + ifc_in32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask)
> > #define get_ifc_ftim(i, j) \
> > - (ifc_in32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j]))
> > + ifc_in32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j])
> > #define set_ifc_cspr_ext(i, v) \
> > - (ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext, v))
> > + ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr_ext, v)
> > #define set_ifc_cspr(i, v) \
> > - (ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr, v))
> > + ifc_out32(&(IFC_FCM_BASE_ADDR)->cspr_cs[i].cspr, v)
> > #define set_ifc_csor_ext(i, v) \
> > - (ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext, v))
> > + ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor_ext, v)
> > #define set_ifc_csor(i, v) \
> > - (ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor, v))
> > + ifc_out32(&(IFC_FCM_BASE_ADDR)->csor_cs[i].csor, v)
> > #define set_ifc_amask(i, v) \
> > - (ifc_out32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask, v))
> > + ifc_out32(&(IFC_FCM_BASE_ADDR)->amask_cs[i].amask, v)
> > #define set_ifc_ftim(i, j, v) \
> > - (ifc_out32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j], v))
> > + ifc_out32(&(IFC_FCM_BASE_ADDR)->ftim_cs[i].ftim[j], v)
>
> Same.
Same here, both of the changes are needed
Thanks
/Ilias
>
> >
> > enum ifc_chip_sel {
> > IFC_CS0,
> > --
> > 2.43.0
> >
>
> Thanks,
> --
> Jerome
More information about the U-Boot
mailing list