uboot: Add the missing disk write operation support

uboot_disk_write() is currently lacking the write support
to storage devices because, historically, those devices did not
implement block_write() in U-Boot.

The solution has been tested using a patched U-Boot loading
and booting GRUB in a QEMU vexpress-a9 environment.
The disk write operations were triggered with GRUB's save_env
command.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Cristian Ciocaltea 2019-01-22 12:02:10 +02:00 committed by Daniel Kiper
parent f8d1ad2678
commit 088f7f56e5
3 changed files with 34 additions and 7 deletions

View file

@ -72,7 +72,8 @@ int EXPORT_FUNC (grub_uboot_dev_enum) (void);
struct device_info * EXPORT_FUNC (grub_uboot_dev_get) (int index);
int EXPORT_FUNC (grub_uboot_dev_open) (struct device_info *dev);
int EXPORT_FUNC (grub_uboot_dev_close) (struct device_info *dev);
int grub_uboot_dev_write (struct device_info *dev, void *buf, int *len);
int grub_uboot_dev_write (struct device_info *dev, const void *buf,
grub_size_t blocks, grub_uint32_t start);
int grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks,
grub_uint32_t start, grub_size_t * real_blocks);
int EXPORT_FUNC (grub_uboot_dev_recv) (struct device_info *dev, void *buf,