Date: Tue, 17 Jan 2017 21:06:13 -0800 From: Thomas Skibo <thomasskibo@yahoo.com> To: Warner Losh <imp@bsdimp.com> Cc: Kurt Jaeger <pi@opsec.eu>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: u-boot ports for Zedboard and Zybo Message-ID: <25A1C780-3BC1-4745-9DBD-D2716E6ED7D2@yahoo.com> In-Reply-To: <CANCZdfqScpotLM07XfSM4kDu7fM4EOGbOWJVgANVEJfC4Up=5g@mail.gmail.com> References: <640059E8-B9DD-4289-BA59-2E02A4D91F87@yahoo.com> <20170116173329.GH13006@home.opsec.eu> <B648E0C0-4DE4-4809-8FEC-FE9735DC178A@yahoo.com> <CANCZdfrfurQaQXviNJ4Q=FwVgtFGuBEqQgOLtV5HuVzOT=fRMg@mail.gmail.com> <58C09F42-D34B-4B84-A894-7147613214B9@yahoo.com> <CANCZdfqScpotLM07XfSM4kDu7fM4EOGbOWJVgANVEJfC4Up=5g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
> On Jan 17, 2017, at 5:04 PM, Warner Losh <imp@bsdimp.com> wrote:
>
> Does that mean you have a fix? :) I'm happy to add stuff to the u-boot
> ports branch (or do pull requests, which atm are a little
> complicated).
>
> Warner
I managed to get it working but I am seeing some funny u-boot warnings (CACHE: Misaligned operation…).
I’ll keep tinkering with it over the next few days. I’ve attached my changes but I can’t test it on any of the other boards.
—Thomas
[-- Attachment #2 --]
diff --git a/api/api_storage.c b/api/api_storage.c
index d6e475b9c4..d3bbe71756 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -334,10 +334,5 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
if (!dev_stor_is_valid(type, dd))
return 0;
- if ((dd->block_read) == NULL) {
- debugf("no block_read() for device 0x%08x\n", cookie);
- return 0;
- }
-
- return dd->block_read(dd, start, len, buf);
+ return blk_dread(dd, start, len, buf);
}
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 8dd8061c46..b76a4ee02e 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -286,8 +286,8 @@ static int efi_disk_create_eltorito(struct blk_desc *desc,
}
static int efi_disk_create_mbr(struct blk_desc *desc,
- const struct blk_driver *cur_drvr,
- int diskid)
+ const char *if_typename,
+ int diskid)
{
int disks = 0;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
@@ -298,10 +298,10 @@ static int efi_disk_create_mbr(struct blk_desc *desc,
return 0;
while (!part_get_info(desc, part, &info)) {
- snprintf(devname, sizeof(devname), "%s%d:%d", cur_drvr->if_typename,
+ snprintf(devname, sizeof(devname), "%s%d:%d", if_typename,
diskid, part);
- efi_disk_add_dev(devname, cur_drvr->if_typename, desc, diskid, &info, 1);
+ efi_disk_add_dev(devname, if_typename, desc, diskid, &info, 1);
part++;
disks++;
}
@@ -340,7 +340,7 @@ int efi_disk_register(void)
* El Torito images show up as block devices in an EFI world,
* so let's create them here
*/
- disks += efi_disk_create_mbr(desc, dev, desc->devnum);
+ disks += efi_disk_create_mbr(desc, if_typename, desc->devnum);
disks += efi_disk_create_eltorito(desc, if_typename,
desc->devnum, dev->name);
}
@@ -377,7 +377,7 @@ int efi_disk_register(void)
* El Torito images show up as block devices
* in an EFI world, so let's create them here
*/
- disks += efi_disk_create_mbr(desc, cur_drvr, i);
+ disks += efi_disk_create_mbr(desc, if_typename, i);
disks += efi_disk_create_eltorito(desc, if_typename,
i, devname);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25A1C780-3BC1-4745-9DBD-D2716E6ED7D2>
