From patchwork Wed Jun 5 19:21:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1944139 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=lQIv3bVp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvdB013g6z20WK for ; Thu, 6 Jun 2024 05:41:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C06AB884E7; Wed, 5 Jun 2024 21:37:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lQIv3bVp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AAA0A88354; Wed, 5 Jun 2024 21:22:10 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 B17F68836C for ; Wed, 5 Jun 2024 21:22:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ansuelsmth@gmail.com Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4213870aafdso2242095e9.2 for ; Wed, 05 Jun 2024 12:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717615328; x=1718220128; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=uXkXlxaFoE7EdVjfBeOn9iAr3jACb605iugKm19iiDE=; b=lQIv3bVpIvffDEOC9QexJH0yaRXo0V6nuHcCT371hDzpt3OfGWBXCeu6u8+KWp+ojt 81c2e16anhjkXw0hQ4Hiks+a9s+Sz4oMN2Y64Tlo+CiHPRkF4Nk0oY4nshI+h9gJlVcU 28MDr8DzaMs2PlmVZ405DLqcUzVxOkf42sExCMvPs3VgOrufFYWtFglxARjuZjhe9Eyp IwYbR0NEyC3GxrqI2PDiWNvmrmB3kxmcTQvqQNJ3FkX4Xn+TW2izZO5BtZekcipeQ+IB End0WJmyM3cq6mNtLh2lYk8j0Pt336aeQSFhthm8z2/qhfdAuPdQ+DvHksjqSSvEA9ar tfDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717615328; x=1718220128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uXkXlxaFoE7EdVjfBeOn9iAr3jACb605iugKm19iiDE=; b=EOxx5sspQPXF2bjmbFSVhdH9elTzFzuT4XDvl+wCi7mTJsQ2tUydWB7vTVy5e2lBP9 UjtZEMdVztgU0zxDCl/hObdcR460/3ljDPmhbS/B/QdalExzgHGz5+wdJNSGqjz5GLeF qcnexBdg8Tcv76CmSnNXiXr+NCqvOzEbVhmZy0BjND4qdNdqEH+AO75r8vBqfOQUCNEl bHOHW3LeHmMPNJGt1CMcfz9nC+ng9yqqPJep2rVX9M9LtL5fmMncrryyDWfSBve+ub1z WcbsuWMPDihZv9f/KXcmsXgk/nKEEdah1gOvPHT+ynFDWl61ENI4csAyg2XxQvgeIf0X HBvQ== X-Forwarded-Encrypted: i=1; AJvYcCXXE0k7AnUdMDMi4zdJ9xuTkXRlIF0YTn5iU3jPHuwCVOQ8fiJcH/q3NAACAchaUF6ONdMacfwtXlBYQKlqkjptH5BQrA== X-Gm-Message-State: AOJu0YwlpsE3Yac3uzn8YOzDsbe3PXS2fG7TgUJKOmtKbqrpoSc4hnRr M22Bm+qsNEiRZaAeocVFjq1iXUPI9Ff+/DghlqqwefHk+OfuuNhn X-Google-Smtp-Source: AGHT+IErBhjLsRxsMG74ZnVXIuy6g++nKkoDlCz82M9dDcJzW9H8oUZp6W3oAh5397d34nLRCaLFTQ== X-Received: by 2002:a05:600c:458e:b0:420:2986:ccee with SMTP id 5b1f17b1804b1-4215633febamr27014155e9.30.1717615328083; Wed, 05 Jun 2024 12:22:08 -0700 (PDT) Received: from localhost.localdomain (93-34-90-105.ip49.fastwebnet.it. [93.34.90.105]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-4214bf5994csm36079625e9.1.2024.06.05.12.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 12:22:07 -0700 (PDT) From: Christian Marangi To: Tom Rini , Dario Binacchi , Michael Trimarchi , Frieder Schrempf , Jagan Teki , Vignesh R , Joe Hershberger , Ramon Fried , Christian Marangi , Arseniy Krasnov , Miquel Raynal , Simon Glass , Heinrich Schuchardt , Dmitry Dunaev , Devarsh Thakkar , Bin Meng , Eugene Uriev , Nikhil M Jain , Shiji Yang , Raymond Mao , Rasmus Villemoes , Doug Zobel , William Zhang , Mikhail Kshevetskiy , Igor Prusov , Bruce Suen , Takahiro Kuwano , Pratyush Yadav , Venkatesh Yadav Abbarapu , Vaishnav Achath , AKASHI Takahiro , u-boot@lists.denx.de Subject: [PATCH 7/7] ubi: implement support for LED status activity Date: Wed, 5 Jun 2024 21:21:39 +0200 Message-ID: <20240605192146.19052-8-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240605192146.19052-1-ansuelsmth@gmail.com> References: <20240605192146.19052-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 05 Jun 2024 21:37:35 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean Implement support for LED status activity. If the feature is enabled, make the defined ACTIVITY LED to signal ubi write operation. Signed-off-by: Christian Marangi --- cmd/ubi.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cmd/ubi.c b/cmd/ubi.c index 0a6a80bdd10..c300f1dc853 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -417,7 +418,21 @@ int ubi_volume_begin_write(char *volume, void *buf, size_t size, int ubi_volume_write(char *volume, void *buf, size_t size) { - return ubi_volume_begin_write(volume, buf, size, size); + int ret; + +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_set(CONFIG_LED_STATUS_ACTIVITY, + CONFIG_LED_STATUS_BLINKING); +#endif + + ret = ubi_volume_begin_write(volume, buf, size, size); + +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_set(CONFIG_LED_STATUS_ACTIVITY, + CONFIG_LED_STATUS_OFF); +#endif + + return ret; } int ubi_volume_read(char *volume, char *buf, size_t size)