> Subject: Re: [PATCH 2/6] spl: spi: introduce spl_spi_get_uboot_raw_sector
> 
> Hi Peng,
> 
> On 20.09.19 05:27, Peng Fan wrote:
> > Introduce a weak function spl_spi_get_uboot_raw_sector, then platform
> > could have their own implementation.
> >
> > Signed-off-by: Peng Fan <peng....@nxp.com>
> > Cc: Simon Goldschmidt <simon.k.r.goldschm...@gmail.com>
> > Cc: Tien Fong Chee <tien.fong.c...@intel.com>
> > Cc: Marek Vasut <ma...@denx.de>
> > Cc: Andreas Dannenberg <dannenb...@ti.com>
> > Cc: Alex Kiernan <alex.kier...@gmail.com>
> > Cc: Stefan Roese <s...@denx.de>
> > Cc: Patrick Delaunay <patrick.delau...@st.com>
> > Cc: Miquel Raynal <miquel.ray...@bootlin.com>
> > Cc: Michal Simek <michal.si...@xilinx.com>
> > ---
> >   common/spl/spl_spi.c | 10 +++++++++-
> >   1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c index
> > 9b74473377..1ba0e497d2 100644
> > --- a/common/spl/spl_spi.c
> > +++ b/common/spl/spl_spi.c
> > @@ -62,6 +62,12 @@ static ulong spl_spi_fit_read(struct spl_load_info
> *load, ulong sector,
> >     else
> >             return 0;
> >   }
> > +
> > +unsigned int __weak spl_spi_get_uboot_raw_sector(struct spi_flash
> > +*flash) {
> > +   return CONFIG_SYS_SPI_U_BOOT_OFFS;
> > +}
> > +
> >   /*
> >    * The main entry for SPI booting. It's necessary that SDRAM is already
> >    * configured and available since this code loads the main U-Boot
> > image @@ -71,7 +77,7 @@ static int spl_spi_load_image(struct
> spl_image_info *spl_image,
> >                           struct spl_boot_device *bootdev)
> >   {
> >     int err = 0;
> > -   unsigned payload_offs = CONFIG_SYS_SPI_U_BOOT_OFFS;
> > +   unsigned int payload_offs;
> >     struct spi_flash *flash;
> >     struct image_header *header;
> >
> > @@ -90,6 +96,8 @@ static int spl_spi_load_image(struct spl_image_info
> *spl_image,
> >             return -ENODEV;
> >     }
> >
> > +   payload_offs = spl_spi_get_uboot_raw_sector(flash);
> 
> I don't really like the function name here "_raw_sector" as this is not a 
> sector
> number in SPI flash but an address offset.

Oh, yes. spl_spi_get_uboot_offs should be fine.

Thanks,
Peng.
 

> 
> Thanks,
> Stefan
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to