All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
@ 2019-10-10 13:56 Whitney, Scott
  2019-10-10 14:32 ` Ryan Barnett
  2019-10-10 14:33 ` Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Whitney, Scott @ 2019-10-10 13:56 UTC (permalink / raw)
  To: buildroot

We are trying to set up Buildroot to create our cross-compilation toolchain, Linux image, and root filesystem for the Texas Instruments AM65X family.


We'd also like to create U-Boot, but for the AM65X, U-Boot has at least one piece (tiboot3.bin) that runs on a 32-bit ARM R5 core, requiring a 32-bit ARM cross-compiler.  That piece configures some hardware like the DRAM controller and then loads some 64-bit code U-Boot code into DRAM, after which an A53 64-bit core starts running it.


The rest of our project and the remainder of U-Boot can be built using the AArch64 ARM compiler, which we have selected as our Buildroot toolchain, along with glibc.


Has anyone used Buildroot with the AM65X?  Is it feasible to build/configure a 2nd toolchain (32-bit ARM) within Buildroot, possibly as an additional host package?


We are also trying to create everything using a br2-external tree so that all of Buildroot does not need to be checked in.  We would only have to check out our br2-external tree, copy a specific version of Buildroot into it the same top-level directory as the location of our br2-external tree, and then use "make BR2_EXTERNAL=<path to our br2-external tree> our_defconfig", followed by the usual "make" to build everything.


Examples of how to go about this (e.g. Config.in.host, *.mk files, etc.) if it's feasible would be greatly appreciated.


Many thanks,


Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191010/e46561bb/attachment.html>

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

* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
  2019-10-10 13:56 [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain? Whitney, Scott
@ 2019-10-10 14:32 ` Ryan Barnett
  2019-10-10 19:28   ` Thomas Petazzoni
  2019-10-10 14:33 ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Ryan Barnett @ 2019-10-10 14:32 UTC (permalink / raw)
  To: buildroot

Scott,

On Thu, Oct 10, 2019 at 8:57 AM Whitney, Scott <scwhitn@amazon.com> wrote:
>
> We are trying to set up Buildroot to create our cross-compilation toolchain, Linux
> image, and root filesystem for the Texas Instruments AM65X family.
>
> We'd also like to create U-Boot, but for the AM65X, U-Boot has at least one piece
> (tiboot3.bin) that runs on a 32-bit ARM R5 core, requiring a 32-bit ARM
> cross-compiler.  That piece configures some hardware like the DRAM controller
> and then loads some 64-bit code U-Boot code into DRAM, after which an A53
> 64-bit core starts running it.
>
> The rest of our project and the remainder of U-Boot can be built using the AArch64
> ARM compiler, which we have selected as our Buildroot toolchain, along with glibc.
>
> Has anyone used Buildroot with the AM65X?  Is it feasible to build/configure a 2nd
> toolchain (32-bit ARM) within Buildroot, possibly as an additional host package?

I'm not sure if anyone has used the AM65X here but the ideal solution
when using two compiles is to maintain two defconfigs. One for the
32-bit Cortex-R5 TI bootloader followed by one that builds everything
for AArch64.

There is an issue with compiling using an ARM Cortex-R5 toolchain
however. Buildroot is setup to build an Embedded Linux System, it only
supports ARM cores which can run the Linux kernel which the Cortex-R5
is not. This means a bare-metal toolchain (no C library) must be used
which buildroot doesn't support. Thus if you want to build the TI
bootloader package in buildroot using the ARM R5 bare-metal toolchain,
you will not be able to take advantage of any of the toolchain
infrastructure.

With the current state of buildroot, this leads to needing to add your
own host package for the bare metal toolchain in br2-external which
would install the toolchain into the host directory. Then you will
need to add package for the TI bootloader which depend on this host
toolchain package. The TI bootloader package would take advantage of
the generic package infrastructure and need to setup and configure the
TI bootloader source to point to the bare-metal compiler which was
placed in the host folder.

> We are also trying to create everything using a br2-external tree so that all of
> Buildroot does not need to be checked in.  We would only have to check out our
> br2-external tree, copy a specific version of Buildroot into it the same top-level
> directory as the location of our br2-external tree, and then use
> "make BR2_EXTERNAL=<path to our br2-external tree> our_defconfig",
> followed by the usual "make" to build everything.
>
> Examples of how to go about this (e.g. Config.in.host, *.mk files, etc.) if it's
> feasible would be greatly appreciated.

In the future, can you please send emails to the mailing list in plain
text format (internet style replies) format? This allows for easier
readability by all on the mailing list.

https://buildroot.org/downloads/manual/manual.html#_reviewing_and_testing_patches

Thanks,
-Ryan

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

* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
  2019-10-10 13:56 [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain? Whitney, Scott
  2019-10-10 14:32 ` Ryan Barnett
@ 2019-10-10 14:33 ` Thomas Petazzoni
  2019-10-10 15:56   ` Whitney, Scott
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2019-10-10 14:33 UTC (permalink / raw)
  To: buildroot

Hello Scott,

On Thu, 10 Oct 2019 13:56:45 +0000
"Whitney, Scott" <scwhitn@amazon.com> wrote:

> We'd also like to create U-Boot, but for the AM65X, U-Boot has at
> least one piece (tiboot3.bin) that runs on a 32-bit ARM R5 core,
> requiring a 32-bit ARM cross-compiler.  That piece configures some
> hardware like the DRAM controller and then loads some 64-bit code
> U-Boot code into DRAM, after which an A53 64-bit core starts running
> it.

This piece of software is bare metal, so there's no need for a Linux
capable toolchain. We have the same problem on other platforms.

A patch series was submitted in February tosolve this problem:

  http://lists.busybox.net/pipermail/buildroot/2019-February/242251.html

People keep asking for this. I guess I should take my evening tonight
to finally rework this patch series, and send a new iteration of it.

> Has anyone used Buildroot with the AM65X?  Is it feasible to
> build/configure a 2nd toolchain (32-bit ARM) within Buildroot,
> possibly as an additional host package?

See the above patch series, which does exactly that.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
  2019-10-10 14:33 ` Thomas Petazzoni
@ 2019-10-10 15:56   ` Whitney, Scott
  2019-10-10 16:54     ` Christian Stewart
  0 siblings, 1 reply; 7+ messages in thread
From: Whitney, Scott @ 2019-10-10 15:56 UTC (permalink / raw)
  To: buildroot

Thanks, Thomas,

Please excuse the dumb question.  Since I am a "newbie" to Buildroot, what is the proper method to obtain and apply this patch and use it?  Or does that need to wait until you do your rework?

Many thanks,

Scott

________________________________________
From: buildroot <buildroot-bounces@busybox.net> on behalf of Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Sent: Thursday, October 10, 2019 10:33 AM
To: Whitney, Scott
Cc: buildroot at busybox.net
Subject: Re: [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?

Hello Scott,

On Thu, 10 Oct 2019 13:56:45 +0000
"Whitney, Scott" <scwhitn@amazon.com> wrote:

> We'd also like to create U-Boot, but for the AM65X, U-Boot has at
> least one piece (tiboot3.bin) that runs on a 32-bit ARM R5 core,
> requiring a 32-bit ARM cross-compiler.  That piece configures some
> hardware like the DRAM controller and then loads some 64-bit code
> U-Boot code into DRAM, after which an A53 64-bit core starts running
> it.

This piece of software is bare metal, so there's no need for a Linux
capable toolchain. We have the same problem on other platforms.

A patch series was submitted in February tosolve this problem:

  http://lists.busybox.net/pipermail/buildroot/2019-February/242251.html

People keep asking for this. I guess I should take my evening tonight
to finally rework this patch series, and send a new iteration of it.

> Has anyone used Buildroot with the AM65X?  Is it feasible to
> build/configure a 2nd toolchain (32-bit ARM) within Buildroot,
> possibly as an additional host package?

See the above patch series, which does exactly that.

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
  2019-10-10 15:56   ` Whitney, Scott
@ 2019-10-10 16:54     ` Christian Stewart
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Stewart @ 2019-10-10 16:54 UTC (permalink / raw)
  To: buildroot

Hi Scott,

On Thu, Oct 10, 2019, 8:57 AM Whitney, Scott <scwhitn@amazon.com> wrote:

> Please excuse the dumb question.  Since I am a "newbie" to Buildroot, what
> is the proper method to obtain and apply this patch and use it?  Or does
> that need to wait until you do your rework?
>

Save the contents of the email body to a file (usually a .patch or a .mbox)
and use "git am" on the file.

https://buildroot.org/downloads/manual/manual.html#_reviewing_and_testing_patches

Perhaps you don't literally mean how do you apply it, but just in case,
here's some reference.

Best,
Christian Stewart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20191010/d6601754/attachment.html>

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

* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
  2019-10-10 14:32 ` Ryan Barnett
@ 2019-10-10 19:28   ` Thomas Petazzoni
  2019-10-10 19:41     ` Ryan Barnett
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2019-10-10 19:28 UTC (permalink / raw)
  To: buildroot

Hello Ryan,

On Thu, 10 Oct 2019 09:32:19 -0500
Ryan Barnett <ryan.barnett@rockwellcollins.com> wrote:

> I'm not sure if anyone has used the AM65X here but the ideal solution
> when using two compiles is to maintain two defconfigs. One for the
> 32-bit Cortex-R5 TI bootloader followed by one that builds everything
> for AArch64.
> 
> There is an issue with compiling using an ARM Cortex-R5 toolchain
> however. Buildroot is setup to build an Embedded Linux System, it only
> supports ARM cores which can run the Linux kernel which the Cortex-R5
> is not. This means a bare-metal toolchain (no C library) must be used
> which buildroot doesn't support. Thus if you want to build the TI
> bootloader package in buildroot using the ARM R5 bare-metal toolchain,
> you will not be able to take advantage of any of the toolchain
> infrastructure.
> 
> With the current state of buildroot, this leads to needing to add your
> own host package for the bare metal toolchain in br2-external which
> would install the toolchain into the host directory. Then you will
> need to add package for the TI bootloader which depend on this host
> toolchain package. The TI bootloader package would take advantage of
> the generic package infrastructure and need to setup and configure the
> TI bootloader source to point to the bare-metal compiler which was
> placed in the host folder.

As I pointed out in my reply, I don't think in this situation you need
two defconfigs, and two separate Buildroot builds.

The bare-metal toolchain can just be a regular Buildroot host package,
and used to build the bare-metal Cortex-R5 code.

See the patch series that I pointed in my reply, which did exactly this
to build the firmware running on a Cortex-M3 co-processor, for a Linux
system running on an Cortex-A53.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain?
  2019-10-10 19:28   ` Thomas Petazzoni
@ 2019-10-10 19:41     ` Ryan Barnett
  0 siblings, 0 replies; 7+ messages in thread
From: Ryan Barnett @ 2019-10-10 19:41 UTC (permalink / raw)
  To: buildroot

Thomas,

On Thu, Oct 10, 2019 at 2:28 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Ryan,
>
> On Thu, 10 Oct 2019 09:32:19 -0500
> Ryan Barnett <ryan.barnett@rockwellcollins.com> wrote:
>
> > I'm not sure if anyone has used the AM65X here but the ideal solution
> > when using two compiles is to maintain two defconfigs. One for the
> > 32-bit Cortex-R5 TI bootloader followed by one that builds everything
> > for AArch64.
> >
> > There is an issue with compiling using an ARM Cortex-R5 toolchain
> > however. Buildroot is setup to build an Embedded Linux System, it only
> > supports ARM cores which can run the Linux kernel which the Cortex-R5
> > is not. This means a bare-metal toolchain (no C library) must be used
> > which buildroot doesn't support. Thus if you want to build the TI
> > bootloader package in buildroot using the ARM R5 bare-metal toolchain,
> > you will not be able to take advantage of any of the toolchain
> > infrastructure.
> >
> > With the current state of buildroot, this leads to needing to add your
> > own host package for the bare metal toolchain in br2-external which
> > would install the toolchain into the host directory. Then you will
> > need to add package for the TI bootloader which depend on this host
> > toolchain package. The TI bootloader package would take advantage of
> > the generic package infrastructure and need to setup and configure the
> > TI bootloader source to point to the bare-metal compiler which was
> > placed in the host folder.
>
> As I pointed out in my reply, I don't think in this situation you need
> two defconfigs, and two separate Buildroot builds.

I did not see your reply until after I had sent my email.

> The bare-metal toolchain can just be a regular Buildroot host package,
> and used to build the bare-metal Cortex-R5 code.
>
> See the patch series that I pointed in my reply, which did exactly this
> to build the firmware running on a Cortex-M3 co-processor, for a Linux
> system running on an Cortex-A53.

I agree you do not need two configs. While describing the host package
solution, I began to lean more towards a host package solution for the
bare-metal toolcahin.

I did not recall the patch series that you linked in your reply.
However, in reviewing the patch series I agree with approach to build
firmware for a bare-metal core.

If you do re-spin that patch series, I look forward to reviewing it.

Thanks,
-Ryan

---
Ryan Barnett | Sr Systems Engineer | Commercial Avionics
COLLINS AEROSPACE
400 Collins Rd NE, Cedar Rapids, IA 52498 USA
ryan.barnett at collins.com | collinsaerospace.com

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

end of thread, other threads:[~2019-10-10 19:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 13:56 [Buildroot] Buildroot for Texas Instruments AM65X - add 2nd toolchain? Whitney, Scott
2019-10-10 14:32 ` Ryan Barnett
2019-10-10 19:28   ` Thomas Petazzoni
2019-10-10 19:41     ` Ryan Barnett
2019-10-10 14:33 ` Thomas Petazzoni
2019-10-10 15:56   ` Whitney, Scott
2019-10-10 16:54     ` Christian Stewart

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.