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 6A2AAC54EE9 for ; Sat, 17 Sep 2022 15:10:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 09C8784B7F; Sat, 17 Sep 2022 17:10:23 +0200 (CEST) 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="J5g1Yjlq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFA7E84BD8; Sat, 17 Sep 2022 17:00:21 +0200 (CEST) Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) (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 9661B84B7F for ; Sat, 17 Sep 2022 17:00:15 +0200 (CEST) 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-oi1-x22c.google.com with SMTP id o184so9536284oif.13 for ; Sat, 17 Sep 2022 08:00:15 -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; bh=grooLw9NZ8njAUE6awvEUwW59AHiWtA7JXXWh941zXY=; b=J5g1Yjlq0BJ+AzCQJFE+ArEwzJLC2BLaRXs62KaarS61Lo+aifIV1eKoG/kpMBgE0D D/U9nV03r0A5WDLompqKWtxS/7AmnsTc1FFrvEGAeO05aW6ayxhuSGtlpiKEH8N3Rplz WndmB8LMwR4AMgGrXGOBn1gpeiXDQ2ACrcLxw= 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; bh=grooLw9NZ8njAUE6awvEUwW59AHiWtA7JXXWh941zXY=; b=m05QEYv/Nmc4b5oUsJ6ZVahHbq3AlmxZIQMhdk5mwsQ5GufJWZ8rk24HJRy7q9Ms60 34fMLTSezZvBrhakG/Oy/mjK4m8omvD0AxaeskS7GWiiRCB5gNcYMbDaxO7xY9udqzd3 YjgIiAO/nsbNsYlu5R8iHgSDvTZVf1iiV0vR2MUk7z+7NNF2P+cCaIimHOwr3zmTHX5s lXgUOj+03drE3tTHjgC/bfpcnJWjS8hLZuQpuW5Xhpxk43XPFR5B8ZqDdTFl68MnhMSy Fcp/xDE5OfcQVrpDICA5SMVgojN0w4eXdsQfNwE3QtwxyjB5UA+ltySMcRpSUE9CIxUQ fYWQ== X-Gm-Message-State: ACgBeo2pvPOh6cnXFfbWAJmsiZaCHND+I3RwRibq3qal5/SmUjdOi1vF P/NVH5v3rax4hPcYQ5v1EHLEl70K52ybgQ== X-Google-Smtp-Source: AA6agR52C2o32A3MmQIqXzVCkQvln/figcIOhz4wWqE1UKcunYsf+GZVHPn4q+QbmM+UETEkGgTMiQ== X-Received: by 2002:a05:6808:13c9:b0:350:109d:4916 with SMTP id d9-20020a05680813c900b00350109d4916mr7705353oiw.97.1663426813657; Sat, 17 Sep 2022 08:00:13 -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 t190-20020acaaac7000000b003458d346a60sm10462845oie.25.2022.09.17.08.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 08:00:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , AKASHI Takahiro , Anastasiia Lukianenko , Bin Meng , Gary Bisson , Ilias Apalodimas , Jaehoon Chung , Joe Hershberger , Lukasz Majewski , Marcel Ziswiler , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Marek Vasut , Markus Niebel , Masahisa Kojima , Max Merchel , Oleksandr Andrushchenko , Oleksandr Suvorov , Oleksii Bidnichenko , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Patrice Chotard , Patrick Delaunay , Peng Fan , Ramon Fried , Ricardo Salveti , Sean Anderson , Stefan Roese , "Ying-Chun Liu (PaulLiu)" , schspa , uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH v4 0/1] blk: Rationalise the block interface Date: Sat, 17 Sep 2022 09:00:08 -0600 Message-Id: <20220917150009.91460-1-sjg@chromium.org> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sat, 17 Sep 2022 17:10:21 +0200 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 The block interface has two separate implementations, one using driver model and one not. The latter is really only needed for SPL, where size constraints allegedly don't allow use of driver model. Of course we still need space for filesystems and other code, so it isn't clear that driver model is anything more than the straw that breaks the camel's back. The driver model version uses a uclass ID for the interface time, but converts back and forth between that and if_type, which is the legacy type. The HAVE_BLOCK_DEVICE define is mostly a hangover from the old days. At present its main purpose is to enable the legacy block implementation in SPL. Finally the use of 'select' to enable BLK does not work very well. It causes kconfig errors when another option depends on BLK and it is not recommended by the kconfig style guide. This series aims to clean things up: - Enable BLK based on whether different media types are used, but still allow boards to disable it - Rename HAVE_BLOCK_DEVICE to indicates its real purpose - Drop if_type and use the uclass instead - Drop some obsolete if_type values An issue not resolved by this series is that the sandbox host interface does not actually have a device. At present it uses the root device, which was convenience for the driver model conversion but not really correct. It should be possible to clean this up, in a future series. Another minor issue is the use of UCLASS_USB for a mass-storage device. This has been the case for a while and is not addresed by this series, other than to add a comment. Note that this test relies on Tom Rini's series to drop various boards including warp and cm_t335 Finally, a patch is included to make binman put fake files in a subdirectory, since repeated runs of certain boards can cause unrelated failues (e.g. chromebook_coral) when fake files are left around. Changes in v4: - Fix comments from Takahiro Akashi missed on the previous revision Changes in v3: - Drop previously applied patches - Rebase on -next after EFI changes Changes in v2: - Use conv_uclass_id() instead of the confusing uclass_id_to_uclass_id() Simon Glass (1): blk: Rename if_type to uclass_id board/st/common/stm32mp_dfu.c | 2 +- cmd/bcb.c | 4 +- cmd/blk_common.c | 18 ++--- cmd/lsblk.c | 2 +- cmd/mmc.c | 4 +- common/spl/spl_sata.c | 2 +- common/spl/spl_usb.c | 2 +- common/usb_storage.c | 6 +- disk/disk-uclass.c | 8 +- disk/part.c | 14 ++-- doc/usage/partitions.rst | 2 +- drivers/ata/sata.c | 2 +- drivers/block/blk-uclass.c | 145 +++++++++++++++++----------------- drivers/block/blk_legacy.c | 58 +++++++------- drivers/block/ide.c | 8 +- drivers/block/sandbox.c | 8 +- drivers/mmc/mmc-uclass.c | 2 +- drivers/mmc/mmc_legacy.c | 8 +- drivers/net/fsl_enetc.c | 12 +-- drivers/net/fsl_enetc.h | 2 +- drivers/scsi/scsi.c | 6 +- drivers/virtio/virtio_blk.c | 2 +- drivers/xen/pvblock.c | 2 +- fs/fat/fat.c | 2 +- include/blk.h | 122 ++++++++++++++-------------- include/efi_loader.h | 4 +- lib/efi_loader/efi_disk.c | 12 +-- lib/efi_loader/efi_var_file.c | 4 +- 28 files changed, 231 insertions(+), 232 deletions(-) -- 2.37.3.968.ga6b4b080e4-goog