From patchwork Fri Mar 11 19:10:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1604520 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=gTd9QeE5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KFbBW5GG8z9s3q for ; Sat, 12 Mar 2022 06:11:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9EE883108; Fri, 11 Mar 2022 20:11:11 +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="gTd9QeE5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ACD3C8340A; Fri, 11 Mar 2022 20:11:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (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 C52A58390E for ; Fri, 11 Mar 2022 20:11:02 +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-qv1-xf29.google.com with SMTP id kl20so7679760qvb.10 for ; Fri, 11 Mar 2022 11:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5FJRXkLZoRDcQMDs8ayORw1zb1bjNzyTw7z5ev2KgL4=; b=gTd9QeE5GEXXQvmf+dv88hksNpji87rqfc1LTn4Ia5hsXCM1dZLNaWXbfbND2lMewn f2g9jPTXL9zT2JFbMsHtE5vlWymkBh6/CwmDtcbx2bPzd7xU5eZ8bwMBgZNG4miDp5B4 264h6+sBKTq6mG66n8zSXkLcch3IqtSMRR4Pk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5FJRXkLZoRDcQMDs8ayORw1zb1bjNzyTw7z5ev2KgL4=; b=BcOk8XsL9FJhcI7wdWOmaBhGogigkfh2NrEIPDyi5dcwpaPk2wNJW6S2UfFDfLaTvc OGccjvGUqlHXdxTDaNavXOZcJ+Vm7bQo+Tr8AWBfVam8i6XWSh1HXeYSQD1rKjpQD5pv 3YyxVdtDEKYy3dS8Y9mSLGZa5BOa68yj7GiIZFekI1ICPyUrclD/fodF/BoknrdOEqiu fdxHNlzmkiQFf9Wz/G4NfWPeQiY5IBQy9vlnD6nzIgb5OC7KC8FhLeaxojKMgr12jCih 1o43B/EJnW9EUEgZ9J19BBa5280XEH3jRBU1GwDcnj/tsUBnPSG+AseNI0ikK0/+xTz/ Vv6g== X-Gm-Message-State: AOAM532k69SwYeVEKzywhn4h9Wx/fueu+Zbty1ejgc1Mg8oHqFeNP3wo iU4F20nUXS3eiD11Xlid4W4jJYYepWM6ww== X-Google-Smtp-Source: ABdhPJxeNVmB8ugW2fpzWJ/lOxMO8C27bRguQQGMZqKdobr1coz8yX/jtSzk18uZ74MXaO/vJXAHwA== X-Received: by 2002:a05:6214:c22:b0:42c:2887:3b0b with SMTP id a2-20020a0562140c2200b0042c28873b0bmr2105011qvd.99.1647025861432; Fri, 11 Mar 2022 11:11:01 -0800 (PST) Received: from sjg1.unitedwifi.com ([205.220.129.24]) by smtp.gmail.com with ESMTPSA id b21-20020a05620a04f500b0067b4895472esm4335425qkh.5.2022.03.11.11.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 11:11:00 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , AKASHI Takahiro , Simon Glass , Heinrich Schuchardt , Patrick Delaunay , Wolfgang Denk Subject: [PATCH 1/5] disk: Add an option for partitions in SPL Date: Fri, 11 Mar 2022 12:10:01 -0700 Message-Id: <20220311191005.364540-2-sjg@chromium.org> X-Mailer: git-send-email 2.35.1.723.g4982287a31-goog In-Reply-To: <20220311191005.364540-1-sjg@chromium.org> References: <20220311191005.364540-1-sjg@chromium.org> MIME-Version: 1.0 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.5 at phobos.denx.de X-Virus-Status: Clean In some cases we do not want to enable partition support in SPL. Add an option to allow this. Signed-off-by: Simon Glass --- disk/Kconfig | 24 ++++++++++++++++++++---- disk/Makefile | 6 +++--- drivers/block/blk-uclass.c | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/disk/Kconfig b/disk/Kconfig index cee16a80bc2..13700322e97 100644 --- a/disk/Kconfig +++ b/disk/Kconfig @@ -4,10 +4,6 @@ menu "Partition Types" config PARTITIONS bool "Enable Partition Labels (disklabels) support" default y - select SPL_SPRINTF if SPL - select TPL_SPRINTF if TPL - select SPL_STRTO if SPL - select TPL_STRTO if TPL help Partition Labels (disklabels) Supported: Zero or more of the following: @@ -23,6 +19,26 @@ config PARTITIONS you must configure support for at least one non-MTD partition type as well. +config SPL_PARTITIONS + bool "Enable Partition Labels (disklabels) support in SPL" + default y if PARTITIONS + select SPL_SPRINTF + select SPL_STRTO + help + Enable this for base partition support in SPL. The required + partition table types shold be enabled separately. This add a + small amount of size to SPL, typically 500 bytes. + +config TPL_PARTITIONS + bool "Enable Partition Labels (disklabels) support in TPL" + default y if PARTITIONS + select TPL_SPRINTF + select TPL_STRTO + help + Enable this for base partition support in SPL. The required + partition table types shold be enabled separately. This add a + small amount of size to SPL, typically 500 bytes. + config MAC_PARTITION bool "Enable Apple's MacOS partition table" depends on PARTITIONS diff --git a/disk/Makefile b/disk/Makefile index ec37b74f5f4..ffd7b07f867 100644 --- a/disk/Makefile +++ b/disk/Makefile @@ -5,9 +5,9 @@ #ccflags-y += -DET_DEBUG -DDEBUG -obj-$(CONFIG_PARTITIONS) += part.o -ifdef CONFIG_$(SPL_)BLK -obj-$(CONFIG_PARTITIONS) += disk-uclass.o +obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += part.o +ifdef CONFIG_$(SPL_TPL_)BLK +obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += disk-uclass.o endif obj-$(CONFIG_$(SPL_)MAC_PARTITION) += part_mac.o obj-$(CONFIG_$(SPL_)DOS_PARTITION) += part_dos.o diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 58dc74e71f1..bcd18ed38b2 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -712,7 +712,7 @@ int blk_unbind_all(int if_type) static int blk_post_probe(struct udevice *dev) { - if (IS_ENABLED(CONFIG_PARTITIONS) && + if (CONFIG_IS_ENABLED(PARTITIONS) && IS_ENABLED(CONFIG_HAVE_BLOCK_DEVICE)) { struct blk_desc *desc = dev_get_uclass_plat(dev);