From patchwork Tue May 22 09:23:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 918106 X-Patchwork-Delegate: lukma@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S1ybCNod"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40qqzB6t2vz9s4q for ; Tue, 22 May 2018 19:26:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3D334C21EA7; Tue, 22 May 2018 09:26:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 63274C21DB5; Tue, 22 May 2018 09:25:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BB90DC21C6A; Tue, 22 May 2018 09:25:00 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id 67B7CC21C2F for ; Tue, 22 May 2018 09:25:00 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id w15-v6so11293525wrp.8 for ; Tue, 22 May 2018 02:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zTESWU2EeAtUE/MWJLSAEtGQaoGsNk7TggcAHY8uvPQ=; b=S1ybCNod7Z1ey4Mw89YbTIJvKawGJBd4HDrrJG1gTFI/uuHynr2EQrCOsXaXCvrurS QlGFgxTM8a5mg9EtFXZiPGZdXUevDyXJuiBf8P9jucEJQ0e5l0gaFDgETf7yVjRbdaFL VqEwa+Pswv6b0jx/2LL4D1HV3kBknEBi3abxkiRKgFG9VPKnOjiGVLsk2OEgxnZr3sx2 wYrNQ9U2k946Zj0aD4MFY+YSVlncNIZqlp/HgUSEFUtoyaidnXLPbHl7w1GONkvn5QYM nxf1U+/g+AXS1ztMEkM3iqpXEv5XRjy4K4IZwJCE7S0ME8BdGBzl9ipBdmecDa7S2+9G vsuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zTESWU2EeAtUE/MWJLSAEtGQaoGsNk7TggcAHY8uvPQ=; b=VhcX9BO/WeTeQlVolxxw66bFFQbb6hAJ4VsIf4PHqS/B1DqUq1XfLDp2vdCgXubwvE yMXrDn9qyyfJUzu6tphl3U9mflZtM1fOo/OXkygGESS1ufbvAWA/dz/f1Y0ehS5VQYNp Q9IfYltFaSJN2CUmPJIFuU91p0T/ohKddgRpylJrSJMpr3AsCZI/KWxhybgcsc26yzxL UBYobx+2ZKY1bZdMxTCTD5fvVIaZnOVAxgAKyRvTuKkCIDx8k0oRulJWE9JbXLArZfZD 95GNbE6dSvJxx/LZvc6Vd5LkeRD7nxJin/wA0VLa49tyOOOA5xK+KeArSi534Zjl8o/v fyAQ== X-Gm-Message-State: ALKqPwfxFyp5kUJteV3lChSF6i77hHWd7wwFtrfydCjC35vJFxORA+7s Z/lpd1icPTMwhaSekMrAYXrxotO5T68= X-Google-Smtp-Source: AB8JxZrFtnSNx6jM3O10TElzu0iPCo/vAI4bNcSQPB+zw7u/EH26dJaZaB2ZxoKBbUzv+JjEHTnoTQ== X-Received: by 2002:adf:8212:: with SMTP id 18-v6mr17641415wrb.144.1526981099877; Tue, 22 May 2018 02:24:59 -0700 (PDT) Received: from localhost.localdomain (193.164.125.18.ip.redstone-isp.net. [193.164.125.18]) by smtp.gmail.com with ESMTPSA id s7-v6sm1404418wrp.4.2018.05.22.02.24.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 02:24:59 -0700 (PDT) From: Alex Kiernan To: u-boot@lists.denx.de, Joe Hershberger Date: Tue, 22 May 2018 09:23:38 +0000 Message-Id: <20180522092352.19794-5-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180522092352.19794-1-alex.kiernan@gmail.com> References: <20180522092352.19794-1-alex.kiernan@gmail.com> Cc: Marek Vasut , Benjamin Young , Jocelyn Bohr , Praneeth Bajjuri , Jocelyn Bohr , Maxime Ripard Subject: [U-Boot] [PATCH v6 04/18] fastboot: Correct dependencies in FASTBOOT_FLASH X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Ensure that when selecting FASTBOOT_FLASH you end up with a buildable configuration. Prior to this you could select NAND without MTDPARTS and end up with an image which (surprisingly) excluded NAND. Also fix dependencies on FASTBOOT_GPT_NAME/FASTBOOT_MBR_NAME which require you have EFI_PARTITION/DOS_PARTITION enabled. Delete redundant FASTBOOT_FLASH_NAND_DEV from Kconfig - it was only ever used as a guard and the value was ignored in all cases, we're using FASTBOOT_FLASH_NAND as the guard now. Signed-off-by: Alex Kiernan Reviewed-by: Joe Hershberger --- Changes in v6: - delete redundant FASTBOOT_FLASH_NAND_DEV symbol Changes in v5: None Changes in v4: None Changes in v3: - guard FASTBOOT_GPT_NAME/FASTBOOT_MBR_NAME with EFI/DOS_PARTITION Changes in v2: None arch/arm/mach-omap2/utils.c | 4 ++-- drivers/fastboot/Kconfig | 17 ++++------------- drivers/fastboot/Makefile | 8 ++------ drivers/usb/gadget/f_fastboot.c | 14 +++++++------- 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c index dc7b37f164..edf5edcb68 100644 --- a/arch/arm/mach-omap2/utils.c +++ b/arch/arm/mach-omap2/utils.c @@ -85,7 +85,7 @@ static void omap_set_fastboot_board_rev(void) env_set("fastboot.board_rev", board_rev); } -#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV +#ifdef CONFIG_FASTBOOT_FLASH_MMC static u32 omap_mmc_get_part_size(const char *part) { int res; @@ -128,7 +128,7 @@ static void omap_set_fastboot_userdata_size(void) static inline void omap_set_fastboot_userdata_size(void) { } -#endif /* CONFIG_FASTBOOT_FLASH_MMC_DEV */ +#endif /* CONFIG_FASTBOOT_FLASH_MMC */ void omap_set_fastboot_vars(void) { omap_set_fastboot_cpu(); diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index 93a8ac64e7..9bbc5c661d 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -56,6 +56,7 @@ config FASTBOOT_USB_DEV config FASTBOOT_FLASH bool "Enable FASTBOOT FLASH command" default y if ARCH_SUNXI + depends on MMC || (NAND && CMD_MTDPARTS) help The fastboot protocol includes a "flash" command for writing the downloaded image to a non-volatile storage device. Define @@ -71,7 +72,7 @@ config FASTBOOT_FLASH_MMC config FASTBOOT_FLASH_NAND bool "FASTBOOT on NAND" - depends on NAND + depends on NAND && CMD_MTDPARTS endchoice @@ -85,19 +86,9 @@ config FASTBOOT_FLASH_MMC_DEV regarding the non-volatile storage device. Define this to the eMMC device that fastboot should use to store the image. -config FASTBOOT_FLASH_NAND_DEV - int "Define FASTBOOT NAND FLASH default device" - depends on FASTBOOT_FLASH_NAND - depends on CMD_MTDPARTS - default 0 if ARCH_SUNXI && NAND_SUNXI - help - The fastboot "flash" command requires additional information - regarding the non-volatile storage device. Define this to - the NAND device that fastboot should use to store the image. - config FASTBOOT_GPT_NAME string "Target name for updating GPT" - depends on FASTBOOT_FLASH + depends on FASTBOOT_FLASH_MMC && EFI_PARTITION default "gpt" help The fastboot "flash" command supports writing the downloaded @@ -110,7 +101,7 @@ config FASTBOOT_GPT_NAME config FASTBOOT_MBR_NAME string "Target name for updating MBR" - depends on FASTBOOT_FLASH + depends on FASTBOOT_FLASH_MMC && DOS_PARTITION default "mbr" help The fastboot "flash" command allows to write the downloaded image diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile index b38dcff202..e4bd389adf 100644 --- a/drivers/fastboot/Makefile +++ b/drivers/fastboot/Makefile @@ -2,9 +2,5 @@ obj-y += fb_common.o -ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV -obj-y += fb_mmc.o -endif -ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV -obj-y += fb_nand.o -endif +obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fb_mmc.o +obj-$(CONFIG_FASTBOOT_FLASH_NAND) += fb_nand.o diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 2e6e1615bf..323ac89417 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -20,10 +20,10 @@ #include #include #include -#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV +#ifdef CONFIG_FASTBOOT_FLASH_MMC #include #endif -#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV +#ifdef CONFIG_FASTBOOT_FLASH_NAND #include #endif @@ -583,11 +583,11 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) } fastboot_fail("no flash device defined", response); -#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV +#ifdef CONFIG_FASTBOOT_FLASH_MMC fb_mmc_flash_write(cmd, (void *)CONFIG_FASTBOOT_BUF_ADDR, download_bytes, response); #endif -#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV +#ifdef CONFIG_FASTBOOT_FLASH_NAND fb_nand_flash_write(cmd, (void *)CONFIG_FASTBOOT_BUF_ADDR, download_bytes, response); #endif @@ -598,7 +598,7 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) static void cb_oem(struct usb_ep *ep, struct usb_request *req) { char *cmd = req->buf; -#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV +#ifdef CONFIG_FASTBOOT_FLASH_MMC if (strncmp("format", cmd + 4, 6) == 0) { char cmdbuf[32]; sprintf(cmdbuf, "gpt write mmc %x $partitions", @@ -631,10 +631,10 @@ static void cb_erase(struct usb_ep *ep, struct usb_request *req) } fastboot_fail("no flash device defined", response); -#ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV +#ifdef CONFIG_FASTBOOT_FLASH_MMC fb_mmc_erase(cmd, response); #endif -#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV +#ifdef CONFIG_FASTBOOT_FLASH_NAND fb_nand_erase(cmd, response); #endif fastboot_tx_write_str(response);