From patchwork Fri Aug 12 01:34:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1665738 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=GT6cgZJz; 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 (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4M3mXB2D7gz9sFs for ; Fri, 12 Aug 2022 11:38:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C0AA784AEB; Fri, 12 Aug 2022 03:35:56 +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="GT6cgZJz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 757DD84A6D; Fri, 12 Aug 2022 03:35:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 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=unavailable autolearn_force=no version=3.4.2 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) (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 C9E5584AA4 for ; Fri, 12 Aug 2022 03:35:33 +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-x236.google.com with SMTP id q184so23336347oif.1 for ; Thu, 11 Aug 2022 18:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=SALO0Mdj3dlfq44k8XRpaZeHTsjND23epqlqUJLpVMM=; b=GT6cgZJzUCGiQR1tSe69mzYmuCKkPSinmjRkq4mjLdc5uM2SGsHN9CPibzRpCkZbDN Fj1fByh+F7Y2/lx4PXFk1xXe32bTM+LW+GKjyOfFlQ9IHLqR/2yyqOFYtD52AxGfcd89 aSVCDio2tGDy33LBgNkhjF/KRjmdNlftkK/RY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=SALO0Mdj3dlfq44k8XRpaZeHTsjND23epqlqUJLpVMM=; b=dNYXMLWJkRnKA0AHa5AcX03ZOu4WATkIdv0CdYqdR8qdLLBvok1Fe5mzA8NDLunqqJ PXUousVTSwJk6maTOqDNhcG99w9ZxAHfbJeMV8FULeRVln/UsYvaA8KtlpbHY9+GX/mC BCCwx3vbRg7O28pUFsK7Q2bYozLHIBzTlJWEY5V3fQot3NiDVdcSWSNT/FeaQdgprmph ELuAq8NElQF9PEqlm4PuoyXS0Pbx6h0GVF5XptbBIYJJ89qycUqRJ0sJxCaD3IhoOYaC rZm6omlIuSef/kH1h2pmV6/ZTTMFk9bojujPUZt89ev2kWc57H0Wl6mPFHN0jq6ckHQW YwdA== X-Gm-Message-State: ACgBeo2AHjXTSyysBk7iceBhuy9OKoLMPyHjZiD16bSoB29YlRAf87Iz WhFp+0ls1GBKWcUzEKdGtor50IXkIubBPw== X-Google-Smtp-Source: AA6agR40Eyq974SdXsde/L4oJQR8u2KErTqspAWkxY42dBCC21vPJw0/0HzVohZKwti1+aQmtPbIJg== X-Received: by 2002:a05:6808:1885:b0:33a:74ac:8b79 with SMTP id bi5-20020a056808188500b0033a74ac8b79mr4802590oib.237.1660268132190; Thu, 11 Aug 2022 18:35:32 -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 x21-20020a056870b41500b0010c5005d427sm158518oap.33.2022.08.11.18.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Aug 2022 18:35:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , AKASHI Takahiro , Andrew Scull , Jaehoon Chung , Mark Kettenis , Peng Fan , Philippe Reynes , Wolfgang Denk , Ye Li Subject: [PATCH v2 05/24] disk: Use Makefile to omit partition drivers Date: Thu, 11 Aug 2022 19:34:44 -0600 Message-Id: <20220812013503.1724919-6-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.595.g718a3a8f04-goog In-Reply-To: <20220812013503.1724919-1-sjg@chromium.org> References: <20220812013503.1724919-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.6 at phobos.denx.de X-Virus-Status: Clean At present these files have an #ifdef covering the whole file. Move the condition to the Makefile instead. Add BLK to the condition since future patches will adjust things so that HAVE_BLOCK_DEVICE is only for SPL, but the partition drivers are needed in U-Boot proper too. Signed-off-by: Simon Glass --- (no changes since v1) disk/Makefile | 4 ++++ disk/part_amiga.c | 4 ---- disk/part_dos.c | 4 ---- disk/part_efi.c | 3 --- disk/part_iso.c | 3 --- disk/part_mac.c | 3 --- drivers/Makefile | 1 + 7 files changed, 5 insertions(+), 17 deletions(-) diff --git a/disk/Makefile b/disk/Makefile index ec148832b33..458e21e3fb7 100644 --- a/disk/Makefile +++ b/disk/Makefile @@ -9,8 +9,12 @@ obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += part.o ifdef CONFIG_$(SPL_TPL_)BLK obj-$(CONFIG_$(SPL_TPL_)PARTITIONS) += disk-uclass.o endif + +# Must have BLK or HAVE_BLOCK_DEVICE to support partitions +ifneq ($(CONFIG_$(SPL_TPL_)BLK),$(CONFIG_HAVE_BLOCK_DEVICE),) obj-$(CONFIG_$(SPL_TPL_)MAC_PARTITION) += part_mac.o obj-$(CONFIG_$(SPL_TPL_)DOS_PARTITION) += part_dos.o obj-$(CONFIG_$(SPL_TPL_)ISO_PARTITION) += part_iso.o obj-$(CONFIG_$(SPL_TPL_)AMIGA_PARTITION) += part_amiga.o obj-$(CONFIG_$(SPL_TPL_)EFI_PARTITION) += part_efi.o +endif diff --git a/disk/part_amiga.c b/disk/part_amiga.c index ac7ada54781..45d3a704866 100644 --- a/disk/part_amiga.c +++ b/disk/part_amiga.c @@ -11,8 +11,6 @@ #include "part_amiga.h" #include -#ifdef CONFIG_HAVE_BLOCK_DEVICE - #undef AMIGA_DEBUG #ifdef AMIGA_DEBUG @@ -387,5 +385,3 @@ U_BOOT_PART_TYPE(amiga) = { .print = part_print_amiga, .test = part_test_amiga, }; - -#endif diff --git a/disk/part_dos.c b/disk/part_dos.c index 94fae7166d7..a94702c5f34 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -23,8 +23,6 @@ #include "part_dos.h" #include -#ifdef CONFIG_HAVE_BLOCK_DEVICE - #define DOS_PART_DEFAULT_SECTOR 512 /* should this be configurable? It looks like it's not very common at all @@ -518,5 +516,3 @@ U_BOOT_PART_TYPE(dos) = { .print = part_print_ptr(part_print_dos), .test = part_test_dos, }; - -#endif diff --git a/disk/part_efi.c b/disk/part_efi.c index 5090efd1192..ad94504ed90 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -28,8 +28,6 @@ #include #include -#ifdef CONFIG_HAVE_BLOCK_DEVICE - /* GUID for basic data partitons */ #if CONFIG_IS_ENABLED(EFI_PARTITION) static const efi_guid_t partition_basic_data_guid = PARTITION_BASIC_DATA_GUID; @@ -1204,4 +1202,3 @@ U_BOOT_PART_TYPE(a_efi) = { .print = part_print_ptr(part_print_efi), .test = part_test_efi, }; -#endif /* CONFIG_HAVE_BLOCK_DEVICE */ diff --git a/disk/part_iso.c b/disk/part_iso.c index 1061f341d35..4cd619bf46d 100644 --- a/disk/part_iso.c +++ b/disk/part_iso.c @@ -12,8 +12,6 @@ #include #include "part_iso.h" -#ifdef CONFIG_HAVE_BLOCK_DEVICE - /* #define ISO_PART_DEBUG */ #ifdef ISO_PART_DEBUG @@ -241,4 +239,3 @@ U_BOOT_PART_TYPE(iso) = { .print = part_print_iso, .test = part_test_iso, }; -#endif diff --git a/disk/part_mac.c b/disk/part_mac.c index e01ae745661..ae8263f755a 100644 --- a/disk/part_mac.c +++ b/disk/part_mac.c @@ -20,8 +20,6 @@ #include "part_mac.h" #include -#ifdef CONFIG_HAVE_BLOCK_DEVICE - /* stdlib.h causes some compatibility problems; should fixe these! -- wd */ #ifndef __ldiv_t_defined typedef struct { @@ -247,4 +245,3 @@ U_BOOT_PART_TYPE(mac) = { .print = part_print_mac, .test = part_test_mac, }; -#endif diff --git a/drivers/Makefile b/drivers/Makefile index eba9940231f..f2154e15d6a 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -60,6 +60,7 @@ obj-$(CONFIG_SPL_USB_HOST) += usb/host/ obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/ obj-$(CONFIG_SPL_SATA) += ata/ scsi/ obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/ +obj-$(CONFIG_SPL_BLK) += block/ obj-$(CONFIG_SPL_THERMAL) += thermal/ endif