<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/cmd/sf.c, branch v2023.07.01</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/cmd/sf.c?h=v2023.07.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/cmd/sf.c?h=v2023.07.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2023-05-31T21:23:01Z</updated>
<entry>
<title>cmd: sf/nand: Print and return failure when 0 length is passed</title>
<updated>2023-05-31T21:23:01Z</updated>
<author>
<name>Ashok Reddy Soma</name>
<email>ashok.reddy.soma@amd.com</email>
</author>
<published>2023-05-16T11:52:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=899fb5aa8becc159b1eb086d8828c4e8eb28f121'/>
<id>urn:sha1:899fb5aa8becc159b1eb086d8828c4e8eb28f121</id>
<content type='text'>
For sf commands, when '0' length is passed for erase, update, write or
read, there might be undesired results. Ideally '0' length means nothing to
do.

So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is
passed to sf commands. Same thing applies for nand commands also.

Example:

ZynqMP&gt; sf erase 0 0
ERROR: Invalid size 0
ZynqMP&gt; sf write 10000 0 0
ERROR: Invalid size 0
ZynqMP&gt; sf read 10000 0 0
ERROR: Invalid size 0
ZynqMP&gt; sf update 1000 10000 0
ERROR: Invalid size 0
ZynqMP&gt;

Signed-off-by: Ashok Reddy Soma &lt;ashok.reddy.soma@amd.com&gt;
</content>
</entry>
<entry>
<title>cmd: fix return code of 'sf erase'</title>
<updated>2023-01-26T15:35:13Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-01-02T17:21:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ee0b0be204aad0cee41167546fa3fc82f2aa57e8'/>
<id>urn:sha1:ee0b0be204aad0cee41167546fa3fc82f2aa57e8</id>
<content type='text'>
If the offset or the size passed to the 'sf erase' command exceeds
the size of the SPI flash displaying the command usage is not
helpful. Return CMD_RET_FAILURE instead of CMD_RET_USAGE.

Use the CMD_RET_* constants instead of 0, 1, -1.

Simplify a logical expression in the final return statement.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Acked-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>cmd: simplify do_spi_flash()</title>
<updated>2023-01-26T15:34:40Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-01-02T17:21:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8c8df676095ea05290f3deff1c8449f82e52b6ed'/>
<id>urn:sha1:8c8df676095ea05290f3deff1c8449f82e52b6ed</id>
<content type='text'>
CMD_RET_USAGE == -1. The special handling of this value at the end of
do_spi_flash() does not make any sense.

To avoid future confusion use the CMD_RET_* constants and simplify the
code.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>cmd: fix return code of 'sf write' and 'sf read'</title>
<updated>2023-01-26T15:34:16Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-01-02T17:21:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=fa3b38d4c432745b05e417c750c1c59c347fc18e'/>
<id>urn:sha1:fa3b38d4c432745b05e417c750c1c59c347fc18e</id>
<content type='text'>
If the offset or the size passed to the 'sf write' or 'sf read' command
exceeds the size of the SPI flash displaying the command usage is not
helpful. Return CMD_RET_FAILURE instead of CMD_RET_USAGE.

Use the CMD_RET_* constants instead of 0, 1, -1.

Simplify a logical expression in the final return statement.

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE</title>
<updated>2022-10-31T15:01:31Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-10-21T00:22:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=984639039f4cfe32ec2cc531d6ace05326ac49eb'/>
<id>urn:sha1:984639039f4cfe32ec2cc531d6ace05326ac49eb</id>
<content type='text'>
The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE
and this makes it imposible to use CONFIG_VAL().

Rename it to resolve this problem.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>cmd: sf: Handle unaligned 'update' start offset</title>
<updated>2022-10-25T04:47:33Z</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2022-09-28T16:45:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=622b5d356136f9172db7fe7ba240cd9e45097a19'/>
<id>urn:sha1:622b5d356136f9172db7fe7ba240cd9e45097a19</id>
<content type='text'>
Currently the 'sf update' command fails in case the 'start' offset is
not aligned to SPI NOR erase block size. Add the missing alignment
calculation. In case the start offset is in the middle of erase block,
round start address down to the nearest aligned one, compare only the
updated data between what is in the SPI NOR and what is being written,
copy new data at offset of the compare buffer, and write back the entire
erase block.

This is useful e.g. on i.MX6Q where the u-boot-with-spl.imx is at
offset 0x400 in the SPI NOR, while the SPI NOR may have erase block
size e.g. 0x1000 bytes.

Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>common: Drop display_options.h from common header</title>
<updated>2022-08-10T17:46:55Z</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2022-07-31T18:28:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4e4bf9449b4f436419490a4a8cf4de17433cac15'/>
<id>urn:sha1:4e4bf9449b4f436419490a4a8cf4de17433cac15</id>
<content type='text'>
Move this out of the common header and include it only where needed.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>Audit &lt;flash.h&gt; inclusion</title>
<updated>2022-08-04T20:18:47Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2022-07-23T17:05:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=17ead040d402c6e1fe26ac5acc4773146c8a0918'/>
<id>urn:sha1:17ead040d402c6e1fe26ac5acc4773146c8a0918</id>
<content type='text'>
A large number of files include &lt;flash.h&gt; as it used to be how various
SPI flash related functions were found, or for other reasons entirely.
In order to migrate some further CONFIG symbols to Kconfig we need to
not include flash.h in cases where we don't have a NOR flash of some
sort enabled.  Furthermore, in cases where we are in common code and it
doesn't make sense to try and further refactor the code itself in to new
files we need to guard this inclusion.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
</entry>
<entry>
<title>sf: Query write-protection status before operating the flash</title>
<updated>2022-07-18T13:45:19Z</updated>
<author>
<name>Jan Kiszka</name>
<email>jan.kiszka@siemens.com</email>
</author>
<published>2022-03-02T14:01:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f3a56dda880af44dac87b1a60c44ebb7c079c329'/>
<id>urn:sha1:f3a56dda880af44dac87b1a60c44ebb7c079c329</id>
<content type='text'>
Do not suggest successful operation if a flash area to be changed is
actually locked, thus will not execute the request. Rather report an
error and bail out. That's way more user-friendly than asking them to
manually check for this case.

Derived from original patch by Chao Zeng.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Acked-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
</content>
</entry>
<entry>
<title>spi: spi_flash_probe_bus_cs() rely on DT for spi speed and mode</title>
<updated>2022-05-23T13:33:10Z</updated>
<author>
<name>Patrice Chotard</name>
<email>patrice.chotard@foss.st.com</email>
</author>
<published>2022-03-30T07:33:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3feea0ba196ac686090acc48c77cf02b996a8589'/>
<id>urn:sha1:3feea0ba196ac686090acc48c77cf02b996a8589</id>
<content type='text'>
Now, spi_flash_probe_bus_cs() relies on DT for spi speed and mode
and logically calls spi_get_bus_and_cs(). In case spi mode and speed are
not read from DT, make usage of spi_flash_probe() instead.

To sum-up:
 - Previous call tree was:
    spi_flash_probe() -&gt; spi_flash_probe_bus_cs() -&gt; spi_get_bus_and_cs()

 - Current call tree is:
    spi_flash_probe() -&gt; _spi_get_bus_and_cs()
    spi_flash_probe_bus_cs() -&gt; spi_get_bus_and_cs()

This patch impacts the following :
  - cmd/sf.c: if spi mode and/or speed is passed in argument of
    do_spi_flash_probe(), call spi_flash_probe() otherwise call
    spi_flash_probe_bus_cs().

  - drivers/net/fm/fm.c: as by default spi speed and mode was set to
    0 and a comment indicates that speed and mode are read from DT,
    use spi_flash_probe_bus_cs().

  - drivers/net/pfe_eth/pfe_firmware.c: spi speed and mode are not read
    from DT by all platforms using this driver, so keep legacy and replace
    spi_flash_probe_bus_cs() by spi_flash_probe();

  - drivers/net/sni_netsec.c : spi speed and mode are not read from DT,
    so replace spi_flash_probe_bus_cs() by spi_flash_probe().

  - drivers/usb/gadget/max3420_udc.c: Can't find any platform which make
    usage of this driver, nevertheless, keep legacy and replace
    spi_get_bus_and_cs() by _spi_get_bus_and_cs().

  - env/sf.c: a comment indicates that speed and mode are read
    from DT. So use spi_flash_probe_bus_cs().

Signed-off-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;

Cc: Marek Behun &lt;marek.behun@nic.cz&gt;
Cc: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Cc: Vignesh R &lt;vigneshr@ti.com&gt;
Cc: Joe Hershberger &lt;joe.hershberger@ni.com&gt;
Cc: Ramon Fried &lt;rfried.dev@gmail.com&gt;
Cc: Lukasz Majewski &lt;lukma@denx.de&gt;
Cc: Marek Vasut &lt;marex@denx.de&gt;
Cc: Wolfgang Denk &lt;wd@denx.de&gt;
Cc: Simon Glass &lt;sjg@chromium.org&gt;
Cc: Stefan Roese &lt;sr@denx.de&gt;
Cc: "Pali Rohár" &lt;pali@kernel.org&gt;
Cc: Konstantin Porotchkin &lt;kostap@marvell.com&gt;
Cc: Igal Liberman &lt;igall@marvell.com&gt;
Cc: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Cc: Pratyush Yadav &lt;p.yadav@ti.com&gt;
Cc: Sean Anderson &lt;seanga2@gmail.com&gt;
Cc: Anji J &lt;anji.jagarlmudi@nxp.com&gt;
Cc: Biwen Li &lt;biwen.li@nxp.com&gt;
Cc: Priyanka Jain &lt;priyanka.jain@nxp.com&gt;
Cc: Chaitanya Sakinam &lt;chaitanya.sakinam@nxp.com&gt;
</content>
</entry>
</feed>
