All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Staaf <robotboy@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 06/20] sandbox: Allow board_init_f() and board_init_r() to return
Date: Mon, 26 Sep 2011 12:25:51 -0700	[thread overview]
Message-ID: <CAF6FioXgYnmbp+RcqxsLJyww2j1xsq_UXK2F-t3vNF=HnhC+XQ@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ2xjikO8uM3Rk9vEGfXYgZXf3=3aJmXcQKz0GqdE+6kPw@mail.gmail.com>

On Mon, Sep 26, 2011 at 12:22 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Anton,
>
> On Mon, Sep 26, 2011 at 10:49 AM, Anton Staaf <robotboy@chromium.org> wrote:
>> On Mon, Sep 26, 2011 at 9:48 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Hi Mike,
>>>
>>> On Sun, Sep 25, 2011 at 9:47 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>>>> On Friday, September 23, 2011 11:55:11 Simon Glass wrote:
>>>>> On Sat, Sep 17, 2011 at 5:05 PM, Mike Frysinger wrote:
>>>>> > On Saturday, September 17, 2011 12:48:45 Simon Glass wrote:
>>>>> >> Since the sandbox architecture doesn't do relocation, we prefer to call
>>>>> >> board_init_r() explicitly when board_init_f() returns. Similarly we
>>>>> >> prefer to call main_loop() when board_init_r returns.
>>>>> >
>>>>> > NAK; i dont see how sandbox is special. ?just do what i do in Blackfin's
>>>>> > board.c:
>>>>> > ? ? ? ?board_init_f calls board_init_r
>>>>> > ? ? ? ?board_init_r does while (1) main_loop()
>>>>>
>>>>> I have done as you say for now, but this isn't great. It means that
>>>>> the only way back to the top level (say to run another test) is to use
>>>>> setjmp/longjmp. But I will deal with this issue when it actually comes
>>>>> up.
>>>>
>>>> i dont understand what you mean. ?the main loop allows you to process commands
>>>> forever and thus test as many commands as you want.
>>>>
>>>> if you're testing something before the main_loop, then i think it is correct
>>>> that you'd "boot" from scratch, get to the main_loop (and thus pass your
>>>> test), and then call "reset" to exit. ?if you want to test something else
>>>> before main_loop, start all over from scratch.
>>>> -mike
>>>>
>>>
>>> In short: at this stage I really don't mind what this particular patch
>>> looks like - it will become clear later.
>>>
>>> Long version: I think there might be a basic confusion here as to how
>>> this test idea is supposed to work. I think I mentioned at some point
>>> that the question of the test controller will be resolved later.
>>>
>>> The test controller is the thing that kicks off tests. Many of these
>>> tests will be for a complete run of U-Boot from start to
>>> bootm/reset/whatever.
>>>
>>> If the test controller is separate from U-boot and runs U-Boot once
>>> for each test then yes: reset and bootm can exit, the main loop never
>>> needs to quit, etc.
>>>
>>> If the test controller is linked with U-Boot, and is basically just a
>>> high-level control function for the rest of the code, then we want
>>> reset and bootm to exit back to this test controller code.
>>>
>>> I haven't written any tests yes so it isn't yet clear what the
>>> trade-offs are, but I suspect that linking at least part of the test
>>> controller with U-Boot is going to be attractive so that it can spread
>>> its tentacles and see what is going on during the test run.
>>
>> I would actually vote for the exact opposite. ?The test controller should be
>> able to get this information from the mocks of the devices that are used and
>> the input and output it provides and consumes from stdio.
>>
>> I think it would be better to factor this into two problems. ?Plus, I'm always a
>> fan of smaller single purpose tools that are composed at the process boundary.
>
> Yes it seems that we need some sort of config input and results output
> 'file' which device mocks can consume and produce. For the runtime I
> am thinking of some device state which is specific to testing. For
> example, a SPI flash driver might be able to emulate failure to erase
> a block. This feature would be enabled by config, and perhaps the
> results output would include the pages read/written, etc.
>
> But I do want to keep this simple...

Absolutely.  These sorts of details can be worked out later, and match what I
was thinking.  I just wanted to assert that I didn't think we were shooting
ourselves in the foot by exiting with a return code.

Thanks,
    Anton

> Regards,
> Simon
>
>>
>> Thanks,
>> ? ?Anton
>>
>>> Regards,
>>> Simon
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> http://lists.denx.de/mailman/listinfo/u-boot
>>>
>>
>

  reply	other threads:[~2011-09-26 19:25 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 16:48 [U-Boot] [RFC PATCH 01/20] sandbox: Add architecture header files Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 02/20] sandbox: Add architecture image support Simon Glass
2011-09-17 19:29   ` Marek Vasut
2011-09-18  3:57     ` Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 03/20] sandbox: Add compiler defines to support a 64-bit x86_64 platform Simon Glass
2011-09-17 23:56   ` Mike Frysinger
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 04/20] sandbox: Add cpu files Simon Glass
2011-09-17 23:58   ` Mike Frysinger
2011-09-23 15:54     ` Simon Glass
2011-09-25 19:25       ` Wolfgang Denk
2011-09-25 20:18         ` Simon Glass
2011-09-26  4:48           ` Mike Frysinger
2011-09-26 16:49             ` Simon Glass
2011-09-26 17:10               ` Anton Staaf
2011-09-26 19:11                 ` Simon Glass
2011-09-26 18:12             ` Wolfgang Denk
2011-09-26 18:16               ` Mike Frysinger
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 05/20] sandbox: Add architecture lib files Simon Glass
2011-09-18  0:02   ` Mike Frysinger
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 06/20] sandbox: Allow board_init_f() and board_init_r() to return Simon Glass
2011-09-18  0:05   ` Mike Frysinger
2011-09-23 15:55     ` Simon Glass
2011-09-25 19:55       ` Wolfgang Denk
2011-09-25 20:20         ` Simon Glass
2011-09-26  4:47       ` Mike Frysinger
2011-09-26 16:48         ` Simon Glass
2011-09-26 17:49           ` Anton Staaf
2011-09-26 19:22             ` Simon Glass
2011-09-26 19:25               ` Anton Staaf [this message]
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 07/20] sandbox: Add sandbox board Simon Glass
2011-09-18  0:17   ` Mike Frysinger
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 08/20] sandbox: Add board info for architecture Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 09/20] sandbox: Add bootm support Simon Glass
2011-09-18  0:16   ` Mike Frysinger
2011-09-23 15:55     ` Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 10/20] sandbox: Disable built-in malloc Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 11/20] sandbox: Disable standalone/API support Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 12/20] sandbox: Force command sections to be 4-byte aligned Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 13/20] sandbox: Add OS dependent layer Simon Glass
2011-09-18  0:20   ` Mike Frysinger
2011-09-23 15:59     ` Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 14/20] sandbox: Add board_init() Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 15/20] sandbox: Add main program Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 16/20] sandbox: Add serial uart Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 17/20] sandbox: Add basic config file Simon Glass
2011-09-18  0:22   ` Mike Frysinger
2011-09-23 16:00     ` Simon Glass
2011-09-26  4:52       ` Mike Frysinger
2011-09-26 18:18         ` Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 18/20] sandbox: Remove unused variable warnings Simon Glass
2011-09-18  0:25   ` Mike Frysinger
2011-09-23 16:01     ` Simon Glass
2011-09-26  4:49       ` Mike Frysinger
2011-09-26 18:07         ` Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 19/20] sandbox: Use uintptr_t for 32/64-bit compatibility Simon Glass
2011-09-17 16:48 ` [U-Boot] [RFC PATCH 20/20] sandbox: Makefile changes to build sandbox architecture Simon Glass
2011-09-17 23:54 ` [U-Boot] [RFC PATCH 01/20] sandbox: Add architecture header files Mike Frysinger

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='CAF6FioXgYnmbp+RcqxsLJyww2j1xsq_UXK2F-t3vNF=HnhC+XQ@mail.gmail.com' \
    --to=robotboy@chromium.org \
    --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.