All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC 0/3] dm, efi: integrate efi_disk into DM
@ 2019-01-29  2:59 AKASHI Takahiro
  2019-01-29  2:59 ` [U-Boot] [RFC 1/3] dm: blk: add UCLASS_PARTITION AKASHI Takahiro
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: AKASHI Takahiro @ 2019-01-29  2:59 UTC (permalink / raw)
  To: u-boot

This patch set came from the past discussion[1] on my "removable device
support" patch and is intended to be an attempt to integrate efi_disk
(more precisely, EFI_BLOCK_IO_PROTOCOL-capable efi object) into u-boot's
Driver Model as much seamlessly as possible

[1] https://lists.denx.de/pipermail/u-boot/2019-January/354010.html

Basic idea is
* create UCLASS_PARTITION
* enumerate all the partitions when a block device is probed
* hook up a creation of UCLASS_BLK or UCLASS_PARTITION device
  to efi handler for efi_disk attributes to be properly set up

Since this patch is a prototype (or POC, proof-of-concept), the aim here
is to discuss further about how in a better shape we will be able to
merge the two worlds.


Example operation:
(Two scsi disks, one with no partition, one with two partitions)

U-Boot 2019.01-rc3-00024-ga81a6f87ad48 (Jan 29 2019 - 10:56:45 +0900)

DRAM:  1 GiB
In:    pl011 at 9000000
Out:   pl011 at 9000000
Err:   pl011 at 9000000
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
=> efi devices
Device           Device Path
================ ====================
000000007ef01350 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
=> scsi rescan

Reset SCSI
scanning bus for devices...
Target spinup took 0 ms.
Target spinup took 0 ms.
SATA link 2 timeout.
SATA link 3 timeout.
SATA link 4 timeout.
SATA link 5 timeout.
AHCI 0001.0000 32 slots 6 ports 1.5 Gbps 0x3f impl SATA mode
flags: 64bit ncq only 
  Device 0: (0:0) Vendor: ATA Prod.: QEMU HARDDISK Rev: 2.5+
            Type: Hard Disk
            Capacity: 16.0 MB = 0.0 GB (32768 x 512)
  Device 0: (1:0) Vendor: ATA Prod.: QEMU HARDDISK Rev: 2.5+
            Type: Hard Disk
            Capacity: 256.0 MB = 0.2 GB (524288 x 512)
=> efi devices
Device           Device Path
================ ====================
000000007ef01350 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
000000007ef0b2c0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)
000000007ef0b7b0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)
000000007ef0c760 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(-1,MBR,0x086246ba,0x17ff56048,0x7eeeb770)
000000007ef0cb50 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(-1,MBR,0x086246ba,0x17ff56048,0x7eeeb770)
=> dm tree
 Class    index  Probed  Driver                Name
-----------------------------------------------------------
 root        0  [ + ]   root_driver           root_driver
 ...
 pci         0  [ + ]   pci_generic_ecam      |-- pcie at 10000000
 pci_generi  0  [   ]   pci_generic_drv       |   |-- pci_0:0.0
 virtio      32  [   ]   virtio-pci.l          |   |-- virtio-pci.l#0
 ahci        0  [ + ]   ahci_pci              |   `-- ahci_pci
 scsi        0  [ + ]   ahci_scsi             |       `-- ahci_scsi
 blk         0  [   ]   scsi_blk              |           |-- ahci_scsi.id0lun0
 blk         1  [   ]   scsi_blk              |           `-- ahci_scsi.id1lun0
 partition   0  [   ]   blk_partition         |               |-- ahci_scsi.id1lun0:1
 partition   1  [   ]   blk_partition         |               `-- ahci_scsi.id1lun0:2
 ...

Thanks,
-Takahiro Akashi

AKASHI Takahiro (3):
  dm: blk: add UCLASS_PARTITION
  efi_loader: associate BLK/PARTITION device to efi_disk
  drivers: align block device drivers with DM-efi integration

 common/usb_storage.c              |  27 ++++-
 drivers/block/blk-uclass.c        |  61 ++++++++++
 drivers/core/device.c             |   3 +
 drivers/scsi/scsi.c               |  22 ++++
 include/blk.h                     |  24 ++++
 include/dm/device.h               |   4 +
 include/dm/uclass-id.h            |   1 +
 lib/efi_driver/efi_block_device.c |  30 ++---
 lib/efi_loader/efi_disk.c         | 192 +++++++++++++++++++++---------
 9 files changed, 283 insertions(+), 81 deletions(-)

-- 
2.19.1

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-02-06  7:54 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-29  2:59 [U-Boot] [RFC 0/3] dm, efi: integrate efi_disk into DM AKASHI Takahiro
2019-01-29  2:59 ` [U-Boot] [RFC 1/3] dm: blk: add UCLASS_PARTITION AKASHI Takahiro
2019-01-29  3:17   ` Sergey Kubushyn
2019-01-29 15:37     ` Alexander Graf
2019-01-29 17:46       ` Sergey Kubushyn
2019-01-29 18:02         ` Philipp Tomsich
2019-01-29 22:20   ` Heinrich Schuchardt
2019-01-30  5:28     ` AKASHI Takahiro
2019-01-31  1:00   ` Simon Glass
2019-01-29  2:59 ` [U-Boot] [RFC 2/3] efi_loader: associate BLK/PARTITION device to efi_disk AKASHI Takahiro
2019-01-29 22:33   ` Heinrich Schuchardt
2019-01-30  5:48     ` AKASHI Takahiro
2019-01-30  6:49       ` Heinrich Schuchardt
2019-01-30  7:26         ` AKASHI Takahiro
2019-01-31  1:22   ` Simon Glass
2019-02-01  5:54     ` AKASHI Takahiro
2019-02-02 14:15       ` Simon Glass
2019-02-06  3:15         ` AKASHI Takahiro
2019-02-06  7:54           ` AKASHI Takahiro
2019-01-29  2:59 ` [U-Boot] [RFC 3/3] drivers: align block device drivers with DM-efi integration AKASHI Takahiro
2019-01-29 16:19   ` Alexander Graf
2019-01-30  0:40     ` AKASHI Takahiro
2019-01-29 16:20 ` [U-Boot] [RFC 0/3] dm, efi: integrate efi_disk into DM Alexander Graf
2019-01-29 22:48   ` Heinrich Schuchardt
2019-01-30  5:18     ` AKASHI Takahiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.