From mboxrd@z Thu Jan 1 00:00:00 1970 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 48CF5C00140 for ; Fri, 5 Aug 2022 14:26:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA6618485E; Fri, 5 Aug 2022 16:26:19 +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=1659709580; bh=ZLdRWBYfGHimqBhz4Z7Cq+7GoBTBSuAI6F/g7+thSwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CJa9y+9aKPOeUBx7ehIL7Q0p9en5GSeWsOyKqa4bHDams9uymL23lkoMZvMRzoHVY i17tTyCXAZ2ZkPwTg5QFzBLIpWAq68cDFwxUKB/VcQY4kXZphyBSGD/qG2ThBWT7MM 690xqGXvhwT4YNJ3wXk3DlHXbJ4ok1YJRBDlb/OjpJ+tUMI9LVJtSLOyiHltRrNLaV NqBY3sh5XiM9oTtnPY3wB0xTb5jh0s3d7TlDNgeSBwIllQSnCfMc6VLSQcVLi0uz0i spQczzmBtrUCEz62wrpECfeVsWDm233u8bJqu2fWRYM4WvWkYsZkc/EQYvGfkgvmTU YYk25QJzl2O2g== Received: by phobos.denx.de (Postfix, from userid 109) id 6C49884855; Fri, 5 Aug 2022 16:26:18 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [80.241.59.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 7E2CD8482D for ; Fri, 5 Aug 2022 16:26:16 +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 4Lznvp4Z06z9sSS; Fri, 5 Aug 2022 16:26:14 +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 v3 6/8] sandbox: Add cyclic demo function Date: Fri, 5 Aug 2022 16:26:08 +0200 Message-Id: <20220805142610.375427-7-sr@denx.de> In-Reply-To: <20220805142610.375427-1-sr@denx.de> References: <20220805142610.375427-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Lznvp4Z06z9sSS 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 --- v3: - No change 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