All of lore.kernel.org
 help / color / mirror / Atom feed
* GRUB port for ARMv7-A U-Boot
@ 2012-10-19 18:47 Leif Lindholm
  0 siblings, 0 replies; 7+ messages in thread
From: Leif Lindholm @ 2012-10-19 18:47 UTC (permalink / raw)
  To: grub-devel

I have created a port of GRUB to the ARMv7-A architecture, running on top of
the
U-Boot firmware. The "U-Boot API", created by Rafal Jaworowsky
<raj@semihalf.com>, provides the hardware abstraction layer. Console is
supported on serial port using the termios subsystem.

This port supports, and indeed relies on, flattened device trees (FDT) -
passed on from firmware, or loaded from a filesystem. My implementation uses
libfdt rather than trying to recycle the existing openfirmware code, and if
possible I would like to keep it that way, and have libfdt included in GRUB.

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.

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.

In addition to this, the port includes libgcc helper functions (aeabi_*)
taken from linux/arch/arm/lib, licensed under GPLv2+.

My intent is to set up a public repository on launchpad.net containing my
modifications on Monday. Do you have any opinions about how I should treat
the third-party software when I do this?

Regards,

Leif




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GRUB port for ARMv7-A U-Boot
       [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
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Hunston @ 2012-10-19 19:08 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]

Sounds like you have accomplished what I set out to do, well done. In
regards to Third Party software, I believe you can publish what you have
used, as long as you give credit to the original software, although
sometimes I am lost in the bureaucracy...

Kind regards, Adam

On Fri, Oct 19, 2012 at 7:47 PM, Leif Lindholm <leif.lindholm@arm.com>wrote:

> I have created a port of GRUB to the ARMv7-A architecture, running on top
> of
> the
> U-Boot firmware. The "U-Boot API", created by Rafal Jaworowsky
> <raj@semihalf.com>, provides the hardware abstraction layer. Console is
> supported on serial port using the termios subsystem.
>
> This port supports, and indeed relies on, flattened device trees (FDT) -
> passed on from firmware, or loaded from a filesystem. My implementation
> uses
> libfdt rather than trying to recycle the existing openfirmware code, and if
> possible I would like to keep it that way, and have libfdt included in
> GRUB.
>
> 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.
>
> 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.
>
> In addition to this, the port includes libgcc helper functions (aeabi_*)
> taken from linux/arch/arm/lib, licensed under GPLv2+.
>
> My intent is to set up a public repository on launchpad.net containing my
> modifications on Monday. Do you have any opinions about how I should treat
> the third-party software when I do this?
>
> Regards,
>
> Leif
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #2: Type: text/html, Size: 2804 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GRUB port for ARMv7-A U-Boot
       [not found] <5081a0b0.0a4a340a.1cd2.ffffb04aSMTPIN_ADDED@mx.google.com>
@ 2012-10-19 19:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-10-22 11:16   ` Leif Lindholm
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-10-19 19:11 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 2227 bytes --]

On 19.10.2012 20:47, Leif Lindholm wrote:

> I have created a port of GRUB to the ARMv7-A architecture, running on top of
> the
> U-Boot firmware. The "U-Boot API", created by Rafal Jaworowsky
> <raj@semihalf.com>, provides the hardware abstraction layer. Console is
> supported on serial port using the termios subsystem.
> 
> This port supports, and indeed relies on, flattened device trees (FDT) -
> passed on from firmware, or loaded from a filesystem. My implementation uses
> libfdt rather than trying to recycle the existing openfirmware code, and if
> possible I would like to keep it that way, and have libfdt included in GRUB.
> 
> 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.

> 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?

> 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.

> 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?

> Do you have any opinions about how I should treat
> the third-party software when I do this?
> 


> Regards,
> 
> Leif
> 
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GRUB port for ARMv7-A U-Boot
  2012-10-19 19:08 ` Adam Hunston
@ 2012-10-19 19:15   ` Vladimir 'φ-coder/phcoder' Serbinenko
  2012-10-19 19:49     ` Adam Hunston
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-10-19 19:15 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

On 19.10.2012 21:08, Adam Hunston wrote:

> Sounds like you have accomplished what I set out to do, well done. In
> regards to Third Party software, I believe you can publish what you have
> used, as long as you give credit to the original software, although
> sometimes I am lost in the bureaucracy...

This is wrong. Copyright isn't academic research. You have to respect
various licenses. In this case it seems that it can be easily done but
sometimes it's not so.
Also your original question made no sense since there are a lot of
different incompatible ARM platforms.
-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GRUB port for ARMv7-A U-Boot
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Adam Hunston @ 2012-10-19 19:49 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

I did state I was lost when it came to various licenses, and ARM was
generic in my question as grub is a unified bootloader, so the different
ARM versions on devices was implied intrinsically.

As you are interested in specificity, the device I am working on as a
testbed has the following specifications:

BogoMIPS        : 269.51
Features        : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant     : 0x0
CPU part        : 0x926
CPU revision    : 5
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 16384
I assoc         : 4
I line length   : 32
I sets          : 128
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128

Regards, Adam

On Fri, Oct 19, 2012 at 8:15 PM, Vladimir 'φ-coder/phcoder' Serbinenko <
phcoder@gmail.com> wrote:

> On 19.10.2012 21:08, Adam Hunston wrote:
>
> > Sounds like you have accomplished what I set out to do, well done. In
> > regards to Third Party software, I believe you can publish what you have
> > used, as long as you give credit to the original software, although
> > sometimes I am lost in the bureaucracy...
>
> This is wrong. Copyright isn't academic research. You have to respect
> various licenses. In this case it seems that it can be easily done but
> sometimes it's not so.
> Also your original question made no sense since there are a lot of
> different incompatible ARM platforms.
> --
> Regards
> Vladimir 'φ-coder/phcoder' Serbinenko
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>

[-- Attachment #2: Type: text/html, Size: 2407 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GRUB port for ARMv7-A U-Boot
  2012-10-19 19:49     ` Adam Hunston
@ 2012-10-19 19:54       ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 0 replies; 7+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-10-19 19:54 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 748 bytes --]

On 19.10.2012 21:49, Adam Hunston wrote:

> I did state I was lost when it came to various licenses,


Then please avoid statements which may mislead others into breaking
licenses.

> and ARM was
> generic in my question as grub is a unified bootloader, so the different
> ARM versions on devices was implied intrinsically.
> 

Some platform-specific code is necessary for every platform. You need to
port to every platform you want GRUB to work on. You can't just "port to
all ARMs".

> As you are interested in specificity, the device I am working on as a
> testbed has the following specifications:
> 

This is just CPU specs which are useless to determine platform.
-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: GRUB port for ARMv7-A U-Boot
  2012-10-19 19:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-10-22 11:16   ` Leif Lindholm
  0 siblings, 0 replies; 7+ messages in thread
From: Leif Lindholm @ 2012-10-22 11:16 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-22 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 18:47 GRUB port for ARMv7-A U-Boot Leif Lindholm
     [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
     [not found] <5081a0b0.0a4a340a.1cd2.ffffb04aSMTPIN_ADDED@mx.google.com>
2012-10-19 19:11 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-10-22 11:16   ` Leif Lindholm

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.