Bug 163

Summary: Xtensa architecture port
Product: buildroot Reporter: Maxim Grigoriev <maxim2405>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: enhancement CC: buildroot
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target: xtensa*-*-*
Build:
Attachments: This is the first patch in a set of Xtensa port patches
Improved and extended patch for patch-kernal.sh and toolchain Makefiles
Add Xtensa support to the top Buildroot Makefile
Add Xtensa support to Buildroot uClibc
Add Xtensa to Buildroot projects
Add Xtensa target to Buildroot
Add Xtensa to Buildroot packages

Description Maxim Grigoriev 2009-03-09 19:04:30 UTC
I would like to submit an Xtensa architecture port to BUILDROOT repository.
The submission assumes a set of patches. Most of them are architecture-specific.

Xtensa is a family of configurable and extensible
processors, which have been on the IP market for quite some
time now. For those of you who are interested, please, look at

            http://www.tensilica.com/

Maxim Grigoriev
Comment 1 Maxim Grigoriev 2009-03-09 20:22:16 UTC
Created attachment 115 [details]
This is the first patch in a set of Xtensa port patches

      Xtensa BUILDROOT uses a concept of source overlays,
      which are necessary because Xtensa processors are
      configurable and extensible. Xtensa tools, e.g.
      gcc, gdb, and binutils, use source overlays, which
      can not be substituted by the current BUILDROOT
      patching mechanism. This update makes patch-kernel.sh
      script capable of handling these overlays.
Comment 2 Bernhard 2009-03-10 16:09:34 UTC
Host, Target, Build are the respective triplets.
Comment 3 Bernhard 2009-03-10 16:14:23 UTC
First, there are superfluous trailing ';' chars in your patch.

Does this:
+	uncomp="tar cf - --exclude=.svn --no-anchored -C";
work with busybox's tar?

What is "uparm" ment to be? Please use a more descriptive name.

Last, can you give some examples that show why you need these changes?
Comment 4 Maxim Grigoriev 2009-03-10 22:46:01 UTC
Created attachment 131 [details]
Improved and extended patch for patch-kernal.sh and toolchain Makefiles

>> --- Comment #3 from Bernhard <rep.dot.nop@gmail.com>  2009-03-10 16:14:23 UTC ---

Thanks much for your comments, Bernhard.
I've attached a new extended patch. I made it more self-explanatory
and consistent by adding binutils/gcc/gdb Makefiles' updates related
to our toolchain/patch-kernel.sh changes.

>>  First, there are superfluous trailing ';' chars in your patch.

Removed.

>> Does this:
>> +       uncomp="tar cf - --exclude=.svn --no-anchored -C";
>> work with busybox's tar?

Given that busybox tar is 1.18, I say "Yes". It works.
I was not able to build my busybox TAR package because of the build errors.
But, I checked it on my x86-linux box after installing GNU/TAR 1.18.

>> What is "uparm" meant to be? Please use a more descriptive name.

It's been replaced by "uncomp_parm" in the new patch.

>> Last, can you give some examples that show why you need these changes?

Applying Xtensa source overlays could be done without changing patch-kernel.sh,
but they would result in much more extensive changes to other Makefiles.
This change to patch-kernel.sh is the simplest and most elegant way
we found of applying source overlays.  It simply expands patch-kernel.sh to
handle tar files, and thus patch not just files, but also source trees.

Isn't it nice ? Can other BUILDROOT users find it useful ?

An example might be Xtensa overlay support for GDB.  With this change
to patch-kernel.sh, all we needed to edit in toolchain/gdb/gdb.mk was
to add a conditional include:

  ifneq ($(filter xtensa%,$(ARCH)),)
  include target/xtensa/patch.in
  GDB_PATCH_EXTRA:=$(call XTENSA_PATCH,gdb,$(GDB_PATCH_DIR),. ..)
  endif

and add $(GDB_PATCH_EXTRA) to the list of what patch-kernel.sh patches:

  <      toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch
  --
  >      toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch $(GDB_PATCH_EXTRA)

The alternative is to add an Xtensa-specific line(s) to the gdb-unpacked
rule, which didn't seem quite as kosher.

Thanks,
-- Maxim
Comment 5 Maxim Grigoriev 2009-05-09 00:05:55 UTC
Created attachment 299 [details]
Add Xtensa support to the top Buildroot Makefile
Comment 6 Maxim Grigoriev 2009-05-09 00:06:40 UTC
Created attachment 301 [details]
Add Xtensa support to Buildroot uClibc
Comment 7 Maxim Grigoriev 2009-05-09 00:18:20 UTC
Created attachment 303 [details]
Add Xtensa to Buildroot projects
Comment 8 Maxim Grigoriev 2009-05-09 01:29:30 UTC
Created attachment 305 [details]
Add Xtensa target to Buildroot

The list of files added/updated :

target/Config.in.arch
target/Makefile.in
target/xtensa/...
target/device/Config.in
target/device/xtensa/...
Comment 9 Maxim Grigoriev 2009-05-09 01:59:06 UTC
Created attachment 307 [details]
Add Xtensa to Buildroot packages

Touches 

package/gnuconfig/...
package/Makefile.in
Comment 10 Peter Korsgaard 2009-07-24 05:55:55 UTC
finally committed, thanks!
Comment 11 Thomas Petazzoni 2009-07-24 08:53:40 UTC
Peter, I don't think you committed the Xtensa support. Probably your comment was related to another bug entry ?
Comment 12 Peter Korsgaard 2009-07-24 12:50:12 UTC
(In reply to comment #11)
> Peter, I don't think you committed the Xtensa support. Probably your comment
> was related to another bug entry ?

ehh, no - I committed the 6 patches this morning. The last one is

http://git.buildroot.net/buildroot/commit/?id=edb5ca9c529804c449a5ff3a11607bd26eef394b