<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/boot/bootflow.c, branch v2024.01</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>bootstd: Avoid freeing a non-allocated buffer</title>
<updated>2023-11-17T16:58:26+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-11-16T01:35:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=741d1e9d3f368908e3cd1861ddd707e81e1fd576'/>
<id>741d1e9d3f368908e3cd1861ddd707e81e1fd576</id>
<content type='text'>
EFI applications can be very large and thus used to cause boot failures
when malloc() space was exhausted.

A recent changed fixed this by using the kernel_addr_r environment var
as the address of the buffer. However, it still frees the buffer when
the bootflow is discarded.

Fix this by introducing a flag to indicate whether the buffer was
allocated, or not.

Note that kernel_addr_r is not the last word here. It might be better
to use lmb to place images. But there is a lot of refactoring to do
before we can remove the environment variables. The distro scripts rely
on them so it is safe for bootstd to do so too.

Fixes: 6a8c2f9781c bootstd: Avoid allocating memory for the EFI file

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported by: Simon Glass &lt;sjg@chromium.org&gt;
Reported by: Shantur Rathore &lt;i@shantur.com&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Tested-by: Shantur Rathore &lt;i@shantur.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
EFI applications can be very large and thus used to cause boot failures
when malloc() space was exhausted.

A recent changed fixed this by using the kernel_addr_r environment var
as the address of the buffer. However, it still frees the buffer when
the bootflow is discarded.

Fix this by introducing a flag to indicate whether the buffer was
allocated, or not.

Note that kernel_addr_r is not the last word here. It might be better
to use lmb to place images. But there is a lot of refactoring to do
before we can remove the environment variables. The distro scripts rely
on them so it is safe for bootstd to do so too.

Fixes: 6a8c2f9781c bootstd: Avoid allocating memory for the EFI file

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported by: Simon Glass &lt;sjg@chromium.org&gt;
Reported by: Shantur Rathore &lt;i@shantur.com&gt;
Reviewed-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Tested-by: Shantur Rathore &lt;i@shantur.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Handle a few special cases in cmdline_set_arg()</title>
<updated>2023-11-01T16:26:44+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-10-24T18:17:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=19248dcec53d19184ce1207962edd54109d28b01'/>
<id>19248dcec53d19184ce1207962edd54109d28b01</id>
<content type='text'>
Two bugs have appeared:

- arguments can have an equals sign embedded in them, which must be
  considered part of the value
- arguments must fully match the name; partial matches should be
  ignored

Fix these and add a test to cover both.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two bugs have appeared:

- arguments can have an equals sign embedded in them, which must be
  considered part of the value
- arguments must fully match the name; partial matches should be
  ignored

Fix these and add a test to cover both.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Scan all bootdevs in a boot_targets entry (take 2)</title>
<updated>2023-10-23T17:05:13+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-10-23T07:02:13+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7a790f018a812b5897fc144c46291de8df633429'/>
<id>7a790f018a812b5897fc144c46291de8df633429</id>
<content type='text'>
When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:

   boot_targets="mmc0 mmc1 mmc2"

In contrast, standard boot supports specifying just the uclass, i.e.:

   boot_targets="mmc"

The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.

Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Date Huang &lt;tjjh89017@hotmail.com&gt;
Reported-by: Vincent Stehlé &lt;vincent.stehle@arm.com&gt;
Reported-by: Ivan Ivanov &lt;ivan.ivanov@suse.com&gt;
Tested-by: Ivan T.Ivanov &lt;iivanov@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:

   boot_targets="mmc0 mmc1 mmc2"

In contrast, standard boot supports specifying just the uclass, i.e.:

   boot_targets="mmc"

The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.

Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Date Huang &lt;tjjh89017@hotmail.com&gt;
Reported-by: Vincent Stehlé &lt;vincent.stehle@arm.com&gt;
Reported-by: Ivan Ivanov &lt;ivan.ivanov@suse.com&gt;
Tested-by: Ivan T.Ivanov &lt;iivanov@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Correct logic for single uclass</title>
<updated>2023-10-23T17:05:13+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-10-23T07:02:12+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=16e19350d91e3c7e916b85b84c0364b20ac193d2'/>
<id>16e19350d91e3c7e916b85b84c0364b20ac193d2</id>
<content type='text'>
The current logic for "bootflow mmc" is flawed since it checks the
uclass of the bootdev instead of its parent, the media device. Correct
this and add a test that covers this scenario.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Ivan T.Ivanov &lt;iivanov@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current logic for "bootflow mmc" is flawed since it checks the
uclass of the bootdev instead of its parent, the media device. Correct
this and add a test that covers this scenario.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Ivan T.Ivanov &lt;iivanov@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "bootstd: Scan all bootdevs in a boot_targets entry"</title>
<updated>2023-10-23T17:05:13+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-10-23T07:02:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=abd1e94f70c9a2828d5ebec05013b055fb33c21d'/>
<id>abd1e94f70c9a2828d5ebec05013b055fb33c21d</id>
<content type='text'>
This commit was intended to allow all bootdevs in each boot_targets
entry to be scanned. However it causes bad ordering with bootdevs, e.g.
scanning Ethernet bootdevs when it should be keeping to mmc.

Revert it so we can try another approach.

This reverts commit e824d0d0c219bc6da767f13f90c5b00eefe929f0.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Ivan T.Ivanov &lt;iivanov@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit was intended to allow all bootdevs in each boot_targets
entry to be scanned. However it causes bad ordering with bootdevs, e.g.
scanning Ethernet bootdevs when it should be keeping to mmc.

Revert it so we can try another approach.

This reverts commit e824d0d0c219bc6da767f13f90c5b00eefe929f0.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Tested-by: Ivan T.Ivanov &lt;iivanov@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Scan all bootdevs in a boot_targets entry</title>
<updated>2023-10-13T17:15:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-09-23T20:50:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e824d0d0c219bc6da767f13f90c5b00eefe929f0'/>
<id>e824d0d0c219bc6da767f13f90c5b00eefe929f0</id>
<content type='text'>
When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:

   boot_targets="mmc0 mmc1 mmc2"

In contrast, standard boot supports specifying just the uclass, i.e.:

   boot_targets="mmc"

The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.

Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.

I believe at least three people reported this, but I found two.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Date Huang &lt;tjjh89017@hotmail.com&gt;
Reported-by: Vincent Stehlé &lt;vincent.stehle@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the boot_targets environment variable is used with the distro-boot
scripts, each device is included individually. For example, if there
are three mmc devices, then we will have something like:

   boot_targets="mmc0 mmc1 mmc2"

In contrast, standard boot supports specifying just the uclass, i.e.:

   boot_targets="mmc"

The intention is that this should scan all MMC devices, but in fact it
currently only scans the first.

Update the logic to handle this case, without required BOOTSTD_FULL to
be enabled.

I believe at least three people reported this, but I found two.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reported-by: Date Huang &lt;tjjh89017@hotmail.com&gt;
Reported-by: Vincent Stehlé &lt;vincent.stehle@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Add a command to read all files for a bootflow</title>
<updated>2023-08-11T13:33:38+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-08-11T01:33:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c279224ea6686a992b258b01e07fcadb7f0c7ecb'/>
<id>c279224ea6686a992b258b01e07fcadb7f0c7ecb</id>
<content type='text'>
Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Add private bootmeth data to the bootflow</title>
<updated>2023-08-11T00:34:54+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-07-30T17:16:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=76bd6844dcfeb1a7d2f529c2f715b34f4e574229'/>
<id>76bd6844dcfeb1a7d2f529c2f715b34f4e574229</id>
<content type='text'>
Some bootmeths need to store their own information related to the
bootflow, in addition to the generic information in struct bootflow.
Add a pointer for this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some bootmeths need to store their own information related to the
bootflow, in addition to the generic information in struct bootflow.
Add a pointer for this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Support automatically setting Linux parameters</title>
<updated>2023-07-17T05:38:35+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-07-12T15:04:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=33ebcb468109c40ef0dce262be00a4c161265b90'/>
<id>33ebcb468109c40ef0dce262be00a4c161265b90</id>
<content type='text'>
Some Linux parameters can be set automatically by U-Boot, if it knows the
device being used. For example, since U-Boot knows the serial console
being used, it can add parameters for earlycon and console.

Add support for this.

Note that this is an experimental feature and we will see how useful it
turns out to be. It is very handy for ChromeOS, since otherwise it is very
difficult to manually determine the UART address or port number,
particularly in a script.

Provide an example of how this is used with ChromeOS.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some Linux parameters can be set automatically by U-Boot, if it knows the
device being used. For example, since U-Boot knows the serial console
being used, it can add parameters for earlycon and console.

Add support for this.

Note that this is an experimental feature and we will see how useful it
turns out to be. It is very handy for ChromeOS, since otherwise it is very
difficult to manually determine the UART address or port number,
particularly in a script.

Provide an example of how this is used with ChromeOS.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Add support for updating elements of the cmdline</title>
<updated>2023-07-17T05:38:35+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-07-12T15:04:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=82c0938f1d3befdd7dd1a1bda3b0a02b219abb5d'/>
<id>82c0938f1d3befdd7dd1a1bda3b0a02b219abb5d</id>
<content type='text'>
Add a bootflow command to update the command line more easily. This allows
changing a particular parameter rather than editing a very long strings.
It is also easier to handle with scripting.

The new 'bootflow cmdline' command allows getting and setting single
parameters.

Fix up the example output while we are here, since there are a few new
items.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a bootflow command to update the command line more easily. This allows
changing a particular parameter rather than editing a very long strings.
It is also easier to handle with scripting.

The new 'bootflow cmdline' command allows getting and setting single
parameters.

Fix up the example output while we are here, since there are a few new
items.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
