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 BA5EAC2BB41 for ; Tue, 16 Aug 2022 10:28:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6E1A284994; Tue, 16 Aug 2022 12:28:37 +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=1660645717; bh=VoP3UD40WczdVVE/RVI0G9hyalJu8hVnop4eBX9sdv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RzR8YrHrXjM694Lie6klZK1g3eIoqJh5+nhUlEnstY1eoPLTP7Y9bS2zV2F9fOAHl LOqB6or7fNNTebLXNpP7jt7bnE5ImKDlf9v27LjNC1p/Aa105nVqP6tPTVr9HVDz9/ cd138FhvjHMK1+z6WWaeMlpG+cYU4/d6Ps3amuI7YHryyjQslt3Dy1XR/S7sMLWtUT +7t3Pe/iISENdhv+UuyWZH/A364/1OYTJgvdgiPtRj5ka/sdjHXeDxb/+rHjiiX32z QczSP3qsa34fJlmQyCEQ5uIL0JoSJSFAslO91HCQpJM+OimGhpJI6MVuNoyGYUEEXa cyNuc890PMUwQ== Received: by phobos.denx.de (Postfix, from userid 109) id 24E64848DC; Tue, 16 Aug 2022 12:28:26 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [80.241.59.207]) (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 B4F72844ED for ; Tue, 16 Aug 2022 12:28:23 +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 [10.196.197.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-107.mailbox.org (Postfix) with ESMTPS id 4M6S6F6rS5z9sQy; Tue, 16 Aug 2022 12:28:21 +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 v4 6/9] sandbox: Add cyclic demo function Date: Tue, 16 Aug 2022 12:28:13 +0200 Message-Id: <20220816102816.2938010-7-sr@denx.de> In-Reply-To: <20220816102816.2938010-1-sr@denx.de> References: <20220816102816.2938010-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- v4: - Rename cyclic_struct to cyclic_info 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..f633b8e63768 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_info *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.2