mtd: spi-nor-core: Rework s25hx_t_post_bfpt_fixup() for flash's internal address...
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Thu, 1 Sep 2022 06:05:33 +0000 (15:05 +0900)
committerJagan Teki <jagan@edgeble.ai>
Sun, 23 Oct 2022 05:20:38 +0000 (10:50 +0530)
commit7a4b6f8cf72e3566fd67ea840d248d8a34b8083e
tree6eb1eb49ec43e5e09915b242ae2ff4e7b7571d1a
parentf58e7b24faae2f01f59182405fb0a11ff2707cb7
mtd: spi-nor-core: Rework s25hx_t_post_bfpt_fixup() for flash's internal address mode

The flash's internal address mode is tracked by nor->add_mode_nbytes and
it is set to 3 in BFPT parse. SEMPER multi-die package parts (>1Gb) are
3- or 4-byte address mode by default, depending on model number. We need
to make sure that 4-byte address mode is used for multi-die package parts.

For single-die package parts (<=1Gb), registers can be accessed by 3-byte
address. Read, program, and erase use the 4B opcodes that always take
4-byte address regardless of flash's internal address mode.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/mtd/spi/spi-nor-core.c