All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 04/13] sandbox: smbios: Update to support sandbox
Date: Tue, 12 Jun 2018 07:48:48 -0600	[thread overview]
Message-ID: <CAPnjgZ0EOs8uWEHZ-k+oiBuQXZPcT4yiie6MnhjPQGzg=HfwaQ@mail.gmail.com> (raw)
In-Reply-To: <f25cf8ba-d64a-03e9-fd90-8f0463b789f4@suse.de>

Hi Alex,

On 12 June 2018 at 02:12, Alexander Graf <agraf@suse.de> wrote:
>
>
> On 12.06.18 07:26, Simon Glass wrote:
>> At present this code casts addresses to pointers so cannot be used with
>> sandbox. Update it to use mapmem instead.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>> Changes in v5: None
>> Changes in v4: None
>> Changes in v3:
>> - Drop incorrect map_sysmem() in write_smbios_table()
>>
>> Changes in v2: None
>>
>>  lib/smbios.c | 32 ++++++++++++++++++++++++--------
>>  1 file changed, 24 insertions(+), 8 deletions(-)
>>
>> diff --git a/lib/smbios.c b/lib/smbios.c
>> index df3d26b071..fc3dabcbc1 100644
>> --- a/lib/smbios.c
>> +++ b/lib/smbios.c
>> @@ -6,6 +6,7 @@
>>   */
>>
>>  #include <common.h>
>> +#include <mapmem.h>
>>  #include <smbios.h>
>>  #include <tables_csum.h>
>>  #include <version.h>
>> @@ -72,9 +73,10 @@ static int smbios_string_table_len(char *start)
>>
>>  static int smbios_write_type0(ulong *current, int handle)
>
> Please change the function argument to indicate that we're no longer
> dealing with pointers, but instead with "u-boot physical addresses".
>
> Same for the other functions obviously :).

That actually hasn't changed. We are currently passing a U-Boot
address around and it is a ulong, as it normally is in U-Boot. What
has changed is that sandbox does not have a direct mapping between
U-Boot address and memory address, so we have to do the mapping.

While it is try that the ulong can be converted to a pointer with a
cast normally, this is not possible with sandbox, so things that need
to convert the ulong to a pointer need to do a conversion.

Regards,
Simon

  reply	other threads:[~2018-06-12 13:48 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12  5:26 [U-Boot] [PATCH v5 00/13] efi: Enable basic sandbox support for EFI loader Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 01/13] efi: Don't allow CMD_BOOTEFI_SELFTEST on sandbox Simon Glass
2018-06-12  5:38   ` Heinrich Schuchardt
2018-06-13  1:29     ` Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 02/13] efi: Init the 'rows' and 'cols' variables Simon Glass
2018-06-12  5:41   ` Heinrich Schuchardt
2018-06-13  3:12     ` Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 03/13] efi: sandbox: Adjust memory usage for sandbox Simon Glass
2018-06-12  8:05   ` Alexander Graf
2018-06-12 13:48     ` Simon Glass
2018-06-12 14:02       ` Alexander Graf
2018-06-12 21:55         ` Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 04/13] sandbox: smbios: Update to support sandbox Simon Glass
2018-06-12  8:12   ` Alexander Graf
2018-06-12 13:48     ` Simon Glass [this message]
2018-06-12 14:05       ` Alexander Graf
2018-06-12 21:56         ` Simon Glass
2018-06-13 10:14           ` Alexander Graf
2018-06-12  5:26 ` [U-Boot] [PATCH v5 05/13] efi: sandbox: Add distroboot support Simon Glass
2018-06-12  8:13   ` Alexander Graf
2018-06-12 13:48     ` Simon Glass
2018-06-12 14:06       ` Alexander Graf
2018-06-12 21:59         ` Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 06/13] efi: sandbox: Add relocation constants Simon Glass
2018-06-12  8:14   ` Alexander Graf
2018-06-12  5:26 ` [U-Boot] [PATCH v5 07/13] efi: Add a comment about duplicated ELF constants Simon Glass
2018-06-12 14:10   ` [U-Boot] [U-Boot, v5, " Alexander Graf
2018-06-12  5:26 ` [U-Boot] [PATCH v5 08/13] efi: sandbox: Enable EFI loader builder for sandbox Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 09/13] efi: Split out test init/uninit into functions Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 10/13] efi: sandbox: Add a simple 'bootefi test' command Simon Glass
2018-06-12  8:28   ` Alexander Graf
2018-06-12 13:48     ` Simon Glass
2018-06-12 14:11       ` Alexander Graf
2018-06-12 21:57         ` Simon Glass
2018-06-13 10:08           ` Alexander Graf
2018-06-14 15:12             ` Simon Glass
2018-06-14 15:19               ` Alexander Graf
2018-06-12  5:26 ` [U-Boot] [PATCH v5 11/13] efi: Create a function to set up for running EFI code Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 12/13] efi: Rename bootefi_test_finish() to bootefi_run_finish() Simon Glass
2018-06-12  5:26 ` [U-Boot] [PATCH v5 13/13] buildman: Add a --boards option to specify particular boards to build Simon Glass
2018-10-15 20:07   ` Simon Glass

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='CAPnjgZ0EOs8uWEHZ-k+oiBuQXZPcT4yiie6MnhjPQGzg=HfwaQ@mail.gmail.com' \
    --to=sjg@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.