bootstd: Add a new bootmeth method to set the bootflow
Normally the bootmeth driver reads the bootflow from the bootdev, since it knows the correct way to do it. However it is easier for some bootdevs to handle this themselves. For example, reading from SPI flash is quite different from other devices. Add a way for the bootdev to pass a bootflow to the bootmeth, so that this can be supported. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -50,6 +50,17 @@ int bootmeth_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
||||
return ops->read_bootflow(dev, bflow);
|
||||
}
|
||||
|
||||
int bootmeth_set_bootflow(struct udevice *dev, struct bootflow *bflow,
|
||||
char *buf, int size)
|
||||
{
|
||||
const struct bootmeth_ops *ops = bootmeth_get_ops(dev);
|
||||
|
||||
if (!ops->set_bootflow)
|
||||
return -ENOSYS;
|
||||
|
||||
return ops->set_bootflow(dev, bflow, buf, size);
|
||||
}
|
||||
|
||||
int bootmeth_boot(struct udevice *dev, struct bootflow *bflow)
|
||||
{
|
||||
const struct bootmeth_ops *ops = bootmeth_get_ops(dev);
|
||||
|
||||
Reference in New Issue
Block a user