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 5C82DC433F5 for ; Wed, 25 May 2022 07:41:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77343842DB; Wed, 25 May 2022 09:41:25 +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=1653464486; bh=RGg5eROrxx4MY8St8yPWYfEBEtOO3wh1D0tZskD5G6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kI1L92XVmpNlWB/lFUoKlvC7l2bC4vVij0teDpDFRgjCD9tPternKfdW538gtqUMq skxDaRbjXOhhlV0zG3C1JEo/ahOTVU+UFySRMFSm4htO6xuQTBUyaa1rmUFNEZCDg1 3oBICZBxg4LD9QXl3HzGXfEmcer84aBBXM8mjewPnQOlhXUmg2UMOSCOwtvN+8A4db WiVJ+0N/wT9Q2HFqOpch4KNhfQVuZDqRW4ospuuoKcnVAHUQbXMY+rm4uEPfYf6+FW SbxPIYkXb4dXpJyR0XFW50dKxmgy8g01ITf5eO15aLwATNevuDLtVkWUHxbgWnHNHF Q0bOt6UiIymjg== Received: by phobos.denx.de (Postfix, from userid 109) id 5DC3583E65; Wed, 25 May 2022 09:40:33 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [91.198.250.252]) (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 12ED1842C2 for ; Wed, 25 May 2022 09:40:25 +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 smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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 4L7NJk6pVwz9sTQ; Wed, 25 May 2022 09:40:22 +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 6/7] sandbox: Add cyclic demo function Date: Wed, 25 May 2022 09:40:18 +0200 Message-Id: <20220525074019.946607-7-sr@denx.de> In-Reply-To: <20220525074019.946607-1-sr@denx.de> References: <20220525074019.946607-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.5 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 --- board/sandbox/sandbox.c | 15 +++++++++++++++ configs/sandbox_defconfig | 2 ++ 2 files changed, 17 insertions(+) diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index e054f300c4a5..3b48c9bf8cbb 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -16,6 +17,7 @@ #include #include #include +#include #include #include @@ -105,8 +107,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 c509a924e6b3..601c5dfe5a51 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -32,6 +32,7 @@ CONFIG_CONSOLE_RECORD_OUT_SIZE=0x6000 CONFIG_PRE_CONSOLE_BUFFER=y CONFIG_LOG=y CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_CYCLIC=y CONFIG_STACKPROTECTOR=y CONFIG_ANDROID_AB=y CONFIG_CMD_CPU=y @@ -111,6 +112,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.36.1