From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9DB8FC05027 for ; Wed, 1 Feb 2023 18:20:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4AA1C85C0C; Wed, 1 Feb 2023 19:20:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=waldekranz.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=waldekranz-com.20210112.gappssmtp.com header.i=@waldekranz-com.20210112.gappssmtp.com header.b="4qBTLysn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A26E385C64; Wed, 1 Feb 2023 19:10:41 +0100 (CET) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D81E485C0C for ; Wed, 1 Feb 2023 19:10:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=waldekranz.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tobias@waldekranz.com Received: by mail-ed1-x529.google.com with SMTP id f7so11347521edw.5 for ; Wed, 01 Feb 2023 10:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waldekranz-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sTWAVZyAGqcALW61osPVkSuzGpnTS0DLdGn8QbjreBw=; b=4qBTLysnDjEETBEZA9tI5Zsk0wiS8zozs/02KHw5LWTG2ohtqMYFp5Rwn8cthR0gCQ 7/GhwwH/W0UkbWDdedshKLq9KM7o4LhXxJQyHgZVuuTWgxcgKNtJEIkdg18PRckH0XfY 9BXatFFJpC7YuxdsToaf/C+T84YiBBp2WqUL4tAaT3GMR12WAJq+UWDcrahesKjVUE+n 2tqLS0qLz8f13IbAPfxF314p8Rnjxw/JzEEIe+hsgNidBE8dnr5YK6/vLSQtnGHUxeRv 5QEfVOnegrQUjnPxi523hm79AjS/Rxd/d/oFs28KPbtAp0nMuG7UGejaikXP5gNKooVE skRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sTWAVZyAGqcALW61osPVkSuzGpnTS0DLdGn8QbjreBw=; b=uFyfhTSbQIv+5x3qCcGrjej418aoS0U/STpeYDYTp+ZWCaEigd1LRXpUIuDxSnUyc5 eLSRS4jRTvdkxXVTa4DXkPPzDlrCxPxyJmQCqCORSzchM62rgYGZePHwnq6co+tHfeSB 3qT3TOg78Q6DbXk5ngGbFgwVDYytLoUSns4Se165MaIJr/ydVxn1drK0gASeuBFueTh0 8VqXW0A3Kq7Vn3Dr/ZmjyKHYQDm8xWcGYHBoJBIR8z/bC9WA2+bSYTa5Buk9Cc8WDfNi l7WZzRT3HnAbS5i/aqlXWXilEra9QyFd5+B+nxwve9ENh1E/D/pE+9vTJS+JCi8UZRM1 NbbQ== X-Gm-Message-State: AO0yUKXftJPe5Yas1KNXX313ba4APcXfXiL6PPpeVGwbnX2WXBdGqj5v AqJ5prYwwtGv06tjjS1aB6eX0A== X-Google-Smtp-Source: AK7set/OmjIMLdY/dt/rLpJQ2riygdnZ3m8sp1LhdbiiIoh5Qp0pBOinoT+in+l3OmMWArZOvz/Xsg== X-Received: by 2002:a05:6402:500c:b0:49e:6bf1:5399 with SMTP id p12-20020a056402500c00b0049e6bf15399mr3286088eda.8.1675275038370; Wed, 01 Feb 2023 10:10:38 -0800 (PST) Received: from wkz-x13.addiva.ad (h-98-128-229-186.NA.cust.bahnhof.se. [98.128.229.186]) by smtp.gmail.com with ESMTPSA id n3-20020a05640204c300b004a23609fab4sm5987171edw.70.2023.02.01.10.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 10:10:37 -0800 (PST) From: Tobias Waldekranz To: sjg@chromium.org, xypron.glpk@gmx.de, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de Subject: [PATCH 0/8] blk: blkmap: Composable virtual block devices Date: Wed, 1 Feb 2023 19:10:08 +0100 Message-Id: <20230201181016.4145834-1-tobias@waldekranz.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 01 Feb 2023 19:20:41 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Block maps are a way of looking at various sources of data through the lens of a regular block device. It lets you treat devices that are not block devices, like RAM, as if they were. It also lets you export a slice of an existing block device, which does not have to correspond to a partition boundary, as a new block device. This is primarily useful because U-Boot's filesystem drivers only operate on block devices, so a block map lets you access filesystems wherever they might be located. The implementation is loosely modeled on Linux's "Device Mapper" subsystem, see the kernel documentation [1] for more information. The primary use-cases are to access filesystem images stored in RAM, and within FIT images stored on disk. See doc/usage/blkmap.rst for more details. The architecture is pluggable, so adding other types of mappings should be quite easy. [1]: https://docs.kernel.org/admin-guide/device-mapper/index.html Tobias Waldekranz (8): image: Fix script execution from FIT images with external data cmd: blk: Allow generic read/write operations to work in sandbox blk: blkmap: Add basic infrastructure blk: blkmap: Add memory mapping support blk: blkmap: Add linear device mapping support cmd: blkmap: Add blkmap command test: blkmap: Add test suite doc: blkmap: Add introduction and examples MAINTAINERS | 9 + boot/image-board.c | 3 +- cmd/Kconfig | 19 ++ cmd/Makefile | 1 + cmd/blk_common.c | 15 +- cmd/blkmap.c | 181 +++++++++++++ configs/sandbox_defconfig | 1 + disk/part.c | 1 + doc/usage/blkmap.rst | 109 ++++++++ doc/usage/index.rst | 1 + drivers/block/Kconfig | 18 ++ drivers/block/Makefile | 1 + drivers/block/blk-uclass.c | 1 + drivers/block/blkmap.c | 452 +++++++++++++++++++++++++++++++ include/blkmap.h | 21 ++ include/dm/uclass-id.h | 1 + include/efi_loader.h | 4 + lib/efi_loader/efi_device_path.c | 30 ++ test/py/tests/test_blkmap.py | 164 +++++++++++ 19 files changed, 1027 insertions(+), 5 deletions(-) create mode 100644 cmd/blkmap.c create mode 100644 doc/usage/blkmap.rst create mode 100644 drivers/block/blkmap.c create mode 100644 include/blkmap.h create mode 100644 test/py/tests/test_blkmap.py -- 2.34.1