<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/fastboot, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>fastboot: mmc: make boot partition offset configurable</title>
<updated>2026-02-19T10:27:51+00:00</updated>
<author>
<name>Adrian Freihofer</name>
<email>adrian.freihofer@siemens.com</email>
</author>
<published>2026-02-17T10:36:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=24526162338114a8ac6c51280fa672ee1ca72241'/>
<id>24526162338114a8ac6c51280fa672ee1ca72241</id>
<content type='text'>
i.MX8QXP rev C.0 requires boot container stored at offset 0KB
for eMMC, while i.MX8QXP pre C.0 requires boot container stored
at offset 32KB for eMMC.

To use one U-Boot binary to support different chip revisions,
introduce fb_mmc_get_boot_offset() to allow override the default
offset when writing to eMMC boot partitions.

This enables support for devices with non-standard boot partition
layouts, such as those requiring an offset for correct bootloader
placement.

Signed-off-by: Adrian Freihofer &lt;adrian.freihofer@siemens.com&gt;
Signed-off-by: Heiko Schocher &lt;hs@nabladev.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://lore.kernel.org/r/20260217103604.71029-2-hs@nabladev.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i.MX8QXP rev C.0 requires boot container stored at offset 0KB
for eMMC, while i.MX8QXP pre C.0 requires boot container stored
at offset 32KB for eMMC.

To use one U-Boot binary to support different chip revisions,
introduce fb_mmc_get_boot_offset() to allow override the default
offset when writing to eMMC boot partitions.

This enables support for devices with non-standard boot partition
layouts, such as those requiring an offset for correct bootloader
placement.

Signed-off-by: Adrian Freihofer &lt;adrian.freihofer@siemens.com&gt;
Signed-off-by: Heiko Schocher &lt;hs@nabladev.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://lore.kernel.org/r/20260217103604.71029-2-hs@nabladev.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: integrate block flashing back-end</title>
<updated>2025-11-24T09:51:17+00:00</updated>
<author>
<name>Dmitrii Merkurev</name>
<email>dimorinny@google.com</email>
</author>
<published>2025-11-21T10:53:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=769c6cbbb53074025c3af53d8df5571ae18d74c3'/>
<id>769c6cbbb53074025c3af53d8df5571ae18d74c3</id>
<content type='text'>
1. Get partition info/size
2. Erase partition
3. Flash partition
4. BCB

Make FASTBOOT_FLASH also depend on BLK, but make sure
it doesn't affect SUNXI and ROCKCHIP platforms since they
default to y already.

Make it only default on SUNXI when MMC or NAND is enabled,
so it doesn't break the CHIP &amp; Nintendo boards, and for ROCKCHIP
when MMC is enabled.

Signed-off-by: Dmitrii Merkurev &lt;dimorinny@google.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-3-9589d902fc91@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Get partition info/size
2. Erase partition
3. Flash partition
4. BCB

Make FASTBOOT_FLASH also depend on BLK, but make sure
it doesn't affect SUNXI and ROCKCHIP platforms since they
default to y already.

Make it only default on SUNXI when MMC or NAND is enabled,
so it doesn't break the CHIP &amp; Nintendo boards, and for ROCKCHIP
when MMC is enabled.

Signed-off-by: Dmitrii Merkurev &lt;dimorinny@google.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-3-9589d902fc91@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: blk: switch emmc to use the block helpers</title>
<updated>2025-11-24T09:51:17+00:00</updated>
<author>
<name>Dmitrii Merkurev</name>
<email>dimorinny@google.com</email>
</author>
<published>2025-11-21T10:53:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b63e85705d2c25a46b38db891a7957b5c6b8d263'/>
<id>b63e85705d2c25a46b38db891a7957b5c6b8d263</id>
<content type='text'>
Switch the mmc backend to this new shared block helpers,
reducing block logic and only leaving MMC specific logic.

Signed-off-by: Dmitrii Merkurev &lt;dimorinny@google.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-2-9589d902fc91@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch the mmc backend to this new shared block helpers,
reducing block logic and only leaving MMC specific logic.

Signed-off-by: Dmitrii Merkurev &lt;dimorinny@google.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-2-9589d902fc91@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: blk: introduce fastboot block flashing support</title>
<updated>2025-11-24T09:51:16+00:00</updated>
<author>
<name>Dmitrii Merkurev</name>
<email>dimorinny@google.com</email>
</author>
<published>2025-11-21T10:53:31+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4bf92b541af628d899ea1dadf9147baa3482967a'/>
<id>4bf92b541af628d899ea1dadf9147baa3482967a</id>
<content type='text'>
Introduce fastboot block flashing functions and helpers
to be shared with the MMC implementation.

The write logic comes from the mmc implementation, while
the partition lookup is much simpler and could be extended.

For the erase logic, allmost no block drivers exposes the
erase operation, except mmc &amp; virtio, so in order to allow
erasiong any partition a soft-erase logic has been added
to write zero-ed buffers in a loop.

Signed-off-by: Dmitrii Merkurev &lt;dimorinny@google.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-1-9589d902fc91@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce fastboot block flashing functions and helpers
to be shared with the MMC implementation.

The write logic comes from the mmc implementation, while
the partition lookup is much simpler and could be extended.

For the erase logic, allmost no block drivers exposes the
erase operation, except mmc &amp; virtio, so in order to allow
erasiong any partition a soft-erase logic has been added
to write zero-ed buffers in a loop.

Signed-off-by: Dmitrii Merkurev &lt;dimorinny@google.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-1-9589d902fc91@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: Fix has-slot command always returning yes for fb_nand</title>
<updated>2025-09-30T09:48:51+00:00</updated>
<author>
<name>Chance Yang</name>
<email>chance.yang@kneron.us</email>
</author>
<published>2025-08-26T03:36:17+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3ce8a0e9115eaa0cdfc142459814b2283cf01785'/>
<id>3ce8a0e9115eaa0cdfc142459814b2283cf01785</id>
<content type='text'>
The issue was a mismatch in return value conventions between functions:
- getvar_get_part_info() expects &gt;= 0 for success
- fb_nand_lookup() returns 0 on success, 1 on failure (from
mtdparts_init and find_dev_and_part)

When partition didn't exist, fb_nand_lookup returned 1, but
fastboot_nand_get_part_info passed it directly to getvar_get_part_info,
which treated 1 &gt;= 0 as success, causing has-slot to always return yes.

Fix by converting positive return values to -ENOENT in
fastboot_nand_get_part_info to match the expected error convention.

Signed-off-by: Chance Yang &lt;chance.yang@kneron.us&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://lore.kernel.org/r/20250826-master-v2-1-30b787a2f9fd@kneron.us
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The issue was a mismatch in return value conventions between functions:
- getvar_get_part_info() expects &gt;= 0 for success
- fb_nand_lookup() returns 0 on success, 1 on failure (from
mtdparts_init and find_dev_and_part)

When partition didn't exist, fb_nand_lookup returned 1, but
fastboot_nand_get_part_info passed it directly to getvar_get_part_info,
which treated 1 &gt;= 0 as success, causing has-slot to always return yes.

Fix by converting positive return values to -ENOENT in
fastboot_nand_get_part_info to match the expected error convention.

Signed-off-by: Chance Yang &lt;chance.yang@kneron.us&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://lore.kernel.org/r/20250826-master-v2-1-30b787a2f9fd@kneron.us
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: Fix off by 1 error</title>
<updated>2025-07-22T17:30:14+00:00</updated>
<author>
<name>Andrew Goodbody</name>
<email>andrew.goodbody@linaro.org</email>
</author>
<published>2025-07-17T08:43:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=23d2c182d4be9f993a4e4d8f4fc6293e4d5a9ff8'/>
<id>23d2c182d4be9f993a4e4d8f4fc6293e4d5a9ff8</id>
<content type='text'>
strlen only reports length of string not including terminating 0 byte
but this has to be included in length of receiving buffer on copy so
adjust length check to be correct.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
strlen only reports length of string not including terminating 0 byte
but this has to be included in length of receiving buffer on copy so
adjust length check to be correct.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody &lt;andrew.goodbody@linaro.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers: fastboot: Add support for SPI flash memory</title>
<updated>2025-07-22T17:30:14+00:00</updated>
<author>
<name>Ariel D'Alessandro</name>
<email>ariel.dalessandro@collabora.com</email>
</author>
<published>2025-07-17T13:58:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=afca60620ad7958fbee2d5518de0383483c82ced'/>
<id>afca60620ad7958fbee2d5518de0383483c82ced</id>
<content type='text'>
Fastboot currently supports MMC and NAND flash devices. Similarly,
extend the support to SPI flash memories.

Note that in this initial implementation, partitions on the device are
not supported yet, but raw partitions can be set in U-Boot environment.

To define a raw partition descriptor, add an environment variable
similar to the MMC case:

```
fastboot_raw_partition_&lt;raw partition name&gt;=&lt;offset&gt; &lt;size&gt;
```

for example:

```
fastboot_raw_partition_boot=0x0 0x1000000
```

Signed-off-by: Ariel D'Alessandro &lt;ariel.dalessandro@collabora.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fastboot currently supports MMC and NAND flash devices. Similarly,
extend the support to SPI flash memories.

Note that in this initial implementation, partitions on the device are
not supported yet, but raw partitions can be set in U-Boot environment.

To define a raw partition descriptor, add an environment variable
similar to the MMC case:

```
fastboot_raw_partition_&lt;raw partition name&gt;=&lt;offset&gt; &lt;size&gt;
```

for example:

```
fastboot_raw_partition_boot=0x0 0x1000000
```

Signed-off-by: Ariel D'Alessandro &lt;ariel.dalessandro@collabora.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: lift restrictions on !NET_LWIP for USB</title>
<updated>2025-04-10T07:59:37+00:00</updated>
<author>
<name>Michael Walle</name>
<email>mwalle@kernel.org</email>
</author>
<published>2025-03-12T07:36:55+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d3c9f810f2b317ba376b4d9556e63a043b210355'/>
<id>d3c9f810f2b317ba376b4d9556e63a043b210355</id>
<content type='text'>
Fastboot works either over TCP, UDP or USB. The latter doesn't have
anything to do with networking, thus should work just fine with
regardless which network stack is selected. In practice, header symbols
are used inside common code paths. Add some ifdeffery to guard against
that.

This will make fastboot over USB work with the new LWIP stack.

Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Link: https://lore.kernel.org/r/20250312073655.2281377-1-mwalle@kernel.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fastboot works either over TCP, UDP or USB. The latter doesn't have
anything to do with networking, thus should work just fine with
regardless which network stack is selected. In practice, header symbols
are used inside common code paths. Add some ifdeffery to guard against
that.

This will make fastboot over USB work with the new LWIP stack.

Signed-off-by: Michael Walle &lt;mwalle@kernel.org&gt;
Reviewed-by: Jerome Forissier &lt;jerome.forissier@linaro.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Link: https://lore.kernel.org/r/20250312073655.2281377-1-mwalle@kernel.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: annotate switch/case fallthrough case</title>
<updated>2025-04-08T22:23:51+00:00</updated>
<author>
<name>Andre Przywara</name>
<email>andre.przywara@arm.com</email>
</author>
<published>2025-03-27T15:33:01+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=06b1ebfe521d2729cd97db7dfed62469081f0ec3'/>
<id>06b1ebfe521d2729cd97db7dfed62469081f0ec3</id>
<content type='text'>
The fastboot command handling uses an implicit switch/case fallthrough
when receiving the OEM_CONSOLE command, but when this command is not
enabled in Kconfig, to report this command as unknown.

Add our "fallthrough;" statement-like macro before the default branch in
the fastboot code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fastboot command handling uses an implicit switch/case fallthrough
when receiving the OEM_CONSOLE command, but when this command is not
enabled in Kconfig, to report this command as unknown.

Add our "fallthrough;" statement-like macro before the default branch in
the fastboot code, to avoid a warning when GCC's -Wimplicit-fallthrough
warning option is enabled.

Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fastboot: Fix warning when CONFIG_SYS_64BIT_LBA is enable</title>
<updated>2025-01-31T07:57:39+00:00</updated>
<author>
<name>Patrice Chotard</name>
<email>patrice.chotard@foss.st.com</email>
</author>
<published>2024-11-29T12:27:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=eb04f32c9b3c0989805a7597433bc49f23fd7c61'/>
<id>eb04f32c9b3c0989805a7597433bc49f23fd7c61</id>
<content type='text'>
If CONFIG_SYS_64BIT_LBA is enable, following compilation warning is
triggered:

 CC      drivers/fastboot/fb_mmc.o
../drivers/fastboot/fb_mmc.c: In function 'fb_mmc_erase_mmc_hwpart':
../drivers/fastboot/fb_mmc.c:215:35: warning: format '%lu' expects
argument of type 'long unsigned int', but argument 2 has type
'long long unsigned int' [-Wformat=]
  215 |         printf("........ erased %lu bytes from mmc hwpart[%u]\n",
      |                                 ~~^
      |                                   |
      |                                   long unsigned int
      |                                 %llu
  216 |                dev_desc-&gt;lba * dev_desc-&gt;blksz, dev_desc-&gt;hwpart);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              long long unsigned int
../drivers/fastboot/fb_mmc.c: In function 'fb_mmc_boot_ops':
../drivers/fastboot/fb_mmc.c:261:42: warning: format '%lu' expects
argument of type 'long unsigned int', but argument 2 has type
'long long unsigned int' [-Wformat=]
  261 |                 printf("........ wrote %lu bytes to EMMC_BOOT%d\n",
      |                                        ~~^
      |                                          |
      |                                          long unsigned int
      |                                        %llu
  262 |                        blkcnt * blksz, hwpart);
      |                        ~~~~~~~~~~~~~~
      |                               |
      |                               long long unsigned int

Signed-off-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Acked-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Reviewed-by: Patrick Delaunay &lt;patrick.delaunay@foss.st.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If CONFIG_SYS_64BIT_LBA is enable, following compilation warning is
triggered:

 CC      drivers/fastboot/fb_mmc.o
../drivers/fastboot/fb_mmc.c: In function 'fb_mmc_erase_mmc_hwpart':
../drivers/fastboot/fb_mmc.c:215:35: warning: format '%lu' expects
argument of type 'long unsigned int', but argument 2 has type
'long long unsigned int' [-Wformat=]
  215 |         printf("........ erased %lu bytes from mmc hwpart[%u]\n",
      |                                 ~~^
      |                                   |
      |                                   long unsigned int
      |                                 %llu
  216 |                dev_desc-&gt;lba * dev_desc-&gt;blksz, dev_desc-&gt;hwpart);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              long long unsigned int
../drivers/fastboot/fb_mmc.c: In function 'fb_mmc_boot_ops':
../drivers/fastboot/fb_mmc.c:261:42: warning: format '%lu' expects
argument of type 'long unsigned int', but argument 2 has type
'long long unsigned int' [-Wformat=]
  261 |                 printf("........ wrote %lu bytes to EMMC_BOOT%d\n",
      |                                        ~~^
      |                                          |
      |                                          long unsigned int
      |                                        %llu
  262 |                        blkcnt * blksz, hwpart);
      |                        ~~~~~~~~~~~~~~
      |                               |
      |                               long long unsigned int

Signed-off-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Acked-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Reviewed-by: Patrick Delaunay &lt;patrick.delaunay@foss.st.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
