<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/mtd, branch v2022.01-rc3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/mtd?h=v2022.01-rc3</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/mtd?h=v2022.01-rc3'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2021-11-05T15:26:29Z</updated>
<entry>
<title>Convert CONFIG_SPL_DRIVERS_MISC et al to Kconfig</title>
<updated>2021-11-05T15:26:29Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2021-10-31T03:03:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1616626417716e988362c908125ba574c402f831'/>
<id>urn:sha1:1616626417716e988362c908125ba574c402f831</id>
<content type='text'>
This converts the following to Kconfig:
   CONFIG_SPL_DRIVERS_MISC
   CONFIG_SPL_ENV_SUPPORT
   CONFIG_SPL_GPIO
   CONFIG_SPL_I2C
   CONFIG_SPL_LDSCRIPT
   CONFIG_SPL_LIBCOMMON_SUPPORT
   CONFIG_SPL_LIBGENERIC_SUPPORT
   CONFIG_SPL_LOAD_FIT_ADDRESS
   CONFIG_SPL_MMC
   CONFIG_SPL_NAND_SUPPORT
   CONFIG_SPL_NO_CPU_SUPPORT
   CONFIG_SPL_OS_BOOT
   CONFIG_SPL_POWER
   CONFIG_SPL_STACK_R
   CONFIG_SPL_STACK_R_ADDR
   CONFIG_SPL_WATCHDOG
   CONFIG_SPL_TEXT_BASE

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>Merge https://source.denx.de/u-boot/custodians/u-boot-spi</title>
<updated>2021-10-23T14:49:28Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2021-10-23T14:49:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=355d1e24f6143c4839be3c015c191421c4e9449c'/>
<id>urn:sha1:355d1e24f6143c4839be3c015c191421c4e9449c</id>
<content type='text'>
- Fix mtd erase with mtdpart (Marek Behún)
- NXP fspi driver fixes (Kuldeep Singh)
</content>
</entry>
<entry>
<title>mtd: spi-nor-ids: Add SECT_4K to mt25qu512a</title>
<updated>2021-10-23T10:24:51Z</updated>
<author>
<name>Kris Chaplin</name>
<email>kris.chaplin@linux.intel.com</email>
</author>
<published>2021-10-18T10:30:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=85886161ef51f1fd8a0bea2518324cf6374bac8f'/>
<id>urn:sha1:85886161ef51f1fd8a0bea2518324cf6374bac8f</id>
<content type='text'>
The mt25qu512a supports 4K or 64K sectors, so adding
SECT_4K to enable 4K sector usage.

Tested on Intel n5x hardware with QSPI carrier card

Signed-off-by: Kris Chaplin &lt;kris.chaplin@linux.intel.com&gt;
Acked-by: Pratyush Yadav &lt;p.yadav@ti.com&gt;
[jagan: droped Tested-by of patch author and datasheet link]
Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor-ids: Add is25lp512 and is25wp512 devices</title>
<updated>2021-10-23T10:22:29Z</updated>
<author>
<name>Kris Chaplin</name>
<email>kris.chaplin@linux.intel.com</email>
</author>
<published>2021-10-18T10:26:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b7a772a3bba6e414234c6c2ed098c92c3fca2db6'/>
<id>urn:sha1:b7a772a3bba6e414234c6c2ed098c92c3fca2db6</id>
<content type='text'>
Add is25lp512 and is25wp512 devices to spi-nor id table

Tested on Intel n5x hardware with QSPI carrier card

Signed-off-by: Kris Chaplin &lt;kris.chaplin@linux.intel.com&gt;
[jagan: droped Tested-by of patch author]
Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>mtd: Remove mtd_erase_callback() entirely</title>
<updated>2021-10-23T10:17:33Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-10-05T13:56:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0d1ecc99cb59c2190257f7738f91db21f174dc02'/>
<id>urn:sha1:0d1ecc99cb59c2190257f7738f91db21f174dc02</id>
<content type='text'>
The original purpose of mtd_erase_callback() in Linux at the time it was
imported to U-Boot, was to inform the caller that erasing is done (since
it was an asynchronous operation).

All supplied callback methods in U-Boot do nothing, but the
mtd_erase_callback() function was (until previous patch) grossly abused
in U-Boot's mtdpart implementation for completely different purpose.

Since we got rid of the abusement, remove the mtd_erase_callback()
function and the .callback member from struct erase_info entirely, in
order to avoid such problems in the future.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
</content>
</entry>
<entry>
<title>mtd: mtdpart: Make mtdpart's _erase method sane</title>
<updated>2021-10-23T10:17:33Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-10-05T13:56:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a60397d219c2ddbceedfea4e121e303804d333d0'/>
<id>urn:sha1:a60397d219c2ddbceedfea4e121e303804d333d0</id>
<content type='text'>
The _erase() method of the mtdpart driver, part_erase(), currently
implements offset shifting (for given mtdpart partition) in a weird way:
  1. part_erase() adds partition offset to block address
  2. parent driver's _erase() method is called
  3. parent driver's _erase() method calls mtd_erase_callback()
  4. mtd_erase_callback() subtracts partition offset from block address
     so that the callback function is given correct address
The problem here is that if the parent's driver does not call
mtd_erase_callback() in some scenario (this was recently a case for
spi_nor_erase(), which did not call mtd_erase_callback() at all), the
offset is not shifted back.

Moreover the code would be more readable if part_erase() not only added
partition offset before calling parent's _erase(), but also subtracted
it back afterwards. Currently the mtd_erase_callback() is expected to do
this subtracting since it does have to do it anyway.

Add the more steps to this procedure:
  5. mtd_erase_callback() adds partition offset to block address so that
     it returns the the erase_info structure members as it received them
  6. part_erase() subtracts partition offset from block address

This makes the code more logical and also prevents errors in case
parent's driver does not call mtd_erase_callback() for some reason.

(BTW, the purpose of mtd_erase_callback() in Linux is to inform the
 caller that it is done, since in Linux erasing is done asynchronously.
 We are abusing the purpose of mtd_erase_callback() in U-Boot for
 completely different purpose. The callback function itself has empty
 implementation in all cases in U-Boot.)

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Masami Hiramatsu &lt;masami.hiramatsu@linaro.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor-core: Check for ctrlc() in spi_nor_erase()</title>
<updated>2021-10-23T10:17:33Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-10-05T13:56:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1fd5e67595367126c9f76b3f0c47db21523665c3'/>
<id>urn:sha1:1fd5e67595367126c9f76b3f0c47db21523665c3</id>
<content type='text'>
May it possible to interrupt the spi_nor_erase() function.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Masami Hiramatsu &lt;masami.hiramatsu@linaro.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor-core: Call mtd_erase_callback() from spi_nor_erase()</title>
<updated>2021-10-23T10:17:33Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-10-05T13:56:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ff0000b47d7945701b2f9d17cc301b54452d499b'/>
<id>urn:sha1:ff0000b47d7945701b2f9d17cc301b54452d499b</id>
<content type='text'>
The spi_nor_erase() function does not call mtd_erase_callback() as it
should.

The mtdpart code currently implements the subtraction of partition
offset in mtd_erase_callback().

This results in partition offset being added prior calling
spi_nor_erase(), but not subtracted back on return. The result is that
the `mtd erase` command does not erase the whole partition, only some of
it's blocks:

  =&gt; mtd erase "Rescue system"
  Erasing 0x00000000 ... 0x006fffff (1792 eraseblock(s))
  jedec_spi_nor spi-nor@0: at 0x100000, len 4096
  jedec_spi_nor spi-nor@0: at 0x201000, len 4096
  jedec_spi_nor spi-nor@0: at 0x302000, len 4096
  jedec_spi_nor spi-nor@0: at 0x403000, len 4096
  jedec_spi_nor spi-nor@0: at 0x504000, len 4096
  jedec_spi_nor spi-nor@0: at 0x605000, len 4096
  jedec_spi_nor spi-nor@0: at 0x706000, len 4096

This is obviously wrong.

Add proper calling of mtd_erase_callback() into the spi_nor_erase()
function.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Masami Hiramatsu &lt;masami.hiramatsu@linaro.org&gt;
Tested-by: Masami Hiramatsu &lt;masami.hiramatsu@linaro.org&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor-core: Don't check for zero length in spi_nor_write() / spi_nor_erase()</title>
<updated>2021-10-23T10:17:33Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-10-05T13:56:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7398c1b758e70708edc1d0aced2e2b07ded1ed7e'/>
<id>urn:sha1:7398c1b758e70708edc1d0aced2e2b07ded1ed7e</id>
<content type='text'>
This check is already done in all callers: mtdcore's mtd_write() /
mtd_erase(), legacy spi_nor_write() / spi_flash_erase(). No reason to do
this here as well.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
</content>
</entry>
<entry>
<title>mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase()</title>
<updated>2021-10-23T10:17:33Z</updated>
<author>
<name>Marek Behún</name>
<email>marek.behun@nic.cz</email>
</author>
<published>2021-10-05T13:56:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f57277997bd8036d45337ec60b08a025a0473f89'/>
<id>urn:sha1:f57277997bd8036d45337ec60b08a025a0473f89</id>
<content type='text'>
The cleanup code of spi_nor_erase() function calls write_disable(), but
does not return it's return value even in case of failure. Fix this.

Signed-off-by: Marek Behún &lt;marek.behun@nic.cz&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Masami Hiramatsu &lt;masami.hiramatsu@linaro.org&gt;
</content>
</entry>
</feed>
