[PATCH v3] mtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabled

Abbarapu, Venkatesh venkatesh.abbarapu at amd.com
Thu Dec 26 04:30:49 CET 2024


Hi,

> -----Original Message-----
> From: Marek Vasut <marex at denx.de>
> Sent: Thursday, December 26, 2024 1:51 AM
> To: Abbarapu, Venkatesh <venkatesh.abbarapu at amd.com>; u-boot at lists.denx.de;
> tudor.ambarus at linaro.org; j-humphreys at ti.com
> Cc: Simek, Michal <michal.simek at amd.com>; jagan at amarulasolutions.com;
> vigneshr at ti.com; u-kumar1 at ti.com; trini at konsulko.com; seanga2 at gmail.com;
> caleb.connolly at linaro.org; sjg at chromium.org; william.zhang at broadcom.com;
> stefan_b at posteo.net; quentin.schulz at cherry.de; Takahiro.Kuwano at infineon.com;
> p-mantena at ti.com; git (AMD-Xilinx) <git at amd.com>
> Subject: Re: [PATCH v3] mtd: spi-nor: Fix the spi_nor_read() when config
> SPI_STACKED_PARALLEL is enabled
> 
> On 12/24/24 4:34 PM, Abbarapu, Venkatesh wrote:
> 
> [...]
> 
> >>> @@ -1593,18 +1595,23 @@ static int spi_nor_read(struct mtd_info
> >>> *mtd, loff_t
> >> from, size_t len,
> >>>    	}
> >>>
> >>>    	while (len) {
> >>> -		bank = (u32)from / SZ_16M;
> >>> -		if (nor->flags & SNOR_F_HAS_PARALLEL)
> >>> -			bank /= 2;
> >>> -
> >>> -		rem_bank_len = SZ_16M * (bank + 1);
> >>> -		if (nor->flags & SNOR_F_HAS_PARALLEL)
> >>> -			rem_bank_len *= 2;
> >>> -		rem_bank_len -= from;
> >>> -
> >>> +		size_t read_len = len;
> >>
> >> size_t read_len should be declared at the beginning of this function.
> >>
> >>>    		offset = from;
> >>>
> >>> +	if (CONFIG_IS_ENABLED(SPI_STACKED_PARALLEL)) {
> >>
> >> The indent here needs to be pushed on tab RIGHT -> .
> >>
> >> Do you need this functionality in SPL ? If so, you might need a
> >> matching Kconfig SPL_SPI_STACKED_PARALLEL symbol .
> >
> > This functionality is not needed for SPL.
> 
> So SPL does use SPI NOR in non-stacked/parallel mode, and U-Boot does use it in
> stacked/parallel mode ? Doesn't that pose a problem ?
> 
> [...]
> 
> > FLASH_BAR and stacked parallel configuration doesn’t depend on each other.
> Is the use of BAR register and stacked/parallel mode mutually exclusive or can they
> be used together ?
The FLASH_BAR and stacked/parallel mode can be used together.

Thanks
Venkatesh


More information about the U-Boot mailing list