From patchwork Wed Jun 19 23:03:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1949906 X-Patchwork-Delegate: xypron.glpk@gmx.de 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=ZWWJleF5; 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4NKs4d3gz20X8 for ; Thu, 20 Jun 2024 11:33:21 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13ADB884D4; Thu, 20 Jun 2024 03:32:05 +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="ZWWJleF5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C2F78884CC; Thu, 20 Jun 2024 01:04:19 +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-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 DFE3888427 for ; Thu, 20 Jun 2024 01:04:17 +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-x330.google.com with SMTP id 5b1f17b1804b1-42249a4f9e4so2311975e9.2 for ; Wed, 19 Jun 2024 16:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718838257; x=1719443057; 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=Vpk7Y89IwPKGsYMfO3IDA913TgBD4Hl0+Lmy6nIGugY=; b=ZWWJleF5hl3Bo36LFSrYF/fJx2Ywg2uE0xyz4xAp+JNrENZKW0H9gMvDrAvyP/IKqQ L5Seb1ruXWYn/yApi76qkacJ87p5S0OEHUWHmXVqr+G2/iAdQCdEBf74BztBIjpyaPrq PMUqTVp6YTMUF5aGU7y7ONCLHFzmUMNk1UOu2a/zTll2PLc4Dp3M6en0gMx3k2lZYI6H wnbfrni/4vykjrfE8dKLNdIhHKC/Z21W6n6G+ydy5otsmdP7UuQ4bgFvcc+ZTI6OW8zb tIvbTLPVUQ/vnuJYpEO4JPZDi6jh1eFqUex8dLs0PN8B8+DkucjKlBLvjp3ItdS3iTZc 8HWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718838257; x=1719443057; 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=Vpk7Y89IwPKGsYMfO3IDA913TgBD4Hl0+Lmy6nIGugY=; b=hZdedncZvARP4I+OfJFiPbx3+GULC3teyXP+tTsmskkq+5HtfPHNxgMaZ6JtIYHpmr Pw4WP7RYsQ9UliXOrCXa/0QlZqfSVmlpTj4LsaxYDew0/e3IeBEWoajmLLUGEJEYGwnq VEEdLJGxxQzZVePPakQsosnpdFadEBJ8YxqHziulF4owm6xa9ghqKIoQ4/Jgs7I3Si1R H1PZIxA02yD/Zqyi9N+XsmZ6L8xOpOUMOUcOomoTzqSMP2UvL8JTRdCEVVw1elbirMuK ye/lsOggCX/9QeCJ4GMr9BOK4GVX7lGAkBlScRxn8sXBokH8kl5swVcAX2Ja9KV/VsPX F6Jw== X-Forwarded-Encrypted: i=1; AJvYcCUhdXHt6BjAYFcwWm68qSaAOU4qr24ExbRK3Gys1a9hb3miQWljYllJECBDWbOuvnfHHkQK5+1xko6p31c2bcBt6JtkRw== X-Gm-Message-State: AOJu0Yzh6B1JV+vZMGLfCuD9nondeP7fHnXsvsAWRvpZ3lEPJ3UAHfpK A+EOxBLXXTsUGCJ9XKq/JEmpARqlur5+hDOiZYAmibFb6wlZbJ68 X-Google-Smtp-Source: AGHT+IE50uPX6/dsOm08GkWzu94yAfjMsAnMI1xcI1X3xPpLcHmeyNTtO5r9UujrnmnMgmXxZgqypg== X-Received: by 2002:a05:600c:3b16:b0:424:7c14:d184 with SMTP id 5b1f17b1804b1-4247c14d33cmr5247105e9.15.1718838257339; Wed, 19 Jun 2024 16:04:17 -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-4247d0c54c9sm5410465e9.27.2024.06.19.16.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 16:04:17 -0700 (PDT) From: Christian Marangi To: Tom Rini , Joe Hershberger , Ramon Fried , Christian Marangi , Dario Binacchi , Heinrich Schuchardt , Arseniy Krasnov , Miquel Raynal , Dmitry Dunaev , Simon Glass , Devarsh Thakkar , Bin Meng , Nikhil M Jain , Shiji Yang , Raymond Mao , Leo Yu-Chi Liang , Rasmus Villemoes , Doug Zobel , u-boot@lists.denx.de, John Crispin Subject: [PATCH v4 8/9] ubi: implement support for LED status activity Date: Thu, 20 Jun 2024 01:03:26 +0200 Message-ID: <20240619230400.8459-9-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619230400.8459-1-ansuelsmth@gmail.com> References: <20240619230400.8459-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 20 Jun 2024 03:31:55 +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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmd/ubi.c b/cmd/ubi.c index 8c1b5df0572..cfc26d53d65 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -416,7 +417,19 @@ 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_activity_start(CONFIG_LED_STATUS_ACTIVITY); +#endif + + ret = ubi_volume_begin_write(volume, buf, size, size); + +#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE + status_led_activity_stop(CONFIG_LED_STATUS_ACTIVITY); +#endif + + return ret; } int ubi_volume_read(char *volume, char *buf, size_t size)