All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Tom Rini <trini@konsulko.com>,
	Chandrakala Chavva <cchavva@marvell.com>,
	Aaron Williams <awilliams@marvell.com>
Subject: Re: [PATCH v4 6/9] sandbox: Add cyclic demo function
Date: Tue, 16 Aug 2022 16:52:56 +0200	[thread overview]
Message-ID: <54709fd1-adc4-89ce-6d12-c2318c3b0fa9@denx.de> (raw)
In-Reply-To: <CAPnjgZ2n6QJM=YoxHzXO8oAPjwANPgrNxK9Ndeh15Gy4fix=BQ@mail.gmail.com>

Hi Simon,

On 16.08.22 13:48, Simon Glass wrote:
> Hi Stefan,
> 
> On Tue, 16 Aug 2022 at 04:28, Stefan Roese <sr@denx.de> wrote:
>>
>> 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 <sr@denx.de>
>> ---
>> 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(+)
> 
> Now that we have the test, do we need this?

Frankly, I did not think about this before.

> Or perhaps it should be a
> 'cyclic demo' command?

Yes, this could make sense, if we drop this sandbox implementation.
Let me think a bit about it...

Thanks,
Stefan

>>
>> 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 <addr_map.h>
>>   #include <cpu_func.h>
>>   #include <cros_ec.h>
>> +#include <cyclic.h>
>>   #include <dm.h>
>>   #include <efi.h>
>>   #include <efi_loader.h>
>> @@ -17,6 +18,7 @@
>>   #include <asm/global_data.h>
>>   #include <asm/test.h>
>>   #include <asm/u-boot-sandbox.h>
>> +#include <linux/delay.h>
>>   #include <linux/kernel.h>
>>   #include <malloc.h>
>>
>> @@ -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
>>
> 
> Regards,
> Simon

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

  reply	other threads:[~2022-08-16 14:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 10:28 [PATCH v4 0/9] Add support for cyclic function execution infrastruture Stefan Roese
2022-08-16 10:28 ` [PATCH v4 1/9] time: Import time_after64() and friends from Linux Stefan Roese
2022-08-16 10:28 ` [PATCH v4 2/9] cyclic: Add basic support for cyclic function execution infrastruture Stefan Roese
2022-08-16 10:28 ` [PATCH v4 3/9] cyclic: Integrate cyclic infrastructure into WATCHDOG_RESET Stefan Roese
2022-08-16 10:28 ` [PATCH v4 4/9] cyclic: Integrate cyclic functionality at bootup in board_r/f Stefan Roese
2022-08-16 10:28 ` [PATCH v4 5/9] cyclic: Add 'cyclic list' command Stefan Roese
2022-08-16 10:28 ` [PATCH v4 6/9] sandbox: Add cyclic demo function Stefan Roese
2022-08-16 11:48   ` Simon Glass
2022-08-16 14:52     ` Stefan Roese [this message]
2022-08-16 10:28 ` [PATCH v4 7/9] mips: octeon_nic23: Add PCIe FLR fixup via cyclic infrastructure Stefan Roese
2022-08-16 10:28 ` [PATCH v4 8/9] cyclic: Add documentation Stefan Roese
2022-08-16 10:28 ` [PATCH v4 9/9] cyclic: Add a simple test Stefan Roese
2022-08-16 11:48   ` Simon Glass
2022-08-16 12:29     ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54709fd1-adc4-89ce-6d12-c2318c3b0fa9@denx.de \
    --to=sr@denx.de \
    --cc=awilliams@marvell.com \
    --cc=cchavva@marvell.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.