All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Daniel Kiper <dkiper@net-space.pl>,
	arvidjaar@gmail.com, grub-devel@gnu.org
Cc: leif.lindholm@linaro.org
Subject: Re: [PATCH 1/2] arm64: Move firmware fdt search into global function
Date: Tue, 15 Nov 2016 22:07:39 +0100	[thread overview]
Message-ID: <40ae70b1-9aeb-1f5c-2cd3-8fef929d9103@suse.de> (raw)
In-Reply-To: <20161115210022.GG16470@router-fw-old.local.net-space.pl>



On 15/11/2016 22:00, Daniel Kiper wrote:
> On Sat, Nov 12, 2016 at 12:03:33PM +0300, Andrei Borzenkov wrote:
>> 29.02.2016 02:22, Alexander Graf ??????????:
>>> Searching for a device tree that EFI passes to us via configuration tables
>>> is nothing architecture specific. Move it into generic code.
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>> ---
>>>  grub-core/kern/efi/init.c    | 22 ++++++++++++++++++++++
>>>  grub-core/loader/arm64/fdt.c | 24 +-----------------------
>>>  include/grub/efi/efi.h       |  2 ++
>>>  3 files changed, 25 insertions(+), 23 deletions(-)
>>>
>>> diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c
>>> index e9c85de..fb90ecd 100644
>>> --- a/grub-core/kern/efi/init.c
>>> +++ b/grub-core/kern/efi/init.c
>>> @@ -72,6 +72,28 @@ grub_machine_get_bootlocation (char **device, char **path)
>>>      }
>>>  }
>>>
>>> +void *
>>> +grub_efi_get_firmware_fdt (void)
>>> +{
>>> +  grub_efi_configuration_table_t *tables;
>>> +  grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID;
>>> +  void *firmware_fdt = NULL;
>>> +  unsigned int i;
>>> +
>>> +  /* Look for FDT in UEFI config tables. */
>>> +  tables = grub_efi_system_table->configuration_table;
>>> +
>>> +  for (i = 0; i < grub_efi_system_table->num_table_entries; i++)
>>> +    if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0)
>>> +      {
>>> +	firmware_fdt = tables[i].vendor_table;
>>> +	grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt);
>>> +	break;
>>> +      }
>>> +
>>> +  return firmware_fdt;
>>> +}
>>> +
>>
>> Is it relevant for x86? I cannot even find anything related to FDT or
>> "device tree" in UEFI spec, it falls under vendor extensions. What other
>> use it has except in Linux loader?
>>
>> I really fail to see why it should be moved into core until at least one
>> more non-trivial caller is present.
>
> Hmmm... It looks that I was too fast. TBH, I can agree to some extend.
> Should we revert this patch or just #ifdef relevant code? Revert seems
> better for me.

Uh, the point of the function was to share code between 32bit and 64bit 
arm platforms which are completely separate archs.

There's also effort underway to run with device tree on x86:

   https://plus.google.com/+ChristopherFriedt/posts/SfDifuC1xsR


Alex


  reply	other threads:[~2016-11-15 21:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 23:22 [PATCH 1/2] arm64: Move firmware fdt search into global function Alexander Graf
2016-02-28 23:22 ` [PATCH 2/2] arm efi: Use fdt from firmware when available Alexander Graf
2016-03-10 20:00   ` Vladimir 'phcoder' Serbinenko
2016-03-13 14:44     ` Leif Lindholm
2016-11-10 12:27   ` Daniel Kiper
2016-11-12  9:03 ` [PATCH 1/2] arm64: Move firmware fdt search into global function Andrei Borzenkov
2016-11-15 21:00   ` Daniel Kiper
2016-11-15 21:07     ` Alexander Graf [this message]
2016-11-16 10:28       ` Daniel Kiper
2016-11-16 10:33         ` Alexander Graf
2016-11-16 11:05           ` Daniel Kiper

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=40ae70b1-9aeb-1f5c-2cd3-8fef929d9103@suse.de \
    --to=agraf@suse.de \
    --cc=arvidjaar@gmail.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif.lindholm@linaro.org \
    /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.