mtd: spi-nor: Extract volatile register offset from SCCR map
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Fri, 7 Apr 2023 06:40:59 +0000 (15:40 +0900)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Sat, 8 Apr 2023 06:30:17 +0000 (09:30 +0300)
commit706fd00da031e24572216dc650d77111afc2501a
treee6858a7b30c1207b1e4d8cad9f80d9d673f8a89b
parente570f7872a34dc290014c80c7bad365d6577836b
mtd: spi-nor: Extract volatile register offset from SCCR map

In use of multi-chip devices, we need to access registers in each die for
configuration and status check. The number of dice in the device and
volatile register offsets for each die are essential to iterate register
access ops.

The volatile register offset for the first die resides in the 1st DWORD
of SCCR map. Allocate the table and copy the offset value.

The table may be allocated when the SCCR map for multi-chip is parsed.
Since we cannot assume SCCR parse is always in ahead of SCCR multi-chip,
we need to check if the table is already allocated or not.

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