grub/grub-core
Eric Snowberg a492f4ebdb ieee1275: obdisk driver
Add a new disk driver called obdisk for IEEE1275 platforms.  Currently
the only platform using this disk driver is SPARC, however other IEEE1275
platforms could start using it if they so choose.  While the functionality
within the current IEEE1275 ofdisk driver may be suitable for PPC and x86, it
presented too many problems on SPARC hardware.

Within the old ofdisk, there is not a way to determine the true canonical
name for the disk.  Within Open Boot, the same disk can have multiple names
but all reference the same disk.  For example the same disk can be referenced
by its SAS WWN, using this form:

/pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@w5000cca02f037d6d,0

It can also be referenced by its PHY identifier using this form:

/pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@p0

It can also be referenced by its Target identifier using this form:

/pci@302/pci@2/pci@0/pci@17/LSI,sas@0/disk@0

Also, when the LUN=0, it is legal to omit the ,0 from the device name.  So with
the disk above, before taking into account the device aliases, there are 6 ways
to reference the same disk.

Then it is possible to have 0 .. n device aliases all representing the same disk.
Within this new driver the true canonical name is determined using the the
IEEE1275 encode-unit and decode-unit commands when address_cells == 4.  This
will determine the true single canonical name for the device so multiple ihandles
are not opened for the same device.  This is what frequently happens with the old
ofdisk driver.  With some devices when they are opened multiple times it causes
the entire system to hang.

Another problem solved with this driver is devices that do not have a device
alias can be booted and used within GRUB. Within the old ofdisk, this was not
possible, unless it was the original boot device.  All devices behind a SAS
or SCSI parent can be found.   Within the old ofdisk, finding these disks
relied on there being an alias defined.  The alias requirement is not
necessary with this new driver.  It can also find devices behind a parent
after they have been hot-plugged.  This is something that is not possible
with the old ofdisk driver.

The old ofdisk driver also incorrectly assumes that the device pointing to by a
device alias is in its true canonical form. This assumption is never made with
this new driver.

Another issue solved with this driver is that it properly caches the ihandle
for all open devices.  The old ofdisk tries to do this by caching the last
opened ihandle.  However this does not work properly because the layer above
does not use a consistent device name for the same disk when calling into the
driver.  This is because the upper layer uses the bootpath value returned within
/chosen, other times it uses the device alias, and other times it uses the
value within grub.cfg.  It does not have a way to figure out that these devices
are the same disk.  This is not a problem with this new driver.

Due to the way GRUB repeatedly opens and closes the same disk. Caching the
ihandle is important on SPARC.  Without caching, some SAS devices can take
15 - 20 minutes to get to the GRUB menu. This ihandle caching is not possible
without correctly having the canonical disk name.

When available, this driver also tries to use the deblocker #blocks and
a way of determining the disk size.

Finally and probably most importantly, this new driver is also capable of
seeing all partitions on a GPT disk.  With the old driver, the GPT
partition table can not be read and only the first partition on the disk
can be seen.

Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-09-21 16:44:29 -04:00
..
boot diskboot: Trivial correction on stale comments 2020-09-21 12:43:53 -04:00
bus ehci: Fix compilation on i386 2020-09-21 11:32:45 -04:00
commands ieee1275: obdisk driver 2020-09-21 16:44:29 -04:00
disk ieee1275: obdisk driver 2020-09-21 16:44:29 -04:00
efiemu verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
font verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
fs btrfs: Add zstd support to grub btrfs 2020-09-21 13:46:35 -04:00
gdb i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
gettext verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
gfxmenu verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
hello * grub-core/commands/gptsync.c: Fix typographic quoting. 2012-03-03 13:05:08 +01:00
hook * grub-core/hook/datehook.c (grub_read_hook_datetime): Small stylistic 2011-11-11 21:03:49 +01:00
io verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
kern ieee1275: obdisk driver 2020-09-21 16:44:29 -04:00
lib gnulib: Upgrade Gnulib and switch to bootstrap tool 2020-09-21 16:44:29 -04:00
loader RISC-V: Add Linux load logic 2020-09-21 16:43:54 -04:00
mmap xen: Prepare common code for Xen PVH support 2020-09-21 13:46:35 -04:00
net ofnet: Fix build regression in grub_ieee1275_parse_bootpath() 2020-09-21 13:46:35 -04:00
normal normal/menu: Do not treat error values as key presses 2020-09-21 16:43:54 -04:00
osdep windows/platform.c: Fix compilation errors 2020-09-21 16:44:29 -04:00
partmap msdos: Fix overflow in converting partition start and length into 512B blocks 2020-09-21 13:29:05 -04:00
parttool * grub-core/net/http.c: Add TRANSLATORS comments. 2012-03-05 16:42:26 +01:00
script verifiers: Core TPM support 2020-09-21 16:43:54 -04:00
term efi/console: Fix the "enter" key not working on x86 tablets 2020-09-21 13:19:10 -04:00
tests Regenerate checksum.h with newer unifont. 2020-09-21 12:02:37 -04:00
video verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
gdb_grub.in * grub-core/gdb_grub.in: Fix overflow and wrong field. 2013-10-14 03:40:20 +02:00
genemuinit.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genemuinitheader.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genmod.sh.in .mod files: Strip annobin annotations and .eh_frame, and their relocations 2020-09-21 12:16:25 -04:00
genmoddep.awk enforcing fixup 2020-09-21 12:02:37 -04:00
gensyminfo.sh.in Fix shebang for termux. 2020-09-21 11:32:45 -04:00
gensymlist.sh Make 'make check' work on emu. 2013-04-27 02:00:16 +02:00
gentrigtables.c * grub-core/gentrigtables.c: Make tables const. 2013-03-01 11:15:09 +01:00
gmodule.pl.in * grub-core/gmodule.pl.in: Accept newer binutils which output 2014-09-21 18:23:23 +02:00
Makefile.am RISC-V: Add to build system 2020-09-21 16:43:54 -04:00
Makefile.core.def ieee1275: obdisk driver 2020-09-21 16:44:29 -04:00
modinfo.sh.in Fix shebang for termux. 2020-09-21 11:32:45 -04:00