[PATCH v4 2/2] mtd: spi: nor: force mtd name to "nor%d"

Tom Rini trini at konsulko.com
Tue Sep 28 20:45:20 CEST 2021


On Wed, Sep 22, 2021 at 06:29:08PM +0200, Patrick Delaunay wrote:

> Force the mtd name of spi-nor to "nor" + the driver sequence number:
> "nor0", "nor1"... beginning after the existing nor devices.
> 
> This patch is coherent with existing "nand" and "spi-nand"
> mtd device names.
> 
> When CFI MTD NOR device are supported, the spi-nor index is chosen after
> the last CFI device defined by CONFIG_SYS_MAX_FLASH_BANKS.
> 
> When CONFIG_SYS_MAX_FLASH_BANKS_DETECT is activated, this config
> is replaced by to cfi_flash_num_flash_banks in the include file
> mtd/cfi_flash.h.
> 
> This generic name "nor%d" can be use to identify the mtd spi-nor device
> without knowing the real device name or the DT path of the device,
> used with API get_mtd_device_nm() and is used in mtdparts command.
> 
> This patch also avoids issue when the same NOR device is present 2 times,
> for example on STM32MP15F-EV1:
> 
> STM32MP> mtd list
> SF: Detected mx66l51235l with page size 256 Bytes, erase size 64 KiB, \
> total 64 MiB
> 
> List of MTD devices:
> * nand0
>   - type: NAND flash
>   - block size: 0x40000 bytes
>   - min I/O: 0x1000 bytes
>   - OOB size: 224 bytes
>   - OOB available: 118 bytes
>   - ECC strength: 8 bits
>   - ECC step size: 512 bytes
>   - bitflip threshold: 6 bits
>   - 0x000000000000-0x000040000000 : "nand0"
> * mx66l51235l
>   - device: mx66l51235l at 0
>   - parent: spi at 58003000
>   - driver: jedec_spi_nor
>   - path: /soc/spi at 58003000/mx66l51235l at 0
>   - type: NOR flash
>   - block size: 0x10000 bytes
>   - min I/O: 0x1 bytes
>   - 0x000000000000-0x000004000000 : "mx66l51235l"
> * mx66l51235l
>   - device: mx66l51235l at 1
>   - parent: spi at 58003000
>   - driver: jedec_spi_nor
>   - path: /soc/spi at 58003000/mx66l51235l at 1
>   - type: NOR flash
>   - block size: 0x10000 bytes
>   - min I/O: 0x1 bytes
>   - 0x000000000000-0x000004000000 : "mx66l51235l"
> 
> The same mtd name "mx66l51235l" identify the 2 instances
> mx66l51235l at 0 and mx66l51235l at 1.
> 
> This patch fixes a ST32CubeProgrammer / stm32prog command issue
> with nor0 target on STM32MP157C-EV1 board introduced by
> commit b7f060565e31 ("mtd: spi-nor: allow registering multiple MTDs when
> DM is enabled").
> 
> Fixes: b7f060565e31 ("mtd: spi-nor: allow registering multiple MTDs when DM is enabled")
> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210928/c62ade78/attachment.sig>


More information about the U-Boot mailing list