All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@arm.com>
To: grub-devel@gnu.org
Subject: Re: GRUB port for ARMv7-A U-Boot
Date: Mon, 22 Oct 2012 12:16:00 +0100	[thread overview]
Message-ID: <50852AF0.8090609@arm.com> (raw)
In-Reply-To: <5081A5ED.1080003@gmail.com>

On 10/19/12 20:11, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> On 19.10.2012 20:47, Leif Lindholm wrote:
>> libfdt is dual-licensed, GPLv2+/BSD, and the copyright belongs to David
>> Gibson <dwg@au1.ibm.com>. I have a patch against the libfdt included in
>> http://jdl.com/software/dtc-v1.3.0.tgz that makes it build under GRUB.
>
> I'd prefer rather without libfdt and share more code with openfirmware
> since it's similar brain damage.

I would agree, but the current openfirmware code is very
openfirmware-specific, and the devicetree code is not separated from the rest.

If they should be shared, would it not make sense to use libfdt for both?
Openfirmware code would likely need to change anyway, and it would look a bit
confusing to insert calls to grub_ieee1275_finddevice() in the U-Boot code.

>> The U-Boot API is released under GPLv2+ consists of 3 source files. They
>>  are licensed under GPLv2+. The port also contains a crc32 checker I
>> included from the FreeBSD loader, copyright Gary S. Brown with the
>> statement that "You may use this program, or code or tables extracted
>> from it, as desired without restriction.". The crc32 checker is not
>> strictly speaking required, so could be removed if this poses any
>> problems.
>
> GRUB already has crc32 from libgcrypt. Could you use it?

I think that is available only as a module? And this is called effectively as
the first thing in grub_machine_init().

I could simply leave it out for now...

>> In addition to this, the port includes libgcc helper functions (aeabi_*)
>> taken from linux/arch/arm/lib, licensed under GPLv2+.
>
> These should be included at compile time from system libgcc.

Unfortunately, there is a snag with that; arm libgcc also provides the
__clear_cache function (for cleaning and synchronizing instruction and data
caches). Calls to this function are generated by the compiler, for
trampolines, when it encounters nested functions. However, unless building
with a "bare-metal" cross-compiler, your libgcc implementation will contain a
system call for performing this privileged operation.

U-Boot has a similar thing in place with CONFIG_PRIVATE_LIBGCC.

All of the scavenged source files are (c) FSF.

>> My intent is to set up a public repository on launchpad.net containing
>> my modifications on Monday.
>
> Could you send the patch here even if it's not finished?

Of course.

I will start with a couple of patches that could probably be included
regardless of the rest, and follow on with one large patch for the ARM-uboot
support, minus libfdt and crc32.

Regards,

Leif



  reply	other threads:[~2012-10-22 11:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5081a0b0.0a4a340a.1cd2.ffffb04aSMTPIN_ADDED@mx.google.com>
2012-10-19 19:11 ` GRUB port for ARMv7-A U-Boot Vladimir 'φ-coder/phcoder' Serbinenko
2012-10-22 11:16   ` Leif Lindholm [this message]
     [not found] <5081a0af.21b4340a.1059.ffffb383SMTPIN_ADDED@mx.google.com>
2012-10-19 19:08 ` Adam Hunston
2012-10-19 19:15   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-10-19 19:49     ` Adam Hunston
2012-10-19 19:54       ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-10-19 18:47 Leif Lindholm

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=50852AF0.8090609@arm.com \
    --to=leif.lindholm@arm.com \
    --cc=grub-devel@gnu.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.