Lines Matching +full:device +full:- +full:handle

1 // SPDX-License-Identifier: GPL-2.0+
7 * The EFI uclass creates a handle for this driver and installs the
14 * new U-Boot block device. It installs child handles for all partitions and
22 * U-Boot loads the iPXE snp.efi executable. iPXE connects an iSCSI drive and
23 * exposes a handle with the block IO protocol. It calls ConnectController.
32 #include <dm/device-internal.h>
38 * handle handle of the controller on which this driver is installed
42 efi_handle_t handle; member
47 * Read from block device
49 * @dev device
59 struct efi_block_io *io = platdata->io; in efi_bl_read()
63 __func__, dev->name, blknr, blkcnt); in efi_bl_read()
64 ret = EFI_CALL(io->read_blocks( in efi_bl_read()
65 io, io->media->media_id, (u64)blknr, in efi_bl_read()
67 (efi_uintn_t)io->media->block_size, buffer)); in efi_bl_read()
76 * Write to block device
78 * @dev device
88 struct efi_block_io *io = platdata->io; in efi_bl_write()
92 __func__, dev->name, blknr, blkcnt); in efi_bl_write()
93 ret = EFI_CALL(io->write_blocks( in efi_bl_write()
94 io, io->media->media_id, (u64)blknr, in efi_bl_write()
96 (efi_uintn_t)io->media->block_size, in efi_bl_write()
106 * Create partions for the block device.
108 * @handle EFI handle of the block device
109 * @dev udevice of the block device
111 static int efi_bl_bind_partitions(efi_handle_t handle, struct udevice *dev) in efi_bl_bind_partitions() argument
117 if_typename = blk_get_if_type_name(desc->if_type); in efi_bl_bind_partitions()
119 return efi_disk_create_partitions(handle, desc, if_typename, in efi_bl_bind_partitions()
120 desc->devnum, dev->name); in efi_bl_bind_partitions()
124 * Create a block device for a handle
126 * @handle handle
130 static int efi_bl_bind(efi_handle_t handle, void *interface) in efi_bl_bind() argument
135 struct efi_object *obj = efi_search_obj(handle); in efi_bl_bind()
140 EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io); in efi_bl_bind()
143 return -ENOENT; in efi_bl_bind()
146 if (devnum == -ENODEV) in efi_bl_bind()
153 return -ENOMEM; in efi_bl_bind()
156 /* Create driver model udevice for the EFI block io device */ in efi_bl_bind()
158 io->media->block_size, in efi_bl_bind()
159 (lbaint_t)io->media->last_block, &bdev); in efi_bl_bind()
163 return -ENOENT; in efi_bl_bind()
168 platdata->handle = handle; in efi_bl_bind()
169 platdata->io = interface; in efi_bl_bind()
174 EFI_PRINT("%s: block device '%s' created\n", __func__, bdev->name); in efi_bl_bind()
176 /* Create handles for the partions of the block device */ in efi_bl_bind()
177 disks = efi_bl_bind_partitions(handle, bdev); in efi_bl_bind()
183 /* Block device driver operators */
189 /* Identify as block device driver */