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 B120FC433EF for ; Wed, 9 Feb 2022 15:41:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8266183E86; Wed, 9 Feb 2022 16:41:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gin.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B116E83E86; Wed, 9 Feb 2022 15:55:05 +0100 (CET) Received: from good-out-26.clustermail.de (good-out-26.clustermail.de [IPv6:2a02:708:0:2c::16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4C43183E65 for ; Wed, 9 Feb 2022 15:55:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gin.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Daniel.Klauer@gin.de Received: from [10.0.0.9] (helo=frontend.clustermail.de) by smtpout-02.clustermail.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nHoMw-0000s7-To for u-boot@lists.denx.de; Wed, 09 Feb 2022 15:55:01 +0100 Received: from [217.6.33.237] (helo=Win2012-02.gin-domain.local) by frontend.clustermail.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 (Exim 4.94.2) (envelope-from ) id 1nHoMw-0000iY-S5 for u-boot@lists.denx.de; Wed, 09 Feb 2022 15:54:54 +0100 Received: from daniel-desktop2.fritz.box (10.176.8.31) by Win2012-02.gin-domain.local (10.160.128.12) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Wed, 9 Feb 2022 15:54:54 +0100 From: Daniel Klauer To: Subject: [PATCH] lx2160a: Fix distroboot device list for configs without USB/SCSI/etc Date: Wed, 9 Feb 2022 15:53:41 +0100 Message-ID: <20220209145341.247936-1-daniel.klauer@gin.de> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.176.8.31] X-ClientProxiedBy: Win2012-02.gin-domain.local (10.160.128.12) To Win2012-02.gin-domain.local (10.160.128.12) X-EsetResult: clean, is OK X-EsetId: 37303A29342AAB53617062 X-Mailman-Approved-At: Wed, 09 Feb 2022 16:41:09 +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.5 at phobos.denx.de X-Virus-Status: Clean The BOOT_TARGET_DEVICES list for distro_bootcmd was hard-coded to assume that all boot devices are available/enabled in the configuration, thus ignoring the actual config settings. The config_distro_bootcmd.h header file specifically has compile-time checks to detect such problems. To allow disabling USB, SCSI, etc. in custom lx2160a board configs, make it depend on the config settings and use only the enabled features. Signed-off-by: Daniel Klauer --- include/configs/lx2160a_common.h | 34 +++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h index e285109cbb..fb95323f43 100644 --- a/include/configs/lx2160a_common.h +++ b/include/configs/lx2160a_common.h @@ -250,12 +250,36 @@ "run distro_bootcmd;run sd2_bootcmd;" \ "env exists secureboot && esbc_halt;" +#ifdef CONFIG_CMD_USB +#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) +#else +#define BOOT_TARGET_DEVICES_USB(func) +#endif + +#ifdef CONFIG_MMC +#define BOOT_TARGET_DEVICES_MMC(func, instance) func(MMC, mmc, instance) +#else +#define BOOT_TARGET_DEVICES_MMC(func) +#endif + +#ifdef CONFIG_SCSI +#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0) +#else +#define BOOT_TARGET_DEVICES_SCSI(func) +#endif + +#ifdef CONFIG_CMD_DHCP +#define BOOT_TARGET_DEVICES_DHCP(func) func(DHCP, dhcp, na) +#else +#define BOOT_TARGET_DEVICES_DHCP(func) +#endif + #define BOOT_TARGET_DEVICES(func) \ - func(USB, usb, 0) \ - func(MMC, mmc, 0) \ - func(MMC, mmc, 1) \ - func(SCSI, scsi, 0) \ - func(DHCP, dhcp, na) + BOOT_TARGET_DEVICES_USB(func) \ + BOOT_TARGET_DEVICES_MMC(func, 0) \ + BOOT_TARGET_DEVICES_MMC(func, 1) \ + BOOT_TARGET_DEVICES_SCSI(func) \ + BOOT_TARGET_DEVICES_DHCP(func) #include #endif /* __LX2_COMMON_H */ -- 2.32.0