public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/6] introduce EFI_RAM_DISK_PROTOCOL
@ 2023-07-14  5:44 Masahisa Kojima
  2023-07-14  5:44 ` [PATCH v2 1/6] efi_loader: add RAM disk device path Masahisa Kojima
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Masahisa Kojima @ 2023-07-14  5:44 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Simon Glass,
	Takahiro Akashi, Masahisa Kojima

This series introduces the EFI_RAM_DISK_PROTOCOL implementation.
The major purpose of this series is a preparation for EFI HTTP(S) boot.

Now U-Boot can download the distro installer ISO image
via wget or tftpboot commands, but U-Boot can not mount
the downloaded ISO image.
By calling EFI_RAM_DISK_PROTOCOL->register API, user can
mount the ISO image and boot the distro installer.

Note that the installation process may not proceed
after the distro installer calls ExitBootServices()
since there is no hand-off process for the block device of
memory mapped ISO image.

The EFI_RAM_DISK_PROTOCOL was tested with the
debian network installer[1] on qemu_arm64 platform.
The example procedure is as follows.
 => tftpboot 41000000 mini.iso
 => efidebug disk mount 41000000 $filesize
        or
 => ramdisk mount 41000000 $filesize

ramdisk command works without CONFIG_EFI_LOADER enabled.

After these commands, ISO image is mounted like:

 => efidebug dh

    000000007eec63f0 (ramdisk_blk#0)
      /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/RamDisk(0x41000000,4974afff,3d5abd30-4175-87ce-6d64-d2ade523c4bb,0x0)
      Block IO

    000000007eec6560 (ramdisk_blk#0:1)
      /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/RamDisk(0x41000000,4974afff,3d5abd30-4175-87ce-6d64-d2ade523c4bb,0x0)/HD(1,0x01,0,0x0,0x33800)
      Block IO

    000000007eec66d0 (ramdisk_blk#0:2)
      /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/RamDisk(0x41000000,4974afff,3d5abd30-4175-87ce-6d64-d2ade523c4bb,0x0)/HD(2,0x01,0,0x33800,0x10000)
      Block IO
      System Partition
      Simple File System

 => dm tree -s

    ramdisk       0  [ + ]   ramdisk               |-- ramdisk0
    blk           0  [ + ]   ramdisk_blk           |   `-- ramdisk_blk#0
    partition     0  [ + ]   blk_partition         |       |-- ramdisk_blk#0:1
    partition     1  [ + ]   blk_partition         |       `-- ramdisk_blk#0:2

Debian can be successfully installed with this ramdisk on QEMU.

The created ramdisk can be accessed by the existing commands such as 'fatls':
 => fatls ramdisk 0:2

[TODO]
- add ramdisk command documentation
- add ramdisk command dm test

[1] https://deb.debian.org/debian/dists/bookworm/main/installer-arm64/current/images/netboot/mini.iso

[Changelog]
v1 -> v2
- implement ramdisk uclass and driver,
  then EFI_RAM_DISK_PROTOCOL is implemented based on the ramdisk uclass

Masahisa Kojima (6):
  efi_loader: add RAM disk device path
  ramdisk: add ramdisk uclass and driver
  cmd: ramdisk: add ramdisk control command
  efi_loader: add EFI_RAM_DISK_PROTOCOL implementation
  cmd: efidebug: add RAM disk mount command
  efi_selftest: add EFI_RAM_DISK_PROTOCOL selftest

 cmd/Kconfig                              |   7 +
 cmd/Makefile                             |   1 +
 cmd/efidebug.c                           | 118 ++++++
 cmd/ramdisk.c                            |  92 ++++
 disk/part.c                              |   3 +
 drivers/block/Kconfig                    |   7 +-
 drivers/block/Makefile                   |   2 +
 drivers/block/blk-uclass.c               |   1 +
 drivers/block/blk_ramdisk.c              | 187 +++++++++
 drivers/block/ramdisk-uclass.c           |  14 +
 include/dm/uclass-id.h                   |   1 +
 include/efi_api.h                        |  32 ++
 include/efi_loader.h                     |   4 +
 include/ramdisk.h                        |  32 ++
 lib/efi_loader/Kconfig                   |   7 +
 lib/efi_loader/Makefile                  |   1 +
 lib/efi_loader/efi_device_path.c         |  25 ++
 lib/efi_loader/efi_device_path_to_text.c |  14 +
 lib/efi_loader/efi_ram_disk.c            | 142 +++++++
 lib/efi_loader/efi_setup.c               |   6 +
 lib/efi_selftest/Makefile                |   1 +
 lib/efi_selftest/efi_selftest_ram_disk.c | 511 +++++++++++++++++++++++
 lib/uuid.c                               |   4 +
 23 files changed, 1211 insertions(+), 1 deletion(-)
 create mode 100644 cmd/ramdisk.c
 create mode 100644 drivers/block/blk_ramdisk.c
 create mode 100644 drivers/block/ramdisk-uclass.c
 create mode 100644 include/ramdisk.h
 create mode 100644 lib/efi_loader/efi_ram_disk.c
 create mode 100644 lib/efi_selftest/efi_selftest_ram_disk.c


base-commit: e2e2aea5733f0d23cd9593bbefe5c803c552dcb9
-- 
2.34.1


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

end of thread, other threads:[~2023-07-20  0:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14  5:44 [PATCH v2 0/6] introduce EFI_RAM_DISK_PROTOCOL Masahisa Kojima
2023-07-14  5:44 ` [PATCH v2 1/6] efi_loader: add RAM disk device path Masahisa Kojima
2023-07-14 13:39   ` Heinrich Schuchardt
2023-07-18  1:31     ` Masahisa Kojima
2023-07-18  5:57       ` Heinrich Schuchardt
2023-07-18  6:40         ` Masahisa Kojima
2023-07-14  5:44 ` [PATCH v2 2/6] ramdisk: add ramdisk uclass and driver Masahisa Kojima
2023-07-19 15:10   ` Heinrich Schuchardt
2023-07-20  0:18     ` Masahisa Kojima
2023-07-19 19:11   ` Simon Glass
2023-07-20  0:21     ` Masahisa Kojima
2023-07-14  5:44 ` [PATCH v2 3/6] cmd: ramdisk: add ramdisk control command Masahisa Kojima
2023-07-14  5:44 ` [PATCH v2 4/6] efi_loader: add EFI_RAM_DISK_PROTOCOL implementation Masahisa Kojima
2023-07-14  5:44 ` [PATCH v2 5/6] cmd: efidebug: add RAM disk mount command Masahisa Kojima
2023-07-14  5:44 ` [PATCH v2 6/6] efi_selftest: add EFI_RAM_DISK_PROTOCOL selftest Masahisa Kojima
2023-07-14 22:01 ` [PATCH v2 0/6] introduce EFI_RAM_DISK_PROTOCOL Tobias Waldekranz
2023-07-18  2:49   ` Masahisa Kojima

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox