mtd: spi-nor: sfdp: Add support for SCCR map for multi-chip device
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Fri, 7 Apr 2023 06:41:00 +0000 (15:41 +0900)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Sat, 8 Apr 2023 06:30:17 +0000 (09:30 +0300)
commit7ab8b810757a32b083c75a61b5638bca82e17a4c
tree6f9760ca7d962396bade1c43a456310319f546d9
parent706fd00da031e24572216dc650d77111afc2501a
mtd: spi-nor: sfdp: Add support for SCCR map for multi-chip device

SCCR map for multi-chip devices contains the number of additional dice in
the device and register offset values for each additional dice.

spi_nor_parse_sccr_mc() is added to determine the number of dice and
volatile register offset for each die. The volatile register offset table
may already be allocated and contains offset value for die-0 via SCCR map
parse. So, we should use devm_krealloc() to expand the table with
preserving die-0 offset.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Link: https://lore.kernel.org/r/89c892d52f8cbddbd14373f6a02db496885ae4f1.1680849425.git.Takahiro.Kuwano@infineon.com
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/sfdp.c