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 8AEE1C04A68 for ; Thu, 28 Jul 2022 07:10:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B365841D7; Thu, 28 Jul 2022 09:09:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1658992197; bh=oanSXWKKd+LAYbCry3RIXBnph/gexaaOHq0f3E4xN6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=epx53lmG5F/lN8KzlGsTg7eBKHmf+CnP5M9CtsFik+H79MDia6JAzZ9xGizjQ+5JW 9sf1zz/DnXn580dNNmziUv2D74A1UeVMCERUDuuU1Dws90jehxNIvtw8xFs0UdwCcP 9+PjFe2bn4xFRnEAe09zZVmYKed6x4HaVX4D6fTIuq7YKwBgDXIvtg3OKppzcGAz6V tXwjMuu4iVR3lqxz8zskrIHeRjlZ7BwR2/qcvnS/5GNkcWpDEKBEH2aDZ+u7YOAL1T tC6pra91VFkevUknggb6BBk1F3u+AdMslklWZ+Pe9THjdAl47p4MWyFTjYyhovq0QV 259MJTFiyFgJg== Received: by phobos.denx.de (Postfix, from userid 109) id EA0F284117; Thu, 28 Jul 2022 09:09:43 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 471E28414F for ; Thu, 28 Jul 2022 09:09:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Lthbk2CwSz9swP; Thu, 28 Jul 2022 09:09:38 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, cchavva@marvell.com, awilliams@marvell.com Subject: [PATCH v2 6/7] sandbox: Add cyclic demo function Date: Thu, 28 Jul 2022 09:09:33 +0200 Message-Id: <20220728070934.641674-7-sr@denx.de> In-Reply-To: <20220728070934.641674-1-sr@denx.de> References: <20220728070934.641674-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Lthbk2CwSz9swP 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.6 at phobos.denx.de X-Virus-Status: Clean This patch enables the cyclic infrastructure on sandbox and also adds one simple example/demo functions using this cyclic functionality. Signed-off-by: Stefan Roese --- v2: - Extend CONFIG_CYCLIC_MAX_CPU_TIME_US to 10000ms as running this in CI might take a bit longer board/sandbox/sandbox.c | 15 +++++++++++++++ configs/sandbox_defconfig | 3 +++ 2 files changed, 18 insertions(+) diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index ca9a2ca5b17c..8dda4b5f4fc9 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -17,6 +18,7 @@ #include #include #include +#include #include #include @@ -106,8 +108,21 @@ int dram_init(void) return 0; } +static void cyclic_demo(void *ctx) +{ + /* Just a small dummy delay here */ + udelay(10); +} + int board_init(void) { + struct cyclic_struct *cyclic; + + /* Register demo cyclic function */ + cyclic = cyclic_register(cyclic_demo, 10 * 1000, "cyclic_demo", NULL); + if (!cyclic) + printf("Registering of cyclic_demo failed\n"); + return 0; } diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index eba7bcbb483b..8b6c003760f2 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -34,6 +34,8 @@ CONFIG_LOG=y CONFIG_LOG_MAX_LEVEL=9 CONFIG_LOG_DEFAULT_LEVEL=6 CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_CYCLIC=y +CONFIG_CYCLIC_MAX_CPU_TIME_US=10000 CONFIG_STACKPROTECTOR=y CONFIG_ANDROID_AB=y CONFIG_CMD_CPU=y @@ -114,6 +116,7 @@ CONFIG_CMD_EROFS=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_SQUASHFS=y CONFIG_CMD_MTDPARTS=y +CONFIG_CMD_CYCLIC=y CONFIG_CMD_STACKPROTECTOR_TEST=y CONFIG_MAC_PARTITION=y CONFIG_AMIGA_PARTITION=y -- 2.37.1