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 36B15C38A02 for ; Sun, 30 Oct 2022 01:49:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DFCF785108; Sun, 30 Oct 2022 02:47:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cnCBOICS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1088C85113; Sun, 30 Oct 2022 02:47:32 +0100 (CET) Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (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 75BEF85104 for ; Sun, 30 Oct 2022 02:47:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x132.google.com with SMTP id r1so4773675ilg.6 for ; Sat, 29 Oct 2022 18:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b09vz5S8cTNUpHg7OYL7TxsIIhA/r5LlLWRO4sJyotU=; b=cnCBOICSqzunFRoVgLPYKzFMYEU8XPnZf7worfz1KyCKkWtUP63xsu9larfln7qZPl MAB1MpU+0z3QHihKB/aLSJbU3TiSm8RJiexOmZqq1uLYIpEi5Ezz167k9JxYSsMoyZ7Y lAUxmjouGTLLx8vmEVoG8sVlvK07AdrxZgDms= 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=b09vz5S8cTNUpHg7OYL7TxsIIhA/r5LlLWRO4sJyotU=; b=oYwkrWUsLdT3P983qw8EbunpA1v4J5isxsA5WJYVnismsbO5t/iIy3daCJFStLYx/A c3nhQeK8f8l3e5uwsy3Hb+ZgYtbriD3VGPRKgVkjMrjJ2qvyJkkYsPYeWf+CtI65CqIO Y/6uZY58WnbL44HH1rAWOwYJJY63uUQwLk6c1/YnyyqSXrXUxkoVLfGRg8EGzlJs/TYk 74ENBN4XKjDPUbeU2rajRdI6ZljD1vO4MHK4R04SBZsfqF3PNgkIE+cRRZb7nnudVHbU Cu/UX7seoIz2ipSFPsCk2sw9jw4/9VITSFJA6y4vx3hGAiie6AitzZH6rhtmeJFIGWl3 8o1Q== X-Gm-Message-State: ACrzQf2X5CXqGAdQ/MUM3xSxXX/3lfRnlB79xbMqE9N1+kIMculA+FWL StRM2SNNm2uoGr39ma0BdhlobK7Kv9Diig== X-Google-Smtp-Source: AMsMyM6HZ9cdaMPMqYiwkEczC0Ngu6cQJqNdlAn18DUhMo9c0RTwUWJYseqjzrMfcadOvRstWbmAuQ== X-Received: by 2002:a92:c9c6:0:b0:2ff:7a45:865c with SMTP id k6-20020a92c9c6000000b002ff7a45865cmr3281179ilq.141.1667094445741; Sat, 29 Oct 2022 18:47:25 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id x66-20020a0294c8000000b00363c4307bb2sm810287jah.79.2022.10.29.18.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 18:47:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , AKASHI Takahiro , Andrew Scull , Bin Meng , Ilias Apalodimas , Marcel Ziswiler , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Marek Vasut , Mattijs Korpershoek , Michal Suchanek , Oleksii Bidnichenko , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Pavel Herrmann , Ramon Fried , Rasmus Villemoes , Rick Chen , Roger Knecht , Rui Miguel Silva , Sean Anderson , Sean Anderson , Stefan Herbrechtsmeier , Stefan Roese , schspa Subject: [PATCH 00/17] dm: sandbox: Add a new HOST uclass Date: Sat, 29 Oct 2022 19:47:02 -0600 Message-Id: <20221030014719.147327-1-sjg@chromium.org> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 At present sandbox uses the root device as the parent for block devices it creates to provide access to files on the host. This is convenient but is not really correct, since the root device should not have any particular meaning for its children. This series tidies this up, introducing a new uclass and updating the implementation accordingly. Rather than numbering host devices, it is now possible to provide a label, which is easier to deal with. The host command has some minor updates, including showing the label. A test and documentation are added for it also. A few other minor improvements are included also. Simon Glass (17): dm: sandbox: Drop non-BLK code from host implementation sandbox: Add missing comments for os_alarm() test: Split out mk_fs function into a helper test: Correct pylint warnings in fs_helper dm: test: Drop the special function for running DM tests dm: test: Clear the block cache after running a test test: Drop an unused parameter to ut_run_test_live_flat() test: Tidy up help for ut command test: doc: Add documentation for ut command test: Allow showing basic information about tests test: Add a way to detect a test that breaks another dm: blk: Tidy up obtaining a block device from its parent dm: sandbox: Create a new HOST uclass dm: sandbox: Create a block driver dm: sandbox: Switch over to using the new host uclass dm: Add documentation for host command and implementation dm: Add tests for the sandbox host driver arch/sandbox/cpu/spl.c | 2 +- arch/sandbox/dts/sandbox.dts | 4 - cmd/host.c | 210 ++++++++++------ disk/part.c | 4 +- doc/arch/index.rst | 2 +- doc/arch/sandbox/block_impl.rst | 39 +++ doc/arch/sandbox/index.rst | 12 + doc/arch/{ => sandbox}/sandbox.rst | 9 +- doc/develop/tests_sandbox.rst | 69 +++++ doc/usage/cmd/host.rst | 116 +++++++++ doc/usage/cmd/ut.rst | 117 +++++++++ doc/usage/index.rst | 2 + drivers/block/Makefile | 2 +- drivers/block/blk-uclass.c | 28 ++- drivers/block/blkcache.c | 23 +- drivers/block/host-uclass.c | 176 +++++++++++++ drivers/block/host_dev.c | 142 +++++++++++ drivers/block/sandbox.c | 236 ++---------------- include/blk.h | 37 ++- include/dm/uclass-id.h | 1 + include/os.h | 4 + include/sandbox_host.h | 125 ++++++++++ include/sandboxblockdev.h | 31 --- include/test/ut.h | 7 +- lib/efi_loader/efi_device_path.c | 5 +- lib/efi_loader/efi_disk.c | 2 +- test/cmd_ut.c | 80 ++++-- test/dm/Makefile | 1 + test/dm/blk.c | 49 ++-- test/dm/host.c | 195 +++++++++++++++ test/dm/test-dm.c | 49 +--- test/py/tests/fs_helper.py | 68 +++++ .../py/tests/test_eficonfig/test_eficonfig.py | 3 + test/py/tests/test_fs/conftest.py | 58 +---- test/py/tests/test_ut.py | 6 + test/test-main.c | 47 +++- 36 files changed, 1435 insertions(+), 526 deletions(-) create mode 100644 doc/arch/sandbox/block_impl.rst create mode 100644 doc/arch/sandbox/index.rst rename doc/arch/{ => sandbox}/sandbox.rst (98%) create mode 100644 doc/usage/cmd/host.rst create mode 100644 doc/usage/cmd/ut.rst create mode 100644 drivers/block/host-uclass.c create mode 100644 drivers/block/host_dev.c create mode 100644 include/sandbox_host.h delete mode 100644 include/sandboxblockdev.h create mode 100644 test/dm/host.c create mode 100644 test/py/tests/fs_helper.py -- 2.38.1.273.g43a17bfeac-goog