x86: Improve bootstd support
Subsystems (8)
v2 cover x86: Improve bootstd support
This series provides some bootstd fixes so that IDE can be used reliably for booting a distro. It also includes some documentation on how to boot from coreboot in various scenarios, using QEMU.
With this it is possible to boot Ubuntu 2023.04 from coreboot64, for example.
Changes in v2:
- Use log_warning() for the warning
- Fix the function name in the header as well
Simon Glass (9):
fs: fat: Support reading from a larger block size
usb: Return -ENOENT when no devices are found
lib: Suppress E when writing error-string output
bootstd: Rename bootdev_setup_sibling_blk()
bootstd: Correct creating of bootdev sibling
bootstd: Add some more debugging in the bootdev uclass
x86: coreboot: Add IDE and SATA
x86: coreboot: Enable standard boot
x86: coreboot: Enable support for CBFS
boot/bootdev-uclass.c | 17 +++-- common/usb_storage.c | 2 +- configs/coreboot64_defconfig | 16 ++--- configs/coreboot_defconfig | 11 ++++ doc/board/coreboot/coreboot.rst | 74 ++++++++++++++++++++-- doc/develop/bootstd.rst | 4 +- drivers/block/ide.c | 4 +- drivers/mmc/mmc-uclass.c | 2 +- drivers/nvme/nvme.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/usb/host/usb-uclass.c | 2 +- drivers/virtio/virtio-uclass.c | 2 +- fs/fat/Kconfig | 13 ++++ fs/fat/fat.c | 107 ++++++++++++++++++++++++++++---- fs/fat/fat_write.c | 8 ++- include/bootdev.h | 10 +-- include/usb.h | 9 ++- lib/vsprintf.c | 5 +- 18 files changed, 238 insertions(+), 52 deletions(-)
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
PATCH v2 1/9 fs: fat: Support reading from a larger block size
At present it is not possible to read from some CDROM drives since the FAT sector size does not match the media's block size. Add a conversion option for this, so that reading is possible.
This does increase SPL size for read-only FAT support by 25 bytes but all but 6 are covered by the previous patch. We could reduce the overhead of this feature to 0 bytes by making the code uglier (using a static variable).
---
Changes in v2:
- Use log_warning() for the warning
fs/fat/Kconfig | 13 ++++++ fs/fat/fat.c | 107 ++++++++++++++++++++++++++++++++++++++++----- fs/fat/fat_write.c | 8 ++-- 3 files changed, 114 insertions(+), 14 deletions(-)
fs/fat/Kconfig +13 -0
@@ -22,3 +22,16 @@ config FS_FAT_MAX_CLUSTSIZE is the smallest amount of disk space that can be used to hold a file. Unless you have an extremely tight memory memory constraints, leave the default. + +config FAT_BLK_XLATE + bool "Enable FAT filesystem on a device with a larger block size" + depends on FS_FAT + help + This provides a simple translation mechanism for reading FAT + filesystems which don't use the same sector size as the underlying + media. For example, the FAT filesystem may use 512 bytes but the + media uses 2048, e.g. on a CDROM drive. + + This only supports the case where the FAT filesystem's sector size is + smaller than the media's block size. It does not support creating or + writing files.
fs/fat/fat.c +96 -11
167 lines not on this page · raw message
fs/fat/fat_write.c +5 -3
@@ -477,7 +477,7 @@ static int set_fatent_value(fsdata *mydata, __u32 entry, __u32 entry_value) startblock += mydata->fat_sect; -if (disk_read (startblock, getsize, bufptr) <0 ) { +if (disk_read (NULL , startblock, getsize, bufptr) <0 ) {debug ("Error reading FAT blocks\n" );return -1 ; }
@@ -712,7 +712,8 @@ get_set_cluster(fsdata *mydata, __u32 clustnum, loff_t pos, __u8 *buffer,/* partial write at beginning */ if (pos) { wsize =min (bytesperclust - pos, size); - ret =disk_read (startsect, mydata->clust_size, tmpbuf_cluster); + ret =disk_read (NULL , startsect, mydata->clust_size, + tmpbuf_cluster);if (ret != mydata->clust_size) {debug ("Error reading data (got %d)\n" , ret);return -1 ;
@@ -778,7 +779,8 @@ get_set_cluster(fsdata *mydata, __u32 clustnum, loff_t pos, __u8 *buffer,/* partial write at end */ if (size) { wsize = size; - ret =disk_read (startsect, mydata->clust_size, tmpbuf_cluster); + ret =disk_read (NULL , startsect, mydata->clust_size, + tmpbuf_cluster);if (ret != mydata->clust_size) {debug ("Error reading data (got %d)\n" , ret);return -1 ;
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 1/9] fs: fat: Support reading from a larger block size
Quoted 13 lines · Simon Glass
At present it is not possible to read from some CDROM drives since the FAT sector size does not match the media's block size. Add a conversion option for this, so that reading is possible.
This does increase SPL size for read-only FAT support by 25 bytes but all but 6 are covered by the previous patch. We could reduce the overhead of this feature to 0 bytes by making the code uglier (using a static variable).
Signed-off-by Simon Glass <[email protected]>---
Quoted 8 lines
Changes in v2:
- Uselog_warning()for the warningfs/fat/Kconfig | 13 ++++++ fs/fat/fat.c | 107 ++++++++++++++++++++++++++++++++++++++++----- fs/fat/fat_write.c | 8 ++-- 3 files changed, 114 insertions(+), 14 deletions(-)
As discussed in another thread [1], this patch will not be accepted due to invalid use case of using -cdrom on isohybrid images.
Regards,
Bin
PATCH v2 2/9 usb: Return -ENOENT when no devices are found
In reply to Simon GlassWhen USB finds no devices it currently returns -EPERM which bootstd does not understand. This causes other bootdevs of the same priority to be skipped.
Fix this by returning the correct error code.
---
(no changes since v1)
drivers/usb/host/usb-uclass.c | 2 +- include/usb.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/usb/host/usb-uclass.c +1 -1
@@ -346,7 +346,7 @@ int usb_init(void)if (controllers_initialized ==0 )printf ("No working controllers found\n" ); -return usb_started ?0 :-1 ; +return usb_started ?0 : -ENOENT ; }int usb_setup_ehci_gadget (struct ehci_ctrl **ctlrp)
include/usb.h +8 -1
@@ -257,7 +257,14 @@ int usb_kbd_deregister(int force);#endif /* routines */ -int usb_init (void );/* initialize the USB Controller */ + +/* +* usb_init() - initialize the USB Controllers +* +* Returns: 0 if OK, -ENOENT if there are no USB devices +*/ +int usb_init (void ); +int usb_stop (void );/* stop the USB Controller */ int usb_detect_change (void );/* detect if a USB device has been (un)plugged */
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 2/9] usb: Return -ENOENT when no devices are found
Quoted 2 lines · Simon Glass
When USB finds no devices it currently returns
-EPERMwhich bootstd does
The code returns -1, not -EPERM
Quoted 38 lines
not understand. This causes other bootdevs of the same priority to be skipped.
Fix this by returning the correct error code.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/usb/host/usb-uclass.c | 2 +- include/usb.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-)drivers/usb/host/usb-uclass.c +1
-1@@ -346,7 +346,7 @@ int usb_init(void)if (controllers_initialized ==0 )printf ("No working controllers found\n" ); -return usb_started ?0 :-1 ; +return usb_started ?0 : -ENOENT ; }int usb_setup_ehci_gadget (struct ehci_ctrl **ctlrp)include/usb.h +2
-1@@ -257,7 +257,14 @@ int usb_kbd_deregister(int force);#endif /* routines */ -int usb_init (void );/* initialize the USB Controller */ + +/*
include/usb.h int usb_kbd_deregister(int force);
Quoted 10 lines
include/usb.h +6
-1+* usb_init() - initialize the USB Controllers +* +* Returns: 0 if OK, -ENOENT if there are no USB devices +*/ +int usb_init (void ); +int usb_stop (void );/* stop the USB Controller */ int usb_detect_change (void );/* detect if a USB device has been (un)plugged */ --
Otherwise,
Re: [PATCH v2 2/9] usb: Return -ENOENT when no devices are found
Hi Bin,
Quoted 6 lines · Bin Meng
Quoted 2 lines · Simon Glass
When USB finds no devices it currently returns
-EPERMwhich bootstd doesThe code returns -1, not
-EPERM
Yes, I mean that -1 is -EPERM.
Regards,
Simon
Quoted 52 lines
Quoted 39 lines
not understand. This causes other bootdevs of the same priority to be skipped.
Fix this by returning the correct error code.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/usb/host/usb-uclass.c | 2 +- include/usb.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-)drivers/usb/host/usb-uclass.c +1
-1@@ -346,7 +346,7 @@ int usb_init(void)if (controllers_initialized ==0 )printf ("No working controllers found\n" ); -return usb_started ?0 :-1 ; +return usb_started ?0 : -ENOENT ; }int usb_setup_ehci_gadget (struct ehci_ctrl **ctlrp)include/usb.h +2
-1@@ -257,7 +257,14 @@ int usb_kbd_deregister(int force);#endif /* routines */ -int usb_init (void );/* initialize the USB Controller */ + +/* include/usb.h int usb_kbd_deregister(int force);
Quoted 10 lines
include/usb.h +6
-1+* usb_init() - initialize the USB Controllers +* +* Returns: 0 if OK, -ENOENT if there are no USB devices +*/ +int usb_init (void ); +int usb_stop (void );/* stop the USB Controller */ int usb_detect_change (void );/* detect if a USB device has been (un)plugged */ --Otherwise,
Reviewed-by Bin Meng <[email protected]>
Re: [PATCH v2 2/9] usb: Return -ENOENT when no devices are found
In reply to Bin MengQuoted 54 lines · Bin Meng
Quoted 2 lines · Simon Glass
When USB finds no devices it currently returns
-EPERMwhich bootstd doesThe code returns -1, not
-EPERMQuoted 47 lines
not understand. This causes other bootdevs of the same priority to be skipped.
Fix this by returning the correct error code.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/usb/host/usb-uclass.c | 2 +- include/usb.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-)drivers/usb/host/usb-uclass.c +1
-1@@ -346,7 +346,7 @@ int usb_init(void)if (controllers_initialized ==0 )printf ("No working controllers found\n" ); -return usb_started ?0 :-1 ; +return usb_started ?0 : -ENOENT ; }int usb_setup_ehci_gadget (struct ehci_ctrl **ctlrp)include/usb.h +8
-1@@ -257,7 +257,14 @@ int usb_kbd_deregister(int force);#endif /* routines */ -int usb_init (void );/* initialize the USB Controller */ + +/* +* usb_init() - initialize the USB Controllers +* +* Returns: 0 if OK, -ENOENT if there are no USB devices +*/ +int usb_init (void ); +int usb_stop (void );/* stop the USB Controller */ int usb_detect_change (void );/* detect if a USB device has been (un)plugged */
Quoted 4 lines
Quoted 1 line
--
Otherwise,
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 3/9 lib: Suppress E when writing error-string output
In reply to Simon GlassWhen CONFIG_ERRNO_STR is not enabled this shows a spurious 'E' from the format string. Fix this.
---
(no changes since v1)
lib/vsprintf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
lib/vsprintf.c +3 -2
@@ -680,8 +680,10 @@ repeat:break ;case 'd' : -if (fmt[1 ] =='E' ) +if (fmt[1 ] =='E' ) { flags |=ERRSTR ; + fmt++; + }/* fallthrough */ case 'i' : flags |=SIGN ;
@@ -725,7 +727,6 @@ repeat:ADDCH (str,' ' );for (p =errno_str (num); *p; p++)ADDCH (str, *p); - fmt++; } }
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 3/9] lib: Suppress E when writing error-string output
Quoted 4 lines · Simon Glass
When
CONFIG_ERRNO_STRis not enabled this shows a spurious 'E' from the format string. Fix this.
Quoted 9 lines
Signed-off-by Simon Glass <[email protected]>Fixes 7f331941321 ("lib: Support printing an error string")---
(no changes since v1)
lib/vsprintf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Re: [PATCH v2 3/9] lib: Suppress E when writing error-string output
Quoted 10 lines · Bin Meng
Quoted 8 lines · Simon Glass
When
CONFIG_ERRNO_STRis not enabled this shows a spurious 'E' from the format string. Fix this.Signed-off-by Simon Glass <[email protected]>Fixes 7f331941321 ("lib: Support printing an error string")---
Quoted 7 lines
Quoted 5 lines
(no changes since v1)
lib/vsprintf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 4/9 bootstd: Rename bootdev_setup_sibling_blk()
In reply to Simon GlassThis name is a little confusing since it suggests that it sets up the sibling block device. In fact it sets up a bootdev for it. Rename the function to make this clearer.
---
Changes in v2:
- Fix the function name in the header as well
boot/bootdev-uclass.c | 8 +++++--- common/usb_storage.c | 2 +- doc/develop/bootstd.rst | 4 ++-- drivers/mmc/mmc-uclass.c | 2 +- drivers/nvme/nvme.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/virtio/virtio-uclass.c | 2 +- include/bootdev.h | 10 +++++----- 8 files changed, 17 insertions(+), 15 deletions(-)
boot/bootdev-uclass.c +5 -3
@@ -262,7 +262,7 @@ static int bootdev_get_suffix_start(struct udevice *dev, const char *suffix)return len; } -int bootdev_setup_sibling_blk (struct udevice *blk,const char *drv_name) +int bootdev_setup_for_sibling_blk (struct udevice *blk,const char *drv_name) {struct udevice *parent, *dev;char dev_name[50 ];
@@ -305,7 +305,9 @@ int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp)if (device_get_uclass_id (dev) !=UCLASS_BOOTDEV )return -EINVAL ; -/* This should always work if bootdev_setup_sibling_blk() was used */ +/* +* This should always work if bootdev_setup_for_sibling_blk() was used +*/ len =bootdev_get_suffix_start (dev,".bootdev" ); ret =device_find_child_by_namelen (parent, dev->name, len, &blk);if (ret) {
@@ -335,7 +337,7 @@ static int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp)if (device_get_uclass_id (blk) !=UCLASS_BLK )return -EINVAL ; -/* This should always work if bootdev_setup_sibling_blk() was used */ +/* This should always work if bootdev_setup_for_sibling_blk() was used */ len =bootdev_get_suffix_start (blk,".blk" );snprintf (dev_name,sizeof (dev_name),"%.*s.%s" , len, blk->name,"bootdev" );
common/usb_storage.c +1 -1
@@ -246,7 +246,7 @@ static int usb_stor_probe_device(struct usb_device *udev)if (ret)return ret; - ret =bootdev_setup_sibling_blk (dev,"usb_bootdev" ); + ret =bootdev_setup_for_sibling_blk (dev,"usb_bootdev" );if (ret) {int ret2;
doc/develop/bootstd.rst +2 -2
@@ -306,7 +306,7 @@ media device:: The bootdev device is typically created automatically in the media uclass' `post_bind()` method by calling `bootdev_setup_for_dev()` or -`bootdev_setup_sibling_blk()`. The code typically something like this:: +`bootdev_setup_for_sibling_blk()`. The code typically something like this:: /* dev is the Ethernet device */ ret = bootdev_setup_for_dev(dev, "eth_bootdev");
@@ -316,7 +316,7 @@ The bootdev device is typically created automatically in the media uclass' or:: /* blk is the block device (child of MMC device) - ret = bootdev_setup_sibling_blk(blk, "mmc_bootdev"); + ret = bootdev_setup_for_sibling_blk(blk, "mmc_bootdev"); if (ret) return log_msg_ret("bootdev", ret);
drivers/mmc/mmc-uclass.c +1 -1
@@ -421,7 +421,7 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) mmc->cfg = cfg; mmc->priv = dev; - ret =bootdev_setup_sibling_blk (bdev,"mmc_bootdev" ); + ret =bootdev_setup_for_sibling_blk (bdev,"mmc_bootdev" );if (ret)return log_msg_ret ("bootdev" , ret);
drivers/nvme/nvme.c +1 -1
@@ -910,7 +910,7 @@ int nvme_init(struct udevice *udev)if (ret) goto free_id; - ret =bootdev_setup_sibling_blk (ns_udev,"nvme_bootdev" ); + ret =bootdev_setup_for_sibling_blk (ns_udev,"nvme_bootdev" );if (ret)return log_msg_ret ("bootdev" , ret);
drivers/scsi/scsi.c +1 -1
@@ -607,7 +607,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)/* TODO: undo create */ return log_msg_ret ("pro" , ret); - ret =bootdev_setup_sibling_blk (bdev,"scsi_bootdev" ); + ret =bootdev_setup_for_sibling_blk (bdev,"scsi_bootdev" );if (ret)return log_msg_ret ("bd" , ret);
drivers/virtio/virtio-uclass.c +1 -1
@@ -248,7 +248,7 @@ static int virtio_uclass_post_probe(struct udevice *udev)device_set_name_alloced (vdev);if (uc_priv->device ==VIRTIO_ID_BLOCK && !IS_ENABLED (CONFIG_SANDBOX )) { - ret =bootdev_setup_sibling_blk (vdev,"virtio_bootdev" ); + ret =bootdev_setup_for_sibling_blk (vdev,"virtio_bootdev" );if (ret)return log_msg_ret ("bootdev" , ret); }
include/bootdev.h +5 -5
@@ -371,7 +371,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp);/** * bootdev_setup_for_dev() - Bind a new bootdev device (deprecated) * -* Please use bootdev_setup_sibling_blk() instead since it supports multiple +* Please use bootdev_setup_for_sibling_blk() instead since it supports multiple * (child) block devices for each media device. * * Creates a bootdev device as a child of @parent. This should be called from
@@ -386,7 +386,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp);int bootdev_setup_for_dev (struct udevice *parent,const char *drv_name);/** -* bootdev_setup_for_blk() - Bind a new bootdev device for a blk device +* bootdev_setup_for_sibling_blk() - Bind a new bootdev device for a blk device * * Creates a bootdev device as a sibling of @blk. This should be called from * the driver's bind() method or its uclass' post_bind() method, at the same
@@ -398,7 +398,7 @@ int bootdev_setup_for_dev(struct udevice *parent, const char *drv_name);* @drv_name: Name of bootdev driver to bind * Return: 0 if OK, -ve on error */ -int bootdev_setup_sibling_blk (struct udevice *blk,const char *drv_name); +int bootdev_setup_for_sibling_blk (struct udevice *blk,const char *drv_name);/** * bootdev_get_sibling_blk() - Locate the block device for a bootdev
@@ -428,8 +428,8 @@ static inline int bootdev_setup_for_dev(struct udevice *parent,return 0 ; } -static inline int bootdev_setup_sibling_blk (struct udevice *blk, -const char *drv_name) +static inline int bootdev_setup_for_sibling_blk (struct udevice *blk, +const char *drv_name) {return 0 ; }
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 4/9] bootstd: Rename bootdev_setup_sibling_blk()
Quoted 11 lines · Simon Glass
This name is a little confusing since it suggests that it sets up the sibling block device. In fact it sets up a bootdev for it. Rename the function to make this clearer.
Signed-off-by Simon Glass <[email protected]>---
Changes in v2:
- Fix the function name in the header as well
Quoted 10 lines
boot/bootdev-uclass.c | 8 +++++--- common/usb_storage.c | 2 +- doc/develop/bootstd.rst | 4 ++-- drivers/mmc/mmc-uclass.c | 2 +- drivers/nvme/nvme.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/virtio/virtio-uclass.c | 2 +- include/bootdev.h | 10 +++++----- 8 files changed, 17 insertions(+), 15 deletions(-)
Re: [PATCH v2 4/9] bootstd: Rename bootdev_setup_sibling_blk()
In reply to Simon GlassQuoted 5 lines · Simon Glass
This name is a little confusing since it suggests that it sets up the sibling block device. In fact it sets up a bootdev for it. Rename the function to make this clearer.
Signed-off-by Simon Glass <[email protected]>
Quoted 179 lines
---
Changes in v2:
- Fix the function name in the header as wellboot/bootdev-uclass.c | 8 +++++--- common/usb_storage.c | 2 +- doc/develop/bootstd.rst | 4 ++-- drivers/mmc/mmc-uclass.c | 2 +- drivers/nvme/nvme.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/virtio/virtio-uclass.c | 2 +- include/bootdev.h | 10 +++++----- 8 files changed, 17 insertions(+), 15 deletions(-)boot/bootdev-uclass.c +5
-3@@ -262,7 +262,7 @@ static int bootdev_get_suffix_start(struct udevice *dev, const char *suffix)return len; } -int bootdev_setup_sibling_blk (struct udevice *blk,const char *drv_name) +int bootdev_setup_for_sibling_blk (struct udevice *blk,const char *drv_name) {struct udevice *parent, *dev;char dev_name[50 ];@@ -305,7 +305,9 @@ int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp)if (device_get_uclass_id (dev) !=UCLASS_BOOTDEV )return -EINVAL ; -/* This should always work if bootdev_setup_sibling_blk() was used */ +/* +* This should always work if bootdev_setup_for_sibling_blk() was used +*/ len =bootdev_get_suffix_start (dev,".bootdev" ); ret =device_find_child_by_namelen (parent, dev->name, len, &blk);if (ret) {@@ -335,7 +337,7 @@ static int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp)if (device_get_uclass_id (blk) !=UCLASS_BLK )return -EINVAL ; -/* This should always work if bootdev_setup_sibling_blk() was used */ +/* This should always work if bootdev_setup_for_sibling_blk() was used */ len =bootdev_get_suffix_start (blk,".blk" );snprintf (dev_name,sizeof (dev_name),"%.*s.%s" , len, blk->name,"bootdev" );common/usb_storage.c +1
-1@@ -246,7 +246,7 @@ static int usb_stor_probe_device(struct usb_device *udev)if (ret)return ret; - ret =bootdev_setup_sibling_blk (dev,"usb_bootdev" ); + ret =bootdev_setup_for_sibling_blk (dev,"usb_bootdev" );if (ret) {int ret2;doc/develop/bootstd.rst +2
-2@@ -306,7 +306,7 @@ media device:: The bootdev device is typically created automatically in the media uclass' `post_bind()` method by calling `bootdev_setup_for_dev()` or -`bootdev_setup_sibling_blk()`. The code typically something like this:: +`bootdev_setup_for_sibling_blk()`. The code typically something like this:: /* dev is the Ethernet device */ ret = bootdev_setup_for_dev(dev, "eth_bootdev");@@ -316,7 +316,7 @@ The bootdev device is typically created automatically in the media uclass' or:: /* blk is the block device (child of MMC device) - ret = bootdev_setup_sibling_blk(blk, "mmc_bootdev"); + ret = bootdev_setup_for_sibling_blk(blk, "mmc_bootdev"); if (ret) return log_msg_ret("bootdev", ret);drivers/mmc/mmc-uclass.c +1
-1@@ -421,7 +421,7 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) mmc->cfg = cfg; mmc->priv = dev; - ret =bootdev_setup_sibling_blk (bdev,"mmc_bootdev" ); + ret =bootdev_setup_for_sibling_blk (bdev,"mmc_bootdev" );if (ret)return log_msg_ret ("bootdev" , ret);drivers/nvme/nvme.c +1
-1@@ -910,7 +910,7 @@ int nvme_init(struct udevice *udev)if (ret) goto free_id; - ret =bootdev_setup_sibling_blk (ns_udev,"nvme_bootdev" ); + ret =bootdev_setup_for_sibling_blk (ns_udev,"nvme_bootdev" );if (ret)return log_msg_ret ("bootdev" , ret);drivers/scsi/scsi.c +1
-1@@ -607,7 +607,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)/* TODO: undo create */ return log_msg_ret ("pro" , ret); - ret =bootdev_setup_sibling_blk (bdev,"scsi_bootdev" ); + ret =bootdev_setup_for_sibling_blk (bdev,"scsi_bootdev" );if (ret)return log_msg_ret ("bd" , ret);drivers/virtio/virtio-uclass.c +1
-1@@ -248,7 +248,7 @@ static int virtio_uclass_post_probe(struct udevice *udev)device_set_name_alloced (vdev);if (uc_priv->device ==VIRTIO_ID_BLOCK && !IS_ENABLED (CONFIG_SANDBOX )) { - ret =bootdev_setup_sibling_blk (vdev,"virtio_bootdev" ); + ret =bootdev_setup_for_sibling_blk (vdev,"virtio_bootdev" );if (ret)return log_msg_ret ("bootdev" , ret); }include/bootdev.h +5
-5@@ -371,7 +371,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp);/** * bootdev_setup_for_dev() - Bind a new bootdev device (deprecated) * -* Please use bootdev_setup_sibling_blk() instead since it supports multiple +* Please use bootdev_setup_for_sibling_blk() instead since it supports multiple * (child) block devices for each media device. * * Creates a bootdev device as a child of @parent. This should be called from @@ -386,7 +386,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp);int bootdev_setup_for_dev (struct udevice *parent,const char *drv_name);/** -* bootdev_setup_for_blk() - Bind a new bootdev device for a blk device +* bootdev_setup_for_sibling_blk() - Bind a new bootdev device for a blk device * * Creates a bootdev device as a sibling of @blk. This should be called from * the driver's bind() method or its uclass' post_bind() method, at the same @@ -398,7 +398,7 @@ int bootdev_setup_for_dev(struct udevice *parent, const char *drv_name);* @drv_name: Name of bootdev driver to bind * Return: 0 if OK, -ve on error */ -int bootdev_setup_sibling_blk (struct udevice *blk,const char *drv_name); +int bootdev_setup_for_sibling_blk (struct udevice *blk,const char *drv_name);/** * bootdev_get_sibling_blk() - Locate the block device for a bootdev @@ -428,8 +428,8 @@ static inline int bootdev_setup_for_dev(struct udevice *parent,return 0 ; } -static inline int bootdev_setup_sibling_blk (struct udevice *blk, -const char *drv_name) +static inline int bootdev_setup_for_sibling_blk (struct udevice *blk, +const char *drv_name) {return 0 ; }Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 4/9] bootstd: Rename bootdev_setup_sibling_blk()
Quoted 16 lines · Mattijs Korpershoek
Quoted 5 lines · Simon Glass
This name is a little confusing since it suggests that it sets up the sibling block device. In fact it sets up a bootdev for it. Rename the function to make this clearer.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Mattijs Korpershoek <[email protected]>Quoted 5 lines
---
Changes in v2:
- Fix the function name in the header as well
applied to u-boot-x86, thanks!
PATCH v2 5/9 bootstd: Correct creating of bootdev sibling
In reply to Simon GlassUse the correct function here, since there may be multiple IDE devices available.
---
(no changes since v1)
drivers/block/ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/ide.c +2 -2
@@ -1059,9 +1059,9 @@ static int ide_probe(struct udevice *udev) desc->lba48 = pdesc.lba48; desc->type = pdesc.type; - ret =bootdev_setup_for_dev (udev,"ide_bootdev" ); + ret =bootdev_setup_for_sibling_blk (blk,"ide_bootdev" );if (ret) -return log_msg_ret ("bootdev" , ret); +return log_msg_ret ("bd" , ret); }return 0 ;
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 5/9] bootstd: Correct creating of bootdev sibling
Hi Simon,
Quoted 18 lines · Simon Glass
Use the correct function here, since there may be multiple IDE devices available.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Mattijs Korpershoek <[email protected]>---
(no changes since v1)
drivers/block/ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/ide.c +0
-0
drivers/block/ide.c static int ide_probe(struct udevice *udev) · line 1064
Quoted 8 lines
drivers/block/ide.c +2
-2@@ -1059,9 +1059,9 @@ static int ide_probe(struct udevice *udev) desc->lba48 = pdesc.lba48; desc->type = pdesc.type; - ret =bootdev_setup_for_dev (udev,"ide_bootdev" ); + ret =bootdev_setup_for_sibling_blk (blk,"ide_bootdev" );if (ret) -return log_msg_ret ("bootdev" , ret); +return log_msg_ret ("bd" , ret);
Why changes from bootdev to bd here? To me, bd is unclear, and sounds like "boardinfo" in U-Boot.
drivers/block/ide.c static int ide_probe(struct udevice *udev)
Quoted 4 lines
drivers/block/ide.c +0
-1}return 0 ; --
Regards,
Bin
Re: [PATCH v2 5/9] bootstd: Correct creating of bootdev sibling
Hi Bin,
Quoted 34 lines · Bin Meng
Hi Simon,
Quoted 7 lines · Simon Glass
} return 0;--
Regards,
BinQuoted 20 lines
Use the correct function here, since there may be multiple IDE devices available.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Mattijs Korpershoek <[email protected]>---
(no changes since v1)
drivers/block/ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/ide.c +0
-0@@ -1059,9 +1059,9 @@ static int ide_probe(struct udevice *udev) desc->lba48 = pdesc.lba48; desc->type = pdesc.type;
Quoted 8 lines
drivers/block/ide.c static int ide_probe(struct udevice *udev) · line 1064
Quoted 5 lines
drivers/block/ide.c +2
-2- ret =bootdev_setup_for_dev (udev,"ide_bootdev" ); + ret =bootdev_setup_for_sibling_blk (blk,"ide_bootdev" );if (ret) -return log_msg_ret ("bootdev" , ret); +return log_msg_ret ("bd" , ret);Why changes from bootdev to bd here? To me, bd is unclear, and sounds like "boardinfo" in U-Boot.
I don't need to...the goal is to have the strings be 4 bytes or less, so they don't use up too much space in the image...but also have them unique enough that you can look at the function and see which call site failed.
For this one, I don't mind either way.
Regards,
Simon
Re: [PATCH v2 5/9] bootstd: Correct creating of bootdev sibling
Hi Simon,
Quoted 47 lines · Simon Glass
Hi Bin,
Quoted 34 lines · Bin Meng
Hi Simon,
Quoted 7 lines · Simon Glass
} return 0;--
Regards,
BinQuoted 20 lines
Use the correct function here, since there may be multiple IDE devices available.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Mattijs Korpershoek <[email protected]>---
(no changes since v1)
drivers/block/ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/ide.c +0
-0@@ -1059,9 +1059,9 @@ static int ide_probe(struct udevice *udev) desc->lba48 = pdesc.lba48; desc->type = pdesc.type;Quoted 8 lines
drivers/block/ide.c static int ide_probe(struct udevice *udev) · line 1064
Quoted 5 lines
drivers/block/ide.c +2
-2- ret =bootdev_setup_for_dev (udev,"ide_bootdev" ); + ret =bootdev_setup_for_sibling_blk (blk,"ide_bootdev" );if (ret) -return log_msg_ret ("bootdev" , ret); +return log_msg_ret ("bd" , ret);Why changes from bootdev to bd here? To me, bd is unclear, and sounds like "boardinfo" in U-Boot.
Quoted 4 lines
I don't need to...the goal is to have the strings be 4 bytes or less, so they don't use up too much space in the image...but also have them unique enough that you can look at the function and see which call site failed.
I see the needs of saving size in TPL, or maybe SPL, but not everywhere, right?
Quoted 2 lines
For this one, I don't mind either way.
Regards,
Bin
Re: [PATCH v2 5/9] bootstd: Correct creating of bootdev sibling
Hi Bin,
Quoted 51 lines · Bin Meng
Hi Simon,
Quoted 47 lines · Simon Glass
Hi Bin,
Quoted 42 lines · Bin Meng
Hi Simon,
Quoted 7 lines · Simon Glass
} return 0;--
Regards,
BinQuoted 17 lines
Use the correct function here, since there may be multiple IDE devices available.
Signed-off-by Simon Glass <[email protected]>Reviewed-by Mattijs Korpershoek <[email protected]>---
(no changes since v1)
drivers/block/ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/ide.c +0
-0drivers/block/ide.c static int ide_probe(struct udevice *udev) · line 1064
Quoted 8 lines
drivers/block/ide.c +2
-2@@ -1059,9 +1059,9 @@ static int ide_probe(struct udevice *udev) desc->lba48 = pdesc.lba48; desc->type = pdesc.type; - ret =bootdev_setup_for_dev (udev,"ide_bootdev" ); + ret =bootdev_setup_for_sibling_blk (blk,"ide_bootdev" );if (ret) -return log_msg_ret ("bootdev" , ret); +return log_msg_ret ("bd" , ret);Why changes from bootdev to bd here? To me, bd is unclear, and sounds like "boardinfo" in U-Boot.
Quoted 6 lines
Quoted 4 lines
I don't need to...the goal is to have the strings be 4 bytes or less, so they don't use up too much space in the image...but also have them unique enough that you can look at the function and see which call site failed.
I see the needs of saving size in TPL, or maybe SPL, but not everywhere, right?
The thing is, we only have one knob to control this - CONFIG_LOG_ERROR_RETURN
When you enable it, all of the log_msg_ret() calls in U-Boot produce a string. So there is quite a big impact.
For example, on coral, the text size increases by about 35KB. So it is about a 6% increase. If it gets to much then it might not fit, or it might cause other prolbems. For example, we have fixed-size regions in binman for U-Boot.
Regards,
Simon
Quoted 3 lines
Quoted 3 lines
For this one, I don't mind either way.
Regards,
Simon
Re: [PATCH v2 5/9] bootstd: Correct creating of bootdev sibling
In reply to Simon GlassQuoted 4 lines · Simon Glass
Use the correct function here, since there may be multiple IDE devices available.
Quoted 9 lines
Signed-off-by Simon Glass <[email protected]>Reviewed-by Mattijs Korpershoek <[email protected]>---
(no changes since v1)
drivers/block/ide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
applied to u-boot-x86, thanks!
PATCH v2 6/9 bootstd: Add some more debugging in the bootdev uclass
In reply to Simon GlassAdd some more output to make it easier to see what is going wrong when a bootdev hunter fails.
---
(no changes since v1)
boot/bootdev-uclass.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
boot/bootdev-uclass.c +8 -1
@@ -537,6 +537,8 @@ static int default_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,int ret; ret =bootdev_get_sibling_blk (dev, &blk); +log_debug ("sibling_blk ret=%d, blk=%s\n" , ret, + ret ?"(none)" : blk->name);/* * If there is no media, indicate that no more partitions should be * checked
@@ -662,7 +664,8 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp) ret =bootdev_hunt_prio (iter->cur_prio, iter->flags &BOOTFLOWIF_SHOW ); -log_debug ("- hunt ret %d\n" , ret); +log_debug ("- bootdev_hunt_prio() ret %d\n" , + ret);if (ret)return log_msg_ret ("hun" , ret); }
@@ -698,6 +701,7 @@ int bootdev_setup_iter(struct bootflow_iter *iter, const char *label,/* hunt for any pre-scan devices */ if (iter->flags &BOOTFLOWIF_HUNT ) { ret =bootdev_hunt_prio (BOOTDEVP_1_PRE_SCAN , show); +log_debug ("- bootdev_hunt_prio() ret %d\n" , ret);if (ret)return log_msg_ret ("pre" , ret); }
@@ -768,6 +772,7 @@ static int bootdev_hunt_drv(struct bootdev_hunter *info, uint seq, bool show)log_debug ("Hunting with: %s\n" , name);if (info->hunt) { ret = info->hunt (info, show); +log_debug (" - hunt result %d\n" , ret);if (ret)return ret; }
@@ -833,9 +838,11 @@ int bootdev_hunt_prio(enum bootdev_prio_t prio, bool show)if (prio != info->prio)continue ; ret =bootdev_hunt_drv (info, i, show); +log_debug ("bootdev_hunt_drv() return %d\n" , ret);if (ret && ret != -ENOENT ) result = ret; } +log_debug ("exit %d\n" , result);return result; }
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 6/9] bootstd: Add some more debugging in the bootdev uclass
Quoted 4 lines · Simon Glass
Add some more output to make it easier to see what is going wrong when a bootdev hunter fails.
Quoted 8 lines
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
boot/bootdev-uclass.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Re: [PATCH v2 6/9] bootstd: Add some more debugging in the bootdev uclass
Quoted 9 lines · Bin Meng
Quoted 7 lines · Simon Glass
Add some more output to make it easier to see what is going wrong when a bootdev hunter fails.
Signed-off-by Simon Glass <[email protected]>---
Quoted 7 lines
Quoted 5 lines
(no changes since v1)
boot/bootdev-uclass.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
PATCH v2 7/9 x86: coreboot: Add IDE and SATA
In reply to Simon GlassAdd these options to permit access to more disk types.
Add some documentation as well.
---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 9 +++++++++ doc/board/coreboot/coreboot.rst | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+)
configs/coreboot64_defconfig +1 -0
@@ -26,6 +26,7 @@ CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y
configs/coreboot_defconfig +9 -0
@@ -22,8 +22,10 @@ CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y +CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y
@@ -48,6 +50,13 @@ CONFIG_USE_ROOTPATH=y CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_ACPIGEN is not set +CONFIG_SYS_IDE_MAXDEVICE=4 +CONFIG_SYS_ATA_DATA_OFFSET=0 +CONFIG_SYS_ATA_REG_OFFSET=0 +CONFIG_SYS_ATA_ALT_OFFSET=0 +CONFIG_ATAPI=y +CONFIG_LBA48=y +CONFIG_SYS_64BIT_LBA=y CONFIG_NVME_PCI=y # CONFIG_PCI_PNP is not set CONFIG_SOUND=y
doc/board/coreboot/coreboot.rst +20 -0
@@ -41,6 +41,26 @@ At present it seems that for Minnowboard Max, coreboot does not pass through the video information correctly (it always says the resolution is 0x0). This works correctly for link though. +You can run via QEMU using:: + + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio + +The `-serial mon:stdio` part shows both output in the display and on the +console. It is optional. You can add `nographic` as well to *only* get console +output. + +To run with a SATA drive called `$DISK`:: + + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio \ + -drive id=disk,file=$DISK,if=none \ + -device ahci,id=ahci \ + -device ide-hd,drive=disk,bus=ahci.0 + +Then you can scan it with `scsi scan` and access it normally. + +To use 4GB of memory, typically necessary for booting Linux distros, add +`-m 4GB`. + 64-bit U-Boot -------------
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 7/9] x86: coreboot: Add IDE and SATA
Hi Simon,
Quoted 63 lines · Simon Glass
Add these options to permit access to more disk types.
Add some documentation as well.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 9 +++++++++ doc/board/coreboot/coreboot.rst | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+)configs/coreboot64_defconfig +1
-0@@ -26,6 +26,7 @@ CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=yconfigs/coreboot_defconfig +9
-0@@ -22,8 +22,10 @@ CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y +CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y@@ -48,6 +50,13 @@ CONFIG_USE_ROOTPATH=y CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_ACPIGEN is not set +CONFIG_SYS_IDE_MAXDEVICE=4 +CONFIG_SYS_ATA_DATA_OFFSET=0 +CONFIG_SYS_ATA_REG_OFFSET=0 +CONFIG_SYS_ATA_ALT_OFFSET=0 +CONFIG_ATAPI=y +CONFIG_LBA48=y +CONFIG_SYS_64BIT_LBA=y CONFIG_NVME_PCI=y # CONFIG_PCI_PNP is not set CONFIG_SOUND=ydoc/board/coreboot/coreboot.rst +0
-0@@ -41,6 +41,26 @@ At present it seems that for Minnowboard Max, coreboot does not pass through the video information correctly (it always says the resolution is 0x0). This works correctly for link though.
doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through · line 52
Quoted 10 lines
doc/board/coreboot/coreboot.rst +9
-0+You can run via QEMU using:: + + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio + +The `-serial mon:stdio` part shows both output in the display and on the +console. It is optional. You can add `nographic` as well to *only* get console +output. + +To run with a SATA drive called `$DISK`::
It is unclear what this is. It should clearly say this is the disk image file?
doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through · line 57
Quoted 5 lines
doc/board/coreboot/coreboot.rst +5
-0+ + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio \ + -drive id=disk,file=$DISK,if=none \ + -device ahci,id=ahci \ + -device ide-hd,drive=disk,bus=ahci.0
Can we use AHCI directly, instead of the legacy IDE driver?
doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through
Quoted 10 lines
doc/board/coreboot/coreboot.rst +6
-1+ +Then you can scan it with `scsi scan` and access it normally. + +To use 4GB of memory, typically necessary for booting Linux distros, add +`-m 4GB`. + 64-bit U-Boot ------------- --
Regards,
Bin
Re: [PATCH v2 7/9] x86: coreboot: Add IDE and SATA
Hi Bin,
Quoted 80 lines · Bin Meng
Hi Simon,
Quoted 63 lines · Simon Glass
Add these options to permit access to more disk types.
Add some documentation as well.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 9 +++++++++ doc/board/coreboot/coreboot.rst | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+)configs/coreboot64_defconfig +1
-0@@ -26,6 +26,7 @@ CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=yconfigs/coreboot_defconfig +9
-0@@ -22,8 +22,10 @@ CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y +CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y@@ -48,6 +50,13 @@ CONFIG_USE_ROOTPATH=y CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_ACPIGEN is not set +CONFIG_SYS_IDE_MAXDEVICE=4 +CONFIG_SYS_ATA_DATA_OFFSET=0 +CONFIG_SYS_ATA_REG_OFFSET=0 +CONFIG_SYS_ATA_ALT_OFFSET=0 +CONFIG_ATAPI=y +CONFIG_LBA48=y +CONFIG_SYS_64BIT_LBA=y CONFIG_NVME_PCI=y # CONFIG_PCI_PNP is not set CONFIG_SOUND=ydoc/board/coreboot/coreboot.rst +0
-0@@ -41,6 +41,26 @@ At present it seems that for Minnowboard Max, coreboot does not pass through the video information correctly (it always says the resolution is 0x0). This works correctly for link though.doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through · line 52
Quoted 10 lines
doc/board/coreboot/coreboot.rst +9
-0+You can run via QEMU using:: + + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio + +The `-serial mon:stdio` part shows both output in the display and on the +console. It is optional. You can add `nographic` as well to *only* get console +output. + +To run with a SATA drive called `$DISK`::It is unclear what this is. It should clearly say this is the disk image file?
Quoted 8 lines
doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through · line 57
Quoted 5 lines
doc/board/coreboot/coreboot.rst +5
-0+ + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio \ + -drive id=disk,file=$DISK,if=none \ + -device ahci,id=ahci \ + -device ide-hd,drive=disk,bus=ahci.0Can we use AHCI directly, instead of the legacy IDE driver?
Probably...do you know the QEMU incantation for that?
Quoted 11 lines
doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through
Quoted 10 lines
doc/board/coreboot/coreboot.rst +6
-1+ +Then you can scan it with `scsi scan` and access it normally. + +To use 4GB of memory, typically necessary for booting Linux distros, add +`-m 4GB`. + 64-bit U-Boot ------------- --
Regards,
Simon
Re: [PATCH v2 7/9] x86: coreboot: Add IDE and SATA
Hi Simon,
Quoted 90 lines · Simon Glass
Hi Bin,
Quoted 86 lines · Bin Meng
Hi Simon,
Quoted 63 lines · Simon Glass
Add these options to permit access to more disk types.
Add some documentation as well.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 9 +++++++++ doc/board/coreboot/coreboot.rst | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+)configs/coreboot64_defconfig +1
-0@@ -26,6 +26,7 @@ CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=yconfigs/coreboot_defconfig +9
-0@@ -22,8 +22,10 @@ CONFIG_LOGF_FUNC=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y CONFIG_PCI_INIT_R=y +CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y CONFIG_CMD_PART=y +CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_DHCP=y@@ -48,6 +50,13 @@ CONFIG_USE_ROOTPATH=y CONFIG_REGMAP=y CONFIG_SYSCON=y # CONFIG_ACPIGEN is not set +CONFIG_SYS_IDE_MAXDEVICE=4 +CONFIG_SYS_ATA_DATA_OFFSET=0 +CONFIG_SYS_ATA_REG_OFFSET=0 +CONFIG_SYS_ATA_ALT_OFFSET=0 +CONFIG_ATAPI=y +CONFIG_LBA48=y +CONFIG_SYS_64BIT_LBA=y CONFIG_NVME_PCI=y # CONFIG_PCI_PNP is not set CONFIG_SOUND=ydoc/board/coreboot/coreboot.rst +0
-0@@ -41,6 +41,26 @@ At present it seems that for Minnowboard Max, coreboot does not pass through the video information correctly (it always says the resolution is 0x0). This works correctly for link though.doc/board/coreboot/coreboot.rst At present it seems that for Minnowboard Max, coreboot does not pass through · line 52
Quoted 10 lines
doc/board/coreboot/coreboot.rst +9
-0+You can run via QEMU using:: + + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio + +The `-serial mon:stdio` part shows both output in the display and on the +console. It is optional. You can add `nographic` as well to *only* get console +output. + +To run with a SATA drive called `$DISK`::It is unclear what this is. It should clearly say this is the disk image file?
Quoted 5 lines
doc/board/coreboot/coreboot.rst +5
-0+ + qemu-system-x86_64 -bios build/coreboot.rom -serial mon:stdio \ + -drive id=disk,file=$DISK,if=none \ + -device ahci,id=ahci \ + -device ide-hd,drive=disk,bus=ahci.0
Quoted 5 lines
Quoted 2 lines
Can we use AHCI directly, instead of the legacy IDE driver?
Probably...do you know the QEMU incantation for that?
If you are using "-M q35", an AHCI controller is automatically instantiated.
If you omit "-M q35", then you can add "-device ich9-ahci".
Regards,
Bin
PATCH v2 8/9 x86: coreboot: Enable standard boot
In reply to Simon GlassEnable bootstd options and provide instructions on how to boot a linux distro using coreboot.
---
(no changes since v1)
configs/coreboot64_defconfig | 14 ++------------ configs/coreboot_defconfig | 1 + doc/board/coreboot/coreboot.rst | 16 ++++++++++++++-- 3 files changed, 17 insertions(+), 14 deletions(-)
configs/coreboot64_defconfig +2 -12
@@ -10,40 +10,30 @@ CONFIG_VENDOR_COREBOOT=y CONFIG_TARGET_COREBOOT=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y +CONFIG_BOOTSTD_FULL=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_SYS_MONITOR_BASE=0x01120000 CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro" -CONFIG_USE_BOOTCOMMAND=y -CONFIG_BOOTCOMMAND="ext2load scsi 0:3 01000000 /boot/vmlinuz; zboot 01000000" CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_LAST_STAGE_INIT=y CONFIG_SPL_NO_BSS_LIMIT=y -CONFIG_HUSH_PARSER=y CONFIG_SYS_PBSIZE=532 CONFIG_CMD_IDE=y CONFIG_CMD_MMC=y -CONFIG_CMD_PART=y CONFIG_CMD_SATA=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set -CONFIG_CMD_DHCP=y CONFIG_BOOTP_BOOTFILESIZE=y -CONFIG_CMD_PING=y CONFIG_CMD_TIME=y CONFIG_CMD_SOUND=y -CONFIG_CMD_EXT2=y -CONFIG_CMD_EXT4=y CONFIG_CMD_EXT4_WRITE=y -CONFIG_CMD_FAT=y -CONFIG_CMD_FS_GENERIC=y CONFIG_MAC_PARTITION=y # CONFIG_SPL_MAC_PARTITION is not set # CONFIG_SPL_DOS_PARTITION is not set -CONFIG_ISO_PARTITION=y -CONFIG_EFI_PARTITION=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y
configs/coreboot_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_TARGET_COREBOOT=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y CONFIG_BOOTSTD_FULL=y +CONFIG_BOOTSTD_DEFAULTS=y CONFIG_SYS_MONITOR_BASE=0x01110000 CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_USE_BOOTARGS=y
doc/board/coreboot/coreboot.rst +14 -2
@@ -67,9 +67,21 @@ To use 4GB of memory, typically necessary for booting Linux distros, add In addition to the 32-bit 'coreboot' build there is a 'coreboot64' build. This produces an image which can be booted from coreboot (32-bit). Internally it works by using a 32-bit SPL binary to switch to 64-bit for running U-Boot. It -can be useful for running UEFI applications, for example. +can be useful for running UEFI applications, for example with the coreboot +build in `$CBDIR`:: + + DISK=ubuntu-23.04-desktop-amd64.iso + CBDIR=~/coreboot/build + + cp $CBDIR/coreboot.rom.in coreboot.rom + cbfstool coreboot.rom add-flat-binary -f u-boot-x86-with-spl.bin \ + -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000 + + qemu-system-x86_64 -m 2G -smp 4 -bios coreboot.rom \ + -drive id=disk,file=$DISK,if=none \ + -device ahci,id=ahci \ + -device ide-hd,drive=disk,bus=ahci.0 \ -This has only been lightly tested. Memory map
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
PATCH v2 9/9 x86: coreboot: Enable support for CBFS
In reply to Simon GlassThis is normally used with coreboot, so enable support for it in the coreboot builds.
Add an example to show how it is used.
---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 1 + doc/board/coreboot/coreboot.rst | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+)
configs/coreboot64_defconfig +1 -0
@@ -56,3 +56,4 @@ CONFIG_SOUND=y CONFIG_SOUND_I8254=y CONFIG_CONSOLE_SCROLL_LINES=5 # CONFIG_GZIP is not set +CONFIG_CMD_CBFS=y
configs/coreboot_defconfig +1 -0
@@ -66,3 +66,4 @@ CONFIG_CONSOLE_SCROLL_LINES=5 CONFIG_CMD_DHRYSTONE=y # CONFIG_GZIP is not set CONFIG_SMBIOS_PARSER=y +CONFIG_CMD_CBFS=y
doc/board/coreboot/coreboot.rst +34 -0
@@ -83,6 +83,40 @@ build in `$CBDIR`:: -device ide-hd,drive=disk,bus=ahci.0 \ +CBFS access +----------- + +You can use the 'cbfs' commands to access the Coreboot filesystem:: + + => cbfsinit + => cbfsinfo + + CBFS version: 0x31313132 + ROM size: 0x100000 + Boot block size: 0x4 + CBFS size: 0xffdfc + Alignment: 64 + Offset: 0x200 + + => cbfsls + size type name + ------------------------------------------ + 32 cbfs header cbfs master header + 16720 17 fallback/romstage + 53052 17 fallback/ramstage + 398 raw config + 715 raw revision + 117 raw build_info + 4044 raw fallback/dsdt.aml + 640 cmos layout cmos_layout.bin + 17804 17 fallback/postcar + 335797 payload fallback/payload + 607000 null (empty) + 10752 bootblock bootblock + + 12 file(s) + + => Memory map ----------
Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Re: [PATCH v2 9/9] x86: coreboot: Enable support for CBFS
Quoted 7 lines · Simon Glass
This is normally used with coreboot, so enable support for it in the coreboot builds.
Add an example to show how it is used.
Signed-off-by Simon Glass <[email protected]>
Quoted 9 lines
---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 1 + doc/board/coreboot/coreboot.rst | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+)
Re: [PATCH v2 9/9] x86: coreboot: Enable support for CBFS
Quoted 13 lines · Bin Meng
Quoted 11 lines · Simon Glass
This is normally used with coreboot, so enable support for it in the coreboot builds.
Add an example to show how it is used.
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
Quoted 7 lines
Quoted 5 lines
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 1 + doc/board/coreboot/coreboot.rst | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!
Re: [PATCH v2 9/9] x86: coreboot: Enable support for CBFS
Hi Simon,
Quoted 10 lines · Bin Meng
Quoted 8 lines · Bin Meng
Quoted 6 lines · Simon Glass
This is normally used with coreboot, so enable support for it in the coreboot builds.
Add an example to show how it is used.
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Signed-off-by Simon Glass <[email protected]>---
(no changes since v1)
configs/coreboot64_defconfig | 1 + configs/coreboot_defconfig | 1 +
It turns out there is no need to explicitly add CMD_CBFS in the defconfigs, as it is already implied by SYS_COREBOOT.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
doc/board/coreboot/coreboot.rst | 34 +++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+)Reviewed-by Bin Meng <[email protected]>applied to u-boot-x86, thanks!
Commit edited in u-boot-x86.
Regards,
Bin