Hi Julien, On Fri, Oct 22, 2021 at 2:21 PM Julien Massot <julien.massot@xxxxxxx> wrote: > R-Car Gen3 SoC series has a realtime processor, the boot > address of this processor can be set thanks to CR7BAR register > of the reset module. > > Export this function so that it's possible to set the boot > address from a remoteproc driver. > > Also drop the __initdata qualifier on rcar_rst_base, > since we will use this address later than init time. > > Signed-off-by: Julien Massot <julien.massot@xxxxxxx> > --- > Change since v3: > - Change boot_addr type to u64 to match remoteproc type > - Modify boot_addr sanity check to also check for 32 bits address > - Export function using EXPORT_SYMBOL_GPL macro Thanks for the update! > --- a/drivers/soc/renesas/rcar-rst.c > +++ b/drivers/soc/renesas/rcar-rst.c > @@ -19,9 +26,29 @@ static int rcar_rst_enable_wdt_reset(void __iomem *base) > return 0; > } > > +/* > + * Most of the R-Car Gen3 SoCs have an ARM Realtime Core. > + * Firmware boot address has to be set in CR7BAR before > + * starting the realtime core. > + * Boot address must be aligned on a 256k boundary. > + */ > +static int rcar_rst_set_gen3_rproc_boot_addr(u64 boot_addr) > +{ > + if (boot_addr & ~(u64)CR7BAR_MASK) { > + pr_warn("Invalid boot address got %llx\n", boot_addr); pr_err > + return -EINVAL; > + } > + > + iowrite32((u32)boot_addr, rcar_rst_base + CR7BAR); > + iowrite32((u32)boot_addr | CR7BAREN, rcar_rst_base + CR7BAR); These casts to u32 are not needed. Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> i.e. will queue in renesas-devel for v5.17, with the above fixed (no need to resend). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds