<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/boot/bootdev-uclass.c, branch v2023.10-rc2</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>boot: fix bootdev_list()</title>
<updated>2023-08-02T18:05:57+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-07-30T14:29:25+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ca9d9263e5214d450e2693b6de297fee74ee753e'/>
<id>ca9d9263e5214d450e2693b6de297fee74ee753e</id>
<content type='text'>
uclass_get_device_by_name() is meant to return 0 or a negative error code.
simple_itoa() cannot handle negative numbers.

This leads to output like:

    =&gt; bootdev list -p

    Seq  Probed  Status  Uclass    Name
    ---  ------  ------  --------  ------------------
      c   [   ]  18446744073709551614  spi_flash spi.bin@0.bootdev

Convert the status to a positive number. Now we get

    Seq  Probed  Status  Uclass    Name
    ---  ------  ------  --------  ------------------
      c   [   ]       2  spi_flash spi.bin@0.bootdev

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
uclass_get_device_by_name() is meant to return 0 or a negative error code.
simple_itoa() cannot handle negative numbers.

This leads to output like:

    =&gt; bootdev list -p

    Seq  Probed  Status  Uclass    Name
    ---  ------  ------  --------  ------------------
      c   [   ]  18446744073709551614  spi_flash spi.bin@0.bootdev

Convert the status to a positive number. Now we get

    Seq  Probed  Status  Uclass    Name
    ---  ------  ------  --------  ------------------
      c   [   ]       2  spi_flash spi.bin@0.bootdev

Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Work around missing partition 1</title>
<updated>2023-05-13T13:52:32+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-04-28T19:18:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=76afc8457eb2f55771d9c9e2ba6106bac43a166b'/>
<id>76afc8457eb2f55771d9c9e2ba6106bac43a166b</id>
<content type='text'>
If there is no partition numbered 1, we decide that there are no
partitions at all. That may not be correct, since at least one Debian
installed has just a single partition numbered 2.

Continue searching up to partition 3, just in case.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If there is no partition numbered 1, we decide that there are no
partitions at all. That may not be correct, since at least one Debian
installed has just a single partition numbered 2.

Continue searching up to partition 3, just in case.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Adjust code ordering to work around compiler quirk</title>
<updated>2023-04-26T12:43:05+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-04-24T01:49:49+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1aabe4ef2b746c9aa76a25787a6aef57a165ca86'/>
<id>1aabe4ef2b746c9aa76a25787a6aef57a165ca86</id>
<content type='text'>
At present when debugging is off, bootdev_find_in_blk() sometimes fails
to find a valid bootflow, e.g. with virtio. Accessing the 'blk' variable
later in the function seems to correct it.

Move the 'ret' check before the debug statement and set the block device
again aftewards, to work around this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At present when debugging is off, bootdev_find_in_blk() sometimes fails
to find a valid bootflow, e.g. with virtio. Accessing the 'blk' variable
later in the function seems to correct it.

Move the 'ret' check before the debug statement and set the block device
again aftewards, to work around this.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Report missing labels only when asked</title>
<updated>2023-04-26T12:43:04+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-04-24T01:49:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1736b4af0e8a30aa3e9d0720c07dfb70fb16dceb'/>
<id>1736b4af0e8a30aa3e9d0720c07dfb70fb16dceb</id>
<content type='text'>
Use the -l flag to indicate whether to report missing uclasses.

Also try to be more helpful when no devices are found. For example, when
we see something 'scsi0' requested and nothing was found, this indicates
that there are no SCSI devices, so show a suitable message.

Move messages out of the low-level functions so that silent operation
is possible.

This means they are never reported unless BOOTSTD_FULL is enabled, since
the -l flag cannot otherwise be set.

Suggested-by: Tom Rini &lt;trini@konsulko.com&gt;

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the -l flag to indicate whether to report missing uclasses.

Also try to be more helpful when no devices are found. For example, when
we see something 'scsi0' requested and nothing was found, this indicates
that there are no SCSI devices, so show a suitable message.

Move messages out of the low-level functions so that silent operation
is possible.

This means they are never reported unless BOOTSTD_FULL is enabled, since
the -l flag cannot otherwise be set.

Suggested-by: Tom Rini &lt;trini@konsulko.com&gt;

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootflow: Rename bootflow_flags_t</title>
<updated>2023-03-08T19:40:49+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-02-22T19:17:03+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=4f806f31fc29b30f06bd13abe44a1d3649d480e5'/>
<id>4f806f31fc29b30f06bd13abe44a1d3649d480e5</id>
<content type='text'>
These flags actually relate to the iterator, not the bootflow struct
itself. Rename them.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These flags actually relate to the iterator, not the bootflow struct
itself. Rename them.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Probe the block device before use</title>
<updated>2023-02-06T18:04:53+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-28T22:00:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=965020c3f7e11a8ee4f53023822d30d43345abde'/>
<id>965020c3f7e11a8ee4f53023822d30d43345abde</id>
<content type='text'>
In some cases the block device is obtained but is not probed, since it
is a sibling of the bootdev. Make sure it is probed, so it can be used
without any trouble.

This fixes a bug with virtio, where the device is accessed before it has
been set up by the virtio uclass.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Fixes: 201417d700a ("bootstd: Add the bootdev uclass")
Reported-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In some cases the block device is obtained but is not probed, since it
is a sibling of the bootdev. Make sure it is probed, so it can be used
without any trouble.

This fixes a bug with virtio, where the device is accessed before it has
been set up by the virtio uclass.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
Fixes: 201417d700a ("bootstd: Add the bootdev uclass")
Reported-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Add a little more logging of bootflows</title>
<updated>2023-01-23T23:11:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:48:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=f738c73a2b0e03840fe5a9540aa84115f20b41e2'/>
<id>f738c73a2b0e03840fe5a9540aa84115f20b41e2</id>
<content type='text'>
Add some logging to aid debugging of problems with bootflows.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add some logging to aid debugging of problems with bootflows.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Allow scanning a single bootdev label</title>
<updated>2023-01-23T23:11:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:48:15+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=91943ff7038f9c47fb310dbc22150b5664c8fbf7'/>
<id>91943ff7038f9c47fb310dbc22150b5664c8fbf7</id>
<content type='text'>
We want to support scanning a single label, like 'mmc' or 'usb0'. Add
this feature by plumbing the label through to the iterator, setting a
flag to indicate that only siblings of the initial device should be used.

This means that scanning a bootdev by its name is not supported anymore.
That feature doesn't seem very useful in practice, so it is no great loss.

Add a test for bootdev_find_by_any() while we are here.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to support scanning a single label, like 'mmc' or 'usb0'. Add
this feature by plumbing the label through to the iterator, setting a
flag to indicate that only siblings of the initial device should be used.

This means that scanning a bootdev by its name is not supported anymore.
That feature doesn't seem very useful in practice, so it is no great loss.

Add a test for bootdev_find_by_any() while we are here.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Switch bootdev scanning to use labels</title>
<updated>2023-01-23T23:11:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:48:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=47aedc29dcb9871e076f6e4aa82004633af513ef'/>
<id>47aedc29dcb9871e076f6e4aa82004633af513ef</id>
<content type='text'>
At present we set up the bootdev order at the start, then scan the
bootdevs one by one.

However this approach cannot be used with hunters, since the bootdevs may
not exist until the hunter is used. Nor can we just run all the hunters at
the start, since that violate's U-Boot's 'lazy init' requirement. It also
increases boot time.

So we need to adjust the algorithm to scan by labels instead. As a first
step, drop the dev_order[] array in favour of a list of labels. Update the
name of bootdev_setup_iter_order() to better reflect what it does.

Update some related comments and log messages. Also disable a few tests
until a later commit where we can use them.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At present we set up the bootdev order at the start, then scan the
bootdevs one by one.

However this approach cannot be used with hunters, since the bootdevs may
not exist until the hunter is used. Nor can we just run all the hunters at
the start, since that violate's U-Boot's 'lazy init' requirement. It also
increases boot time.

So we need to adjust the algorithm to scan by labels instead. As a first
step, drop the dev_order[] array in favour of a list of labels. Update the
name of bootdev_setup_iter_order() to better reflect what it does.

Update some related comments and log messages. Also disable a few tests
until a later commit where we can use them.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bootstd: Allow iterating to the next bootdev priortiy</title>
<updated>2023-01-23T23:11:41+00:00</updated>
<author>
<name>Simon Glass</name>
<email>sjg@chromium.org</email>
</author>
<published>2023-01-17T17:48:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=43e89a306903117c8cb7105004f236acf1ec3d00'/>
<id>43e89a306903117c8cb7105004f236acf1ec3d00</id>
<content type='text'>
Add a function which moves to the next priority to be processed.

This works by storing the current priority in the bootflow iterator. The
logic to set this up is included in a subsequent commit.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a function which moves to the next priority to be processed.

This works by storing the current priority in the bootflow iterator. The
logic to set this up is included in a subsequent commit.

Signed-off-by: Simon Glass &lt;sjg@chromium.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
