<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/mtd/spi-nor, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/mtd/spi-nor?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/mtd/spi-nor?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-18T08:11:35Z</updated>
<entry>
<title>mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init()</title>
<updated>2022-10-18T08:11:35Z</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2022-09-23T09:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=69d04ca999499bccb6ca849fa2bfc5e6448f7233'/>
<id>urn:sha1:69d04ca999499bccb6ca849fa2bfc5e6448f7233</id>
<content type='text'>
The Intel SPI-NOR controller does not support the 4-byte address opcode
so -&gt;set_4byte_addr_mode() ends up returning -ENOTSUPP and the SPI flash
chip probe fail like this:

  [ 12.291082] spi-nor: probe of spi0.0 failed with error -524

Whereas previously before commit 08412e72afba ("mtd: spi-nor: core:
Return error code from set_4byte_addr_mode()") it worked just fine.

Fix this by ignoring -ENOTSUPP in spi_nor_init().

Fixes: 08412e72afba ("mtd: spi-nor: core: Return error code from set_4byte_addr_mode()")
Cc: stable@vger.kernel.org
Reported-by: Hongyu Ning &lt;hongyu.ning@intel.com&gt;
Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Acked-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Signed-off-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
Link: https://lore.kernel.org/linux-mtd/20220923093441.3178-1-mika.westerberg@linux.intel.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: fix spi_nor_spimem_setup_op() call in spi_nor_erase_{sector,chip}()</title>
<updated>2022-07-28T02:34:23Z</updated>
<author>
<name>Patrice Chotard</name>
<email>patrice.chotard@foss.st.com</email>
</author>
<published>2022-06-29T13:30:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f8cd9f632f4415b1e8838bdca8ab42cfb37a6584'/>
<id>urn:sha1:f8cd9f632f4415b1e8838bdca8ab42cfb37a6584</id>
<content type='text'>
For erase operations, reg_proto must be used as indicated in
struct spi_nor description in spi-nor.h.

This issue was found when DT property spi-tx-bus-width is set to 4.
In this case the spi_mem_op-&gt;addr.buswidth is set to 4 for erase command
which is not correct.

Tested on stm32mp157c-ev1 board with mx66l51235f spi-nor.

Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol")
Signed-off-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
[ta: use nor-&gt;reg_proto in spi_nor_controller_ops_erase()]
Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Tested-by: Alexander Sverdlin &lt;alexander.sverdlin@nokia.com&gt;
Reviewed-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Link: https://lore.kernel.org/r/20220629133013.3382393-1-patrice.chotard@foss.st.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: spansion: Add s25hl-t/s25hs-t IDs and fixups</title>
<updated>2022-07-28T02:19:27Z</updated>
<author>
<name>Takahiro Kuwano</name>
<email>Takahiro.Kuwano@infineon.com</email>
</author>
<published>2022-07-25T09:25:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b6b23833fc42a10ceed00006cb0a6184f9b9bbde'/>
<id>urn:sha1:b6b23833fc42a10ceed00006cb0a6184f9b9bbde</id>
<content type='text'>
The S25HL-T/S25HS-T family is the Infineon SEMPER Flash with Quad SPI.

These Infineon chips support volatile version of configuration registers
and it is recommended to update volatile registers in the field application
due to a risk of the non-volatile registers corruption by power interrupt.
Add support for volatile QE bit.

For the single-die package parts (512Mb and 1Gb), only bottom 4KB and
uniform sector sizes are supported. This is due to missing or incorrect
entries in SMPT. Fixup for other sector sizes configurations will be
followed up as needed.

Tested on Xilinx Zynq-7000 FPGA board.

Signed-off-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Acked-by: Michael Walle &lt;michael@walle.cc&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-8-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: spansion: Add local function to discover page size</title>
<updated>2022-07-28T02:18:28Z</updated>
<author>
<name>Takahiro Kuwano</name>
<email>Takahiro.Kuwano@infineon.com</email>
</author>
<published>2022-07-25T09:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a6b50aa1279614df7033f8b57d6854fce0334e27'/>
<id>urn:sha1:a6b50aa1279614df7033f8b57d6854fce0334e27</id>
<content type='text'>
The page size check in s28hs512t fixup can be used for s25hs/hl-t as well.
Move that to a newly created local function.

Signed-off-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-7-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: core: Track flash's internal address mode</title>
<updated>2022-07-28T02:14:28Z</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2022-07-25T09:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d7931a21506321327351f68fdebf74a56a58e675'/>
<id>urn:sha1:d7931a21506321327351f68fdebf74a56a58e675</id>
<content type='text'>
We need to track the flash's internal address mode as there are flashes
that can operate with 4B opcodes but unfortunately do not have a 4B opcode
correspondent for all the 3B opcodes. Such an example is the Infineon
Semper chips which provide 4B opcodes for read/program/erase but do not
provide 4B opcodes for Read/Write Any Register. These registers are
indexed by address and require the internal address mode of the flash
before Read/Write Any Register opcodes are issued.
4B opcodes are preferred over changing the flash's address mode to 4byte,
as set_4byte_addr_mode could be done in a non-volatile way and could break
the boot sequence. Thus we need to track the flash's internal address mode
so that we can use 4B opcodes together with opcodes that don't have a 4B
opcode correspondent. Track flash's internal address mode.

addr_mode_nbytes is discovered when parsing BFPT. For the
BFPT_DWORD1_ADDRESS_BYTES_3_OR_4 case, one could introduce a method that
queries the flash's internal address mode at run-time (works for Winbond).
If a run-time querying can not be accomplished or if SFDP is not defined
at all, but the address mode is volatile and resets to a default known
value at boot, one can change the default addr_mode_nbytes value of 3 by
introducing a flash_info flag. If the address mode can not be queried,
discovered and it is configured via a non-volatile register, we may
introduce a dt property, but it will harm the generic approach of the
jedec,spi-nor compatible. All this complexity is not needed now, so let it
for future development.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Reviewed-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-6-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: core: Return error code from set_4byte_addr_mode()</title>
<updated>2022-07-28T02:11:56Z</updated>
<author>
<name>Takahiro Kuwano</name>
<email>Takahiro.Kuwano@infineon.com</email>
</author>
<published>2022-07-25T09:25:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=08412e72afba3a2daef3e7f3378c3753255a0017'/>
<id>urn:sha1:08412e72afba3a2daef3e7f3378c3753255a0017</id>
<content type='text'>
The prams-&gt;set_4byte_addr_mode returns error code but is not handled
in spi_nor_init(). Handle the return code from set_4byte_addr_mode().

Suggested-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Reviewed-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-5-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: Do not change nor-&gt;addr_nbytes at SFDP parsing time</title>
<updated>2022-07-28T02:11:56Z</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2022-07-25T09:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=47c6f8a67f2ce1b95202c16fa126411d6f5c7d5c'/>
<id>urn:sha1:47c6f8a67f2ce1b95202c16fa126411d6f5c7d5c</id>
<content type='text'>
At the SFDP parsing time we should not change members of struct spi_nor,
but instead fill members of struct spi_nor_flash_parameters which could
later on be used by callers. The caller will then decide if SFDP params
should be used and more importantly when they should be used. Clean the
code flow and don't initialize nor-&gt;addr_nbytes at SFDP parsing time.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Tested-by: Takahiro Kuwano &lt;Takahiro.Kuwano@infineon.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-4-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: core: Shrink the storage size of the flash_info's addr_nbytes</title>
<updated>2022-07-28T02:11:56Z</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2022-07-25T09:25:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=aa5d980a144cd0bf717eb16609c29ff276f8bd47'/>
<id>urn:sha1:aa5d980a144cd0bf717eb16609c29ff276f8bd47</id>
<content type='text'>
The maximum number of address bytes in SPI NOR is 4. Shrink the storage
size of the flash_info's addr_nbytes.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-3-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: s/addr_width/addr_nbytes</title>
<updated>2022-07-28T02:11:56Z</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2022-07-25T09:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c452d49849d48bd37ae97fc2bc92c6435707c35f'/>
<id>urn:sha1:c452d49849d48bd37ae97fc2bc92c6435707c35f</id>
<content type='text'>
Address width was an unfortunate name, as it means the number of IO lines
used for the address, whereas in the code it is used as the number of
address bytes. s/addr_width/addr_nbytes throughout the entire SPI NOR
framework.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Acked-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Link: https://lore.kernel.org/r/20220725092505.446315-2-tudor.ambarus@microchip.com
</content>
</entry>
<entry>
<title>mtd: spi-nor: esmt: Use correct name of f25l32qa</title>
<updated>2022-07-19T10:05:31Z</updated>
<author>
<name>Sungbo Eo</name>
<email>mans0n@gorani.run</email>
</author>
<published>2021-07-23T14:12:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=41e4f15f02af67fbcd6fec243ef52627f51760b4'/>
<id>urn:sha1:41e4f15f02af67fbcd6fec243ef52627f51760b4</id>
<content type='text'>
The flash ID of F25L32QA is 0x8c4016, whereas that of F25L32QA(2S) is
0x8c4116. F25L32QA(2S) is the newer version of F25L32QA and its BPn bits
are non-volatile, unlike its older version.

Signed-off-by: Sungbo Eo &lt;mans0n@gorani.run&gt;
Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Reviewed-by: Michael Walle &lt;michael@walle.cc&gt;
Link: https://lore.kernel.org/r/20210723141232.15659-1-mans0n@gorani.run
Datasheet: https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F25L32QA.pdf
Datasheet: https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F25L32QA_1(2S).pdf
</content>
</entry>
</feed>
