From patchwork Thu Jul 25 17:11:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 1137022 X-Patchwork-Delegate: trini@ti.com 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=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Lj4VtFGT"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45vf0J5WXkz9s8m for ; Fri, 26 Jul 2019 03:12:14 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 36825C21D74; Thu, 25 Jul 2019 17:12:06 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 98FF6C21C27; Thu, 25 Jul 2019 17:12:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1F5A3C21C27; Thu, 25 Jul 2019 17:12:03 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id 65099C21BE5 for ; Thu, 25 Jul 2019 17:12:02 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id l21so23352514pgm.3 for ; Thu, 25 Jul 2019 10:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8bY0TUBabg5J9GVqRtQtqDwxb9SQAKyT5WL0EtLh1B0=; b=Lj4VtFGTOF+lIf9PYYQqMQqk75I1os8QRPGBDM+3QnNPV1P0CXqR55u8KUjhPMvm8n wbsarA17E5zdYb/IKBJTKtzAksLIbh4zwF33SCMRGhY6q9MZjoNpsWIZBsEQD9AtEpFf K7UB7goriObHVpqHrVkp2qNp5Xqv7YAtVDcosPxSAWCVhyH4t6kP0oVA0HZ1foUqAFny jm5Dt9dLUJs6IHr75bhTeLDTrzoYRI4Bn877q5zLQuAjxLzITa7Qn0J7T2LctzPka1Ir cbpOgEr1mBR/Uh5HAAcb89qOKRT6rUKU62Zq2hSL3R/Ocs06UKAkQFMk8UJtGwElx/NH f23g== 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:mime-version :content-transfer-encoding; bh=8bY0TUBabg5J9GVqRtQtqDwxb9SQAKyT5WL0EtLh1B0=; b=kM3Irs684w6YMk6qjOMq0kWufDbL5DqDdHzvO5uDqJi+q21G7WdY0HNCbwnM/42qNw 8d2YR7ebNEtLzV0GkSQD+KYgXmRkhpX2dt65XmAzzbD8wSOcUKHI2uEGcDa0oRw3KQGD 7NoqRDvvIn2FYmLFkVc3tHUFKYs0bxblXfS7hUWIPRKMZH5s+x0UQAooZgq1QtTBA0yL ogeVuzi2uqSuM1pu4mZCFhMw9jL5Lde7hi8h2JzbxPL3IiQrKyUGS3nuDKBh7NAMHVFH a1EZuuGhwfVDBGzivzZN7iN5Hw421PqwYk7RNIFdmqgfTkLgVyer2uJ+gihWYD4EaUJW zoNQ== X-Gm-Message-State: APjAAAVYLD+8xAR4TixbTk46lWCS8P87BEHvfDmmMhkbx0ARlJcm6Nuy QL0wcyHxbuBpvODgaOJ6Po/6MFZHl6BlwA== X-Google-Smtp-Source: APXvYqw7WYPLcqGouw4CkxNZzEJei2mkT0MDG3kmTTAJGeV7kZxDo9bQybcEUs5z81M4rq0wykxn0A== X-Received: by 2002:aa7:9513:: with SMTP id b19mr17757823pfp.30.1564074720220; Thu, 25 Jul 2019 10:12:00 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id b29sm83751976pfr.159.2019.07.25.10.11.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 10:11:59 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Thu, 25 Jul 2019 20:11:53 +0300 Message-Id: <20190725171153.11534-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Praneeth Bajjuri , Tom Rini Subject: [U-Boot] [PATCH v2] omap: Correct the fastboot product var 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" "fastboot flashall" expects "fastboot getvar product" value to be one of values provided in android-info.txt file (in AOSP), from "require board=" list. Before this patch, "am57xx" is returned for all AM57xx based boards, as it's set in $board env var from SYS_BOARD in board/ti/am57xx/Kconfig file, which is used for default implementation of "fastboot getvar product". In order to fix that inconsistency, let's do next: 1. In U-Boot: override fastboot.product, reusing the value from $board_name 2. In AOSP: provide values for all AM57xx boards we can use to device/ti/beagle_x15/board-info.txt file This way requirements check in "fastboot flashall" will work as expected, verifying that user tries to flash images to the board which those images were built for. Signed-off-by: Sam Protsenko Acked-by: Andrew F. Davis --- Changes in v2: - reuse the value from $board_name instead of hard-coding it to "beagle_x15board" (corresponding changes will be done in AOSP) arch/arm/mach-omap2/utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c index edf5edcb68..7d01446940 100644 --- a/arch/arm/mach-omap2/utils.c +++ b/arch/arm/mach-omap2/utils.c @@ -129,12 +129,25 @@ static inline void omap_set_fastboot_userdata_size(void) { } #endif /* CONFIG_FASTBOOT_FLASH_MMC */ + +static void omap_set_fastboot_product(void) +{ + const char *board_name; + + board_name = env_get("board_name"); + if (board_name == NULL) + printf("Warning: fastboot.product: unknown board\n"); + + env_set("fastboot.product", board_name); +} + void omap_set_fastboot_vars(void) { omap_set_fastboot_cpu(); omap_set_fastboot_secure(); omap_set_fastboot_board_rev(); omap_set_fastboot_userdata_size(); + omap_set_fastboot_product(); } #endif /* CONFIG_FASTBOOT_FLASH */