Re: arc700 + glibc fails

2020-12-23 Thread Alexey Brodkin
Hi Rosen, Hauke!

> On Wed, Dec 23, 2020 at 6:54 AM Hauke Mehrtens  wrote:
> >
> > Hi,
> >
> > ARC was switched from uClibc to glibc here:
> > https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=95f1002acab574c24ad78f4453f091bf5a6731c7
> > uClibc support was removed from OpenWrt in the next commit.
> >
> > It looks like arc700 is not supported by glibc 2.32, only ARC HS38 is
> > supported.

Correct, upstream glibc v2.32 only supports ARCv2 as of today.
I forgot about that fact during discussion about uClibc removal here
https://github.com/openwrt/openwrt/pull/3673#issuecomment-747373099
because we used to add support for ARCompact ISA (i.e. ARC700 cores)
via off-the-tree-patch, see
https://github.com/foss-for-synopsys-dwc-arc-processors/glibc/commit/571c4c3df73bddbbb012b792a62f03e76b980ef3
and note how simple it is fixing exactly the issue reported here.

> > On the arc770 target I am getting this compiler errors in the glibc:
> > -
> > msort.c: Assembler messages:
> > msort.c:201: Error: opcode 'dmb' not supported for target arc700
> > -
> > http://buildbot.openwrt.org/master/images/builders/arc770%2Fgeneric/builds/749
> >
> > After this one is fixed I get this one:
> > -
> > ../sysdeps/unix/sysv/linux/arc/syscall.S: Assembler messages:
> > ../sysdeps/unix/sysv/linux/arc/syscall.S:27: Error: register must be
> > either r0-r3 or r12-r15 for instruction 'mov_s'
> > ../sysdeps/unix/sysv/linux/arc/syscall.S:28: Error: register must be
> > either r0-r3 or r12-r15 for instruction 'mov_s'
> > -
> >
> > Does anyone plan to fix glibc with arc700 or should we just remove the
> > arc770 target, the arhs38 target is compiling?

So indeed what we may do here is either to retrofit ARC700 into existing glibc
via aforementioned patch in OpenWrt or remove support of ARC700 at all.

I'd suggest for a moment to stop building for ARC700 while this discussion
is in progress and some people who's opinion I'd like to hear also are
on the Christmas break.

> I'll look into it. My vote is to remove support for ARC altogether as
> it doesn't seem any hardware uses it except for some dev kits.

Well that I'd prefer to not do. Even though in upstream OpenWrt indeed we
only have 2 development boards which we support, there might be other users
(and here I mean companies, not even individuals) which use or plan to use
OpenWrt on their ARC-based SoCs/boards.

The fact those boards are not exposed to wider audience and are not sold
as affordable consumer Wi-Fi routers doesn't mean they don't exist.

Moreover with recent introduction of ARCv3 processors which include
64-bit cores we're planning to add their support in OpenWrt as well
as soon as our toolchain matures a little bit so that we're confident
majority of packages could be built with it normally.

So if ARC doesn't add a lot of troubles for the community, let's keep it
in the project.
 
> > I think the archs38 target was not runtime tested with glibc, could
> > someone with access to the hardware please check if it is still working
> > with glibc in master. gdbserver also got ARC support please also check
> > if this now works and we can remove the dependency on !arc.

Right, there's a chance we haven't run glibc flavor of OpenWrt on ARC,
previously focused on uClibc. But we'll do that now, thanks for the hint!

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: arc700 + glibc fails

2020-12-24 Thread Alexey Brodkin
Hi Rosen,

> From: Rosen Penev 
> Sent: Thursday, December 24, 2020 8:07 AM
> To: Alexey Brodkin 
> Cc: Hauke Mehrtens ; openwrt-de...@openwrt.org 
> ; Evgeniy Didin ; 
> arc-...@synopsys.com 
> Subject: Re: arc700 + glibc fails

[snip]  
 
> --- a/sysdeps/arc/atomic-machine.h
> +++ b/sysdeps/arc/atomic-machine.h
> @@ -64,6 +64,10 @@ typedef uintmax_t uatomic_max_t;
>__atomic_val_bysize (__arch_compare_and_exchange_val, int,   \
>mem, new, old, __ATOMIC_ACQUIRE)
> 
> +#ifdef __ARC700__
> +#define atomic_full_barrier()  ({ asm volatile ("sync":::"memory"); })
> +#else
>  #define atomic_full_barrier()  ({ asm volatile ("dmb 3":::"memory"); })
> +#endif
> 
>  #endif /* _ARC_BITS_ATOMIC_H */
> --- a/sysdeps/unix/sysv/linux/arc/syscall.S
> +++ b/sysdeps/unix/sysv/linux/arc/syscall.S
> @@ -24,8 +24,13 @@ ENTRY (syscall)
> mov_s   r1, r2
> mov_s   r2, r3
> mov_s   r3, r4
> +#ifdef __ARC700__
> +   mov r4, r5
> +   mov r5, r6
> +#else
> mov_s   r4, r5
> mov_s   r5, r6
> +#endif
> 
> ARC_TRAP_INSN
> brhir0, -4096, L (call_syscall_err)
> --- a/sysdeps/unix/sysv/linux/arc/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h
> @@ -128,7 +128,11 @@ L (call_syscall_err):
> ASM_LINE_SEP\
>  movr8, __NR_##syscall_name ASM_LINE_SEP\
>  ARC_TRAP_INSN  ASM_LINE_SEP
> 
> +# ifdef __ARC700__
> +# define ARC_TRAP_INSN trap0
> +# else
>  # define ARC_TRAP_INSN trap_s 0
> +# endif
> 
>  #else  /* !__ASSEMBLER__ */
> 
> @@ -139,7 +143,11 @@ extern long int __syscall_error (long int);
>  hidden_proto (__syscall_error)
>  # endif
> 
> +# ifdef __ARC700__
> +# define ARC_TRAP_INSN "trap0  \n\t"
> +# else
>  # define ARC_TRAP_INSN "trap_s 0   \n\t"
> +#endif
> 
>  # undef INTERNAL_SYSCALL_NCS
>  # define INTERNAL_SYSCALL_NCS(number, nr_args, args...)\
> 
> Initial results look promising. I'll test compilation before submitting.

LGTM, though it's funny we seem to have this hunk already in upstream:
->8-
/* Return nonzero iff ELF header is compatible with the running host.  */
static inline int
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
{
  return (ehdr->e_machine == EM_ARCV2/* ARC HS.  */
  || ehdr->e_machine == EM_ARC_COMPACT); /* ARC 700.  */
}
->8-

[snip]

> > I'd suggest for a moment to stop building for ARC700 while this discussion
> > is in progress and some people who's opinion I'd like to hear also are
> > on the Christmas break.
>
> ARC700 can be marked as BROKEN which means disabled by default.

What does that mean in a sense of support?
I.e. it won't be built in OpenWrt infrastructure as well as no binaries,
nor packages will be built for the next releases of OpenWrt?

If so I guess it might be OK, though read-on...

> > So if ARC doesn't add a lot of troubles for the community, let's keep it
> > in the project.
> Not having hardware is quite limiting. That is, we can compile
> binaries but there's no way to test if anything compiled actually
> runs. I don't think even QEMU supports ARC.

My colleagues are busy upstreaming QEMU port for ARCv2, see
https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg5.html.

Review is in progress now and once everybody is happy it will be merged
(I guess after a couple of re-spins as it usually happens).

But the port itself is pretty stable and known to work well with both
the Linux as well as Zephyr RTOS (where it's even a part of their SDK,
see https://github.com/zephyrproject-rtos/sdk-ng/releases).

So if of any interest you may play with it:
 * Sources are here: 
https://github.com/foss-for-synopsys-dwc-arc-processors/qemu
 * Build instructions are here: 
https://github.com/foss-for-synopsys-dwc-arc-processors/qemu/wiki/Building-QEMU-for-ARC
 
I haven't tried to run images built with OpenWrt but what gets
built with Buildroot works nice. So if it makes any sense I may try with OpenWrt
and provide detailed instructions on how to get QEMU for ARC up and running.
 
> No musl support is also irksome. Nobody wants uClibc-ng in here and
> only a few want glibc in here. If glibc goes, ARC will go with it.

Ok, good. We don't have any plans for musl support as of today, but glibc
will be supported surely, moreover we plan to submit all our work right to
the upstream project as we do with all the other open source components.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] include/kernel.mk - better search for ARCH

2015-07-30 Thread Alexey Brodkin
If "findstring" is used without leading and trailing spaces unexpected matches
may happen. For example consider ARC=arc then "findstring $(ARCH)" will
report a false match with "aarch64".

But "findstring $ARCH " (note trailing space) will correctly skip
matches for both "aarch64" and "aarch64_be".

This patch is built-tested against NetGear WNDR3800.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
---
 include/kernel.mk | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 7a0a170..95909fd 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -62,15 +62,15 @@ endif
 
 ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
-else ifneq (,$(findstring $(ARCH), aarch64 aarch64_be))
+else ifneq (, $(findstring $(ARCH) , aarch64 aarch64_be ))
   LINUX_KARCH := arm64
-else ifneq (,$(findstring $(ARCH), armeb))
+else ifneq (, $(findstring $(ARCH) , armeb ))
   LINUX_KARCH := arm
-else ifneq (,$(findstring $(ARCH), mipsel mips64 mips64el))
+else ifneq (, $(findstring $(ARCH) , mipsel mips64 mips64el ))
   LINUX_KARCH := mips
-else ifneq (,$(findstring $(ARCH), sh2 sh3 sh4))
+else ifneq (, $(findstring $(ARCH) , sh2 sh3 sh4 ))
   LINUX_KARCH := sh
-else ifneq (,$(findstring $(ARCH), i386 x86_64))
+else ifneq (, $(findstring $(ARCH) , i386 x86_64 ))
   LINUX_KARCH := x86
 else
   LINUX_KARCH := $(ARCH)
-- 
2.4.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] update config.guess & config.sub

2015-07-30 Thread Alexey Brodkin
These are from today's master branch of:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree

In particular it adds support for ARC architecture plus some more
improvements and fixes.

This patch is built-tested against NetGear WNDR3800.

Signed-off-by: Alexey Brodkin 
Cc: Florian Fainelli 
Cc: Imre Kaloz 
---
 scripts/config.guess | 378 +++
 scripts/config.sub   | 150 
 2 files changed, 238 insertions(+), 290 deletions(-)

diff --git a/scripts/config.guess b/scripts/config.guess
index d622a44..fddac42 100755
--- a/scripts/config.guess
+++ b/scripts/config.guess
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2012-02-10'
+timestamp='2015-07-03'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to  and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
 # 
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to .
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -54,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || 
UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+   # If the system lacks a compiler, then just pick glibc.
+   # We could probably try harder.
+   LIBC=gnu
+
+   eval $set_cc_for_build
+   cat <<-EOF > $dummy.c
+   #include 
+   #if defined(__UCLIBC__)
+   LIBC=uclibc
+   #elif defined(__dietlibc__)
+   LIBC=dietlibc
+   #else
+   LIBC=gnu
+   #endif
+   EOF
+   eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, 
,,g'`
+   ;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -153,20 +168,27 @@ case 
"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name.  We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
-   UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-   /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+   UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+   /sbin/$sysctl 2>/dev/null || \
+   /usr/sbin/$sysctl 2>/dev/null || \
+   echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
+   earmv*)
+   arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 
'

Re: [OpenWrt-Devel] [PATCH] include/kernel.mk - better search for ARCH

2015-07-30 Thread Alexey Brodkin
Hi Felix,

On Thu, 2015-07-30 at 12:55 +0200, Felix Fietkau wrote:
> On 2015-07-30 10:41, Alexey Brodkin wrote:
> > If "findstring" is used without leading and trailing spaces unexpected 
> > matches
> > may happen. For example consider ARC=arc then "findstring $(ARCH)" will
> > report a false match with "aarch64".
> > 
> > But "findstring $ARCH " (note trailing space) will correctly skip
> > matches for both "aarch64" and "aarch64_be".
> > 
> > This patch is built-tested against NetGear WNDR3800.
> > 
> > Signed-off-by: Alexey Brodkin 
> > Cc: Felix Fietkau 
> > Cc: Jo-Philipp Wich 
> > ---
> >  include/kernel.mk | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/include/kernel.mk b/include/kernel.mk
> > index 7a0a170..95909fd 100644
> > --- a/include/kernel.mk
> > +++ b/include/kernel.mk
> > @@ -62,15 +62,15 @@ endif
> >  
> >  ifneq (,$(findstring uml,$(BOARD)))
> >LINUX_KARCH=um
> > -else ifneq (,$(findstring $(ARCH), aarch64 aarch64_be))
> > +else ifneq (, $(findstring $(ARCH) , aarch64 aarch64_be ))
> >LINUX_KARCH := arm64
> > -else ifneq (,$(findstring $(ARCH), armeb))
> > +else ifneq (, $(findstring $(ARCH) , armeb ))
> >LINUX_KARCH := arm
> > -else ifneq (,$(findstring $(ARCH), mipsel mips64 mips64el))
> > +else ifneq (, $(findstring $(ARCH) , mipsel mips64 mips64el ))
> >LINUX_KARCH := mips
> > -else ifneq (,$(findstring $(ARCH), sh2 sh3 sh4))
> > +else ifneq (, $(findstring $(ARCH) , sh2 sh3 sh4 ))
> >LINUX_KARCH := sh
> > -else ifneq (,$(findstring $(ARCH), i386 x86_64))
> > +else ifneq (, $(findstring $(ARCH) , i386 x86_64 ))
> Why did you add the leading whitespace before $(findstring...)?

Indeed this is not necessary because this is definitely out of
scope of "findstring".

If there're no more comments I'll send v2 soon.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] include/kernel.mk - better search for ARCH

2015-07-30 Thread Alexey Brodkin
If "findstring" is used without leading and trailing spaces unexpected matches
may happen. For example consider ARC=arc then "findstring $(ARCH)" will
report a false match with "aarch64".

But "findstring $ARCH " (note trailing space) will correctly skip
matches for both "aarch64" and "aarch64_be".

This patch is built-tested against NetGear WNDR3800.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
---

In v2 removed unncecessary space before findstring.

 include/kernel.mk | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 7a0a170..6a613fe 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -62,15 +62,15 @@ endif
 
 ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
-else ifneq (,$(findstring $(ARCH), aarch64 aarch64_be))
+else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be ))
   LINUX_KARCH := arm64
-else ifneq (,$(findstring $(ARCH), armeb))
+else ifneq (,$(findstring $(ARCH) , armeb ))
   LINUX_KARCH := arm
-else ifneq (,$(findstring $(ARCH), mipsel mips64 mips64el))
+else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
   LINUX_KARCH := mips
-else ifneq (,$(findstring $(ARCH), sh2 sh3 sh4))
+else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
   LINUX_KARCH := sh
-else ifneq (,$(findstring $(ARCH), i386 x86_64))
+else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
   LINUX_KARCH := x86
 else
   LINUX_KARCH := $(ARCH)
-- 
2.4.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Linux kernel config options handling in OpenWRT

2015-08-17 Thread Alexey Brodkin
Hello,

I'm playing with OpenWRT for a new platform and have a question on
how OpenWRT handles KCONFIG kernel options.

For example I select "KernelPackage/crypto-core" in OpenWRT's menuconfig
then KCONFIG is populated with:
-->8
CONFIG_CRYPTO=y
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_BLKCIPHER
CONFIG_CRYPTO_ALGAPI
-->8

>From what I may see from grepping through OpenWRT that KCONFIG value
is only used to determine if those options are enabled in kernel configuration
but not for force selection of options in kernel.

In other words if I want to get crypto core built I need to make sure first
that in my say "target/linux/board/config-4.1" options mentioned above are
enabled. Is that observation correct?

I'm asking because my initial assumption was I need to provide a minimal
kernel configuration in "target/linux/board/config-4.1" and then on
selection of kmods in OpenWRT's menuconfig missing config options
will be automatically added in kernel config.

But apparently no options are auto-enabled because I'm seeing that kind
of build failure if CONFIG_CRYPTO_BLKCIPHER is not explicitly set in my
kernel config:
-->8
NOTICE: module 'xxx/openwrt/build_dir/target-yyy/linux-zzz/linux
-4.1.3/crypto/crypto_algapi.ko' is built-in.
ERROR: module 'xxx/openwrt/build_dir/target-yyy/linux-zzz/linux
-4.1.3/crypto/crypto_blkcipher.ko' is missing.
modules/crypto.mk:30: recipe for target 'xxx/openwrt/bin/axs10x
-uClibc/packages/base/kmod-crypto-core_4.1.3-1_axs10x.ipk' failed
make[3]: *** [xxx/openwrt/bin/axs10x
-uClibc/packages/base/kmod-crypto-core_4.1.3-1_axs10x.ipk] Error 1
-->8

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng

2015-08-17 Thread Alexey Brodkin
uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/

We try to regularly add changes from uClibc to uClibc-ng.
We even sent patches and bug reports to the uClibc mailing list.
The config file is compatible between uClibc-ng 1.0 and uClibc git master.
This might change in the future.

Our main goal is to provide regularly a stable and tested release
to make embedded system developers happy.

The main advantage of uClibc-ng over olde good uClibc is regular releases
so there's no need to keep tons of patches on top of years old
0.9.33.2

Build-tested for
 [1] ARM: Sunxi generic
 [2] MIPS: Netgear WNDR3600/3700/3800

Run-tested for [yet out of the tree] Synopsys Designware ARC AXS101.

Signed-off-by: Alexey Brodkin 
Cc: Waldemar Brodkorb 
Cc: Mathieu Olivari 
Cc: Felix Fietkau 
Cc: John Crispin 
---
 toolchain/uClibc/Config.in |   4 +
 toolchain/uClibc/Config.version|   4 +
 toolchain/uClibc/common.mk |  15 +-
 toolchain/uClibc/config-ng-1.0.5/arm   |   8 +
 toolchain/uClibc/config-ng-1.0.5/armeb |   8 +
 toolchain/uClibc/config-ng-1.0.5/common| 223 +
 toolchain/uClibc/config-ng-1.0.5/debug |   6 +
 toolchain/uClibc/config-ng-1.0.5/i386  |  21 ++
 toolchain/uClibc/config-ng-1.0.5/i686  |  21 ++
 toolchain/uClibc/config-ng-1.0.5/m68k  |   6 +
 toolchain/uClibc/config-ng-1.0.5/mips  |  18 ++
 toolchain/uClibc/config-ng-1.0.5/mips64|  18 ++
 toolchain/uClibc/config-ng-1.0.5/mips64.32 |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64.64 |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64.n32|  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el  |  18 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el.32   |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el.64   |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mips64el.n32  |  19 ++
 toolchain/uClibc/config-ng-1.0.5/mipsel|  18 ++
 toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt |  18 ++
 toolchain/uClibc/config-ng-1.0.5/powerpc   |   6 +
 toolchain/uClibc/config-ng-1.0.5/powerpc.e500  |   6 +
 toolchain/uClibc/config-ng-1.0.5/sparc |   8 +
 toolchain/uClibc/config-ng-1.0.5/sparc.leon|   8 +
 toolchain/uClibc/config-ng-1.0.5/x86_64|   6 +
 ...backward_compatibility_symlink_by_default.patch |  32 +++
 27 files changed, 583 insertions(+), 3 deletions(-)
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/arm
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/armeb
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/common
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/debug
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/i386
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/i686
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/m68k
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mips64el.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mipsel
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/mipsel.cobalt
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/powerpc
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/powerpc.e500
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/sparc
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/sparc.leon
 create mode 100644 toolchain/uClibc/config-ng-1.0.5/x86_64
 create mode 100644 
toolchain/uClibc/patches-ng-1.0.5/0001-ldso_install_backward_compatibility_symlink_by_default.patch

diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 08ea00a..c923bc0 100644
--- a/toolchain/uClibc/Config.in
+++ b/toolchain/uClibc/Config.in
@@ -11,6 +11,10 @@ choice
select UCLIBC_VERSION_0_9_33
bool "uClibc 0.9.33.2"
 
+   config UCLIBC_USE_VERSION_NG
+   select UCLIBC_VERSION_NG
+   bool "uClibc-ng"
+
 endchoice
 
 # Debug version.
diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index dd302f2..7238d9a 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -2,8 +2,12 @@ config UCLIBC_VERSION
string
depends on USE_UCLIBC
default "0.9.33.2"   if UCLIBC_VERSION_0_9_33
+   default "1.0.5"  if UCLIBC_VERSION_NG
default "0.9.33.2"
 
 config UCLIBC_VERSION_0_9_33
   

[OpenWrt-Devel] [PATCH] target/linux/generic: allow up to 4 8250-compatible UARTS

2015-08-24 Thread Alexey Brodkin
Default value of both SERIAL_8250_NR_UARTS & SERIAL_8250_RUNTIME_UARTS is 4,
see: 
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/Kconfig

And some boards rely on that default setting.
What's worse some boards use 3rd or even 4th UART as its primary
serial console.

For example Synopsys DesignWare SDP board, see "console=ttyS3,115200n8"
here: 
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/boot/dts/axs101.dts

So having expected default value allows usage of kernel configs that are
closer to their upstream versions.

Cc: Jonas Gorski 
Cc: Zoltan HERPAI 
Cc: Hauke Mehrtens 
Cc: Dirk Neukirchen 
Signed-off-by: Alexey Brodkin 
---
 target/linux/generic/config-4.1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/config-4.1 b/target/linux/generic/config-4.1
index de4c62c..c7d5871 100644
--- a/target/linux/generic/config-4.1
+++ b/target/linux/generic/config-4.1
@@ -3567,10 +3567,10 @@ CONFIG_SERIAL_8250_DMA=y
 # CONFIG_SERIAL_8250_FOURPORT is not set
 # CONFIG_SERIAL_8250_HUB6 is not set
 # CONFIG_SERIAL_8250_MANY_PORTS is not set
-CONFIG_SERIAL_8250_NR_UARTS=2
+CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_PCI is not set
 # CONFIG_SERIAL_8250_RSA is not set
-CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 # CONFIG_SERIAL_8250_SYSRQ is not set
 # CONFIG_SERIAL_ALTERA_JTAGUART is not set
 # CONFIG_SERIAL_ALTERA_UART is not set
-- 
2.4.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] target/linux/generic: allow up to 4 8250-compatible UARTS

2015-08-24 Thread Alexey Brodkin
Hi Hauke,

On Mon, 2015-08-24 at 22:27 +0200, Hauke Mehrtens wrote:
> On 08/24/2015 10:23 PM, Alexey Brodkin wrote:
> > Default value of both SERIAL_8250_NR_UARTS & SERIAL_8250_RUNTIME_UARTS is 4,
> > see: 
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/tty/serial/8250/Kconfig
> > 
> > And some boards rely on that default setting.
> > What's worse some boards use 3rd or even 4th UART as its primary
> > serial console.
> > 
> > For example Synopsys DesignWare SDP board, see "console=ttyS3,115200n8"
> > here: 
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/boot/dts/axs101.dts
> > 
> > So having expected default value allows usage of kernel configs that are
> > closer to their upstream versions.
> > 
> > Cc: Jonas Gorski 
> > Cc: Zoltan HERPAI 
> > Cc: Hauke Mehrtens 
> > Cc: Dirk Neukirchen 
> > Signed-off-by: Alexey Brodkin 
> > ---
> 
> Nack.
> 
> Most targets are using 2 uarts. If your target needs more just overwrite
> this in your target/linux//config-4.1 file like it is done
> in target/linux/sunxi/config-4.1 for example.

Ok I'll add those in my board's config.

Still just for my understanding I'm wondering what benefit this limitation
allows to achieve?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng

2015-08-26 Thread Alexey Brodkin
uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/

We try to regularly add changes from uClibc to uClibc-ng.
We even sent patches and bug reports to the uClibc mailing list.
The config file is compatible between uClibc-ng 1.0 and uClibc git master.
This might change in the future.

Our main goal is to provide regularly a stable and tested release
to make embedded system developers happy.

The main advantage of uClibc-ng over olde good uClibc is regular releases
so there's no need to keep tons of patches on top of years old
0.9.33.2

Build-tested for
 [1] ARM: Sunxi generic
 [2] MIPS: Netgear WNDR3600/3700/3800

Run-tested for [yet out of the tree] Synopsys Designware ARC AXS101.

Signed-off-by: Alexey Brodkin 
Cc: Waldemar Brodkorb 
Cc: Mathieu Olivari 
Cc: Felix Fietkau 
Cc: John Crispin 
---
 toolchain/uClibc/Config.in |   4 +
 toolchain/uClibc/Config.version|   4 +
 toolchain/uClibc/common.mk |  15 +-
 toolchain/uClibc/config-ng-1.0.6/arm   |   9 +
 toolchain/uClibc/config-ng-1.0.6/armeb |   9 +
 toolchain/uClibc/config-ng-1.0.6/common| 223 +
 toolchain/uClibc/config-ng-1.0.6/debug |   6 +
 toolchain/uClibc/config-ng-1.0.6/i386  |  21 +++
 toolchain/uClibc/config-ng-1.0.6/i686  |  21 +++
 toolchain/uClibc/config-ng-1.0.6/m68k  |   6 +
 toolchain/uClibc/config-ng-1.0.6/mips  |  18 ++
 toolchain/uClibc/config-ng-1.0.6/mips64|  18 ++
 toolchain/uClibc/config-ng-1.0.6/mips64.32 |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64.64 |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64.n32|  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64el  |  18 ++
 toolchain/uClibc/config-ng-1.0.6/mips64el.32   |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64el.64   |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mips64el.n32  |  19 +++
 toolchain/uClibc/config-ng-1.0.6/mipsel|  18 ++
 toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt |  18 ++
 toolchain/uClibc/config-ng-1.0.6/powerpc   |   6 +
 toolchain/uClibc/config-ng-1.0.6/powerpc.e500  |   6 +
 toolchain/uClibc/config-ng-1.0.6/sparc |   8 +
 toolchain/uClibc/config-ng-1.0.6/sparc.leon|   8 +
 toolchain/uClibc/config-ng-1.0.6/x86_64|   6 +
 26 files changed, 553 insertions(+), 3 deletions(-)
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/arm
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/armeb
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/common
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/debug
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/i386
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/i686
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/m68k
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.64
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mips64el.n32
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mipsel
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/mipsel.cobalt
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/powerpc
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/powerpc.e500
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/sparc
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/sparc.leon
 create mode 100644 toolchain/uClibc/config-ng-1.0.6/x86_64

diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in
index 08ea00a..c923bc0 100644
--- a/toolchain/uClibc/Config.in
+++ b/toolchain/uClibc/Config.in
@@ -11,6 +11,10 @@ choice
select UCLIBC_VERSION_0_9_33
bool "uClibc 0.9.33.2"
 
+   config UCLIBC_USE_VERSION_NG
+   select UCLIBC_VERSION_NG
+   bool "uClibc-ng"
+
 endchoice
 
 # Debug version.
diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index dd302f2..b6aa471 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -2,8 +2,12 @@ config UCLIBC_VERSION
string
depends on USE_UCLIBC
default "0.9.33.2"   if UCLIBC_VERSION_0_9_33
+   default "1.0.6"  if UCLIBC_VERSION_NG
default "0.9.33.2"
 
 config UCLIBC_VERSION_0_9_33
default y if !TOOLCHAINOPTS && USE_UCLIBC
bool
+
+config UCLIBC_VERSION_NG
+   bool
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 53a8443..026d69d 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -7

Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng

2015-08-26 Thread Alexey Brodkin
Hi John,

On Wed, 2015-08-26 at 20:20 +0200, John Crispin wrote:
> Hi,
> 
> On 26/08/2015 20:11, Alexey Brodkin wrote:
> > uClibc-ng is a spin-off of original uClibc, see http://www.uclibc-ng.org/
> > 
> > We try to regularly add changes from uClibc to uClibc-ng.
> > We even sent patches and bug reports to the uClibc mailing list.
> > The config file is compatible between uClibc-ng 1.0 and uClibc git master.
> > This might change in the future.
> > 
> > Our main goal is to provide regularly a stable and tested release
> > to make embedded system developers happy.
> > 
> > The main advantage of uClibc-ng over olde good uClibc is regular releases
> > so there's no need to keep tons of patches on top of years old
> > 0.9.33.2
> > 
> 
> why do you not use musl ? it is actively support rather than being
> hooked on life support.

The point is I'm about to submit patch with support of new architecture (ARC)
in OpenWRT. And unfortunately the only libc we have now is uClibc.

And since "original" uClibc lack recent releases (where ARC support might exist
as we're in uclibc's master branch for quite some time already) I went forward
with uClibc-ng which sees releases much more often and in released tarballs
we already have support of ARC.

So I understand that other architectures may not benefit a lot from newer
uClibc but for us (ARC) there's no other way.

Hope that makes sense.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/3] Add support of ARC architecture

2015-08-27 Thread Alexey Brodkin
This patch series adds support for the Synopsys DesignWare ARC architecture.

DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.

Since version 3.9 ARC architecture is supported in mainline Linux developemnt.
Since version 2014.04 ARC architecture is supported in mainline U-Boot.
For quite some time ARC architecture is supported in upstream uClibc
development but since there were no recent releases of uClibc support of
ARC is available from uClibc's fork uClibc-ng now.

Here we add toolchain for ARC architecture and 2 target boards that could
be used for trying OpenWRT on ARC.

Alexey Brodkin (3):
  toolchain: add support of ARC architecture
  ARC: specify location of output elf
  linux: add support of Synopsys ARC boards

 include/kernel-defaults.mk |   4 +
 include/kernel.mk  |   2 +
 include/site/arc   |  30 +
 include/target.mk  |   4 +
 target/Config.in   |   9 +
 target/linux/arc/Makefile  |  28 +
 target/linux/arc/axs10x/README |  19 +
 .../linux/arc/axs10x/base-files/etc/config/network |  18 +
 target/linux/arc/axs10x/base-files/etc/inittab |   5 +
 target/linux/arc/axs10x/config-4.1 | 127 +++
 target/linux/arc/axs10x/target.mk  |   8 +
 target/linux/arc/image/Makefile|  12 +
 target/linux/arc/nsim/README   |  19 +
 target/linux/arc/nsim/base-files/etc/inittab   |   5 +
 target/linux/arc/nsim/config-4.1   |  88 ++
 target/linux/arc/nsim/target.mk|   9 +
 ...Add-support-for-AXS101-SDP-software-devel.patch | 911 +
 ...Tweak-DDR-port-aperture-mappings-for-perf.patch |  65 ++
 ...ARC-axs101-Add-missing-__init-annotations.patch |  71 ++
 .../0004-ARC-RIP-broken-64bit-RTSC.patch   | 186 +
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +
 .../0006-ARC-axs101-support-early-8250-uart.patch  |  67 ++
 toolchain/Config.in|   9 +-
 toolchain/binutils/Config.in   |  12 +-
 toolchain/binutils/Makefile|  27 +-
 toolchain/gcc/Config.in|   5 +
 toolchain/gcc/Config.version   |   9 +-
 toolchain/gcc/common.mk|  34 +-
 .../001-revert_register_mode_search.patch  |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch|  42 +
 .../arc-2015.06/003-universal_initializer.patch|  94 +++
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 +
 .../patches/arc-2015.06/010-documentation.patch|  23 +
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +
 .../210-disable_libsanitizer_off_t_check.patch |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch   |  18 +
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +
 .../arc-2015.06/850-use_shared_libgcc.patch|  47 ++
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 +
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 ++
 .../arc-2015.06/920-specs_nonfatal_getenv.patch|  14 +
 .../arc-2015.06/940-no-clobber-stamp-bits.patch|  11 +
 toolchain/gdb/Makefile |  19 +-
 toolchain/uClibc/Config.in |   2 +
 toolchain/uClibc/Config.version|   3 +-
 toolchain/uClibc/common.mk |   1 +
 toolchain/uClibc/config-ng-1.0.6/arc   |  12 +
 51 files changed, 2593 insertions(+), 28 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 target/linux/arc/Makefile
 create mode 100644 target/linux/arc/axs10x/README
 create mode 100644 target/linux/arc/axs10x/base-files/etc/config/network
 create mode 100644 target/linux/arc/axs10x/base-files/etc/inittab
 create mode 100644 target/linux/arc/axs10x/config-4.1
 create mode 100644 target/linux/arc/axs10x/target.mk
 create mode 100644 target/linux/arc/image/Makefile
 create mode 100644 target/linux/arc/nsim/README
 create mode 100644 target/linux/arc/nsim/base-files/etc/inittab
 create mode 100644 target/linux/arc/nsim/config-4.1
 create mode 100644 target/linux/arc/nsim/target.mk
 create mode 100644 
target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
 create mode 100644 
target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
 create mode 100644 
target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
 create mode 100644 
target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
 c

[OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC architecture

2015-08-27 Thread Alexey Brodkin
This includes binutils, gcc, gdb and uClibc-ng.

Latest release of ARC gcc (as of today it is "arc-2015.06")
is based on upstream gcc 4.8.4.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc

Latest release of ARC binutils (as of today it is "arc-2015.06")
is based on upstream binutils 2.23.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06

Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
is based on upstream gdb 7.9.1.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb

Note that for binutils and gdb that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of gdb in binutils and binutils in gdb hence in binutils:
-->8--
--disable-sim
--disable-gdb
-->8--

and in gdb:
-->8--
--disable-binutils
--disable-ld
--disable-gas
-->8--

Also in gdb we disable sim because if the following breakage while
building with it:
>8
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
-mono -fast -pbb -switch sem5-switch.c \
-cpu a5f -infile ./mloop5.in \
-outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
>8

Prerequisites are:
 [1] http://patchwork.ozlabs.org/patch/510985 which adds uClibc-ng support.
 [2] http://patchwork.ozlabs.org/patch/502022 which updates config.guess
 and config.sub

Cc: Felix Fietkau 
Cc: John Crispin 
Signed-off-by: Alexey Brodkin 
---
 include/site/arc   |  30 +++
 include/target.mk  |   4 +
 toolchain/Config.in|   9 +-
 toolchain/binutils/Config.in   |  12 +-
 toolchain/binutils/Makefile|  27 ++-
 toolchain/gcc/Config.in|   5 +
 toolchain/gcc/Config.version   |   9 +-
 toolchain/gcc/common.mk|  34 ++-
 .../001-revert_register_mode_search.patch  |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch|  42 
 .../arc-2015.06/003-universal_initializer.patch|  94 
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
 .../patches/arc-2015.06/010-documentation.patch|  23 ++
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
 .../210-disable_libsanitizer_off_t_check.patch |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch   |  18 ++
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
 .../arc-2015.06/850-use_shared_libgcc.patch|  47 
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +
 .../arc-2015.06/920-specs_nonfatal_getenv.patch|  14 ++
 .../arc-2015.06/940-no-clobber-stamp-bits.patch|  11 +
 toolchain/gdb/Makefile |  19 +-
 toolchain/uClibc/Config.in |   2 +
 toolchain/uClibc/Config.version|   3 +-
 toolchain/uClibc/common.mk |   1 +
 toolchain/uClibc/config-ng-1.0.6/arc   |  12 +
 31 files changed, 904 insertions(+), 28 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/010-documentation.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/820-libgcc_pic.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/850-use_shared_libgcc.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/851-libgcc_no_compat.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/860-use_eh_frame.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/870-ppc_no_crtsavres.patch

[OpenWrt-Devel] [PATCH 2/3] ARC: specify location of output elf

2015-08-27 Thread Alexey Brodkin
For now on ARC we deal with vmlinux output file which is created in
the root of kernel build folder.

Once we move to uImage we'll be able to use default location in
arch/arc/boot.

Signed-off-by: Alexey Brodkin 
---
 include/kernel-defaults.mk | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 24d2630..8f4cd91 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -131,6 +131,10 @@ ifeq ($(LINUX_KARCH),x86_64)
 IMAGES_DIR:=../../x86/boot
 endif
 
+ifeq ($(LINUX_KARCH),arc)
+IMAGES_DIR:=../../../
+endif
+
 define Kernel/CopyImage
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S 
$(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1)
$(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux 
$(KERNEL_BUILD_DIR)/vmlinux$(1).elf
-- 
2.4.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-08-27 Thread Alexey Brodkin
This patch introduces support of new boards with ARC cores.

 [1] Synopsys SDP board
 This is a new-generation development board from Synopsys that
 consists of base-board and CPU tile-board (which might have a real
 ASIC or FPGA with CPU image).
 It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
 etc and is intended to be used for early development of ARC-based
 products.

 [2] nSIM
 This is a virtual board implemented in Synopsys proprietary
 software simulator (even though available for free for open source
 community). This board has only serial port as a peripheral and so
 it is meant to be used for runtime testing which is especially
 useful during bring-up of new tools and platforms.
 What's also important ARC cores are very configurable so there're
 many variations of options like cache sizes, their line lengths,
 additional hardware blocks like multipliers, dividers etc. And this
 board could be used to make sure built software still runs on
 different HW configurations.

Note there's a prerequisite http://patchwork.ozlabs.org/patch/502081/

Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Signed-off-by: Alexey Brodkin 
---
 include/kernel.mk  |   2 +
 target/Config.in   |   9 +
 target/linux/arc/Makefile  |  28 +
 target/linux/arc/axs10x/README |  19 +
 .../linux/arc/axs10x/base-files/etc/config/network |  18 +
 target/linux/arc/axs10x/base-files/etc/inittab |   5 +
 target/linux/arc/axs10x/config-4.1 | 127 +++
 target/linux/arc/axs10x/target.mk  |   8 +
 target/linux/arc/image/Makefile|  12 +
 target/linux/arc/nsim/README   |  19 +
 target/linux/arc/nsim/base-files/etc/inittab   |   5 +
 target/linux/arc/nsim/config-4.1   |  88 ++
 target/linux/arc/nsim/target.mk|   9 +
 ...Add-support-for-AXS101-SDP-software-devel.patch | 911 +
 ...Tweak-DDR-port-aperture-mappings-for-perf.patch |  65 ++
 ...ARC-axs101-Add-missing-__init-annotations.patch |  71 ++
 .../0004-ARC-RIP-broken-64bit-RTSC.patch   | 186 +
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +
 .../0006-ARC-axs101-support-early-8250-uart.patch  |  67 ++
 19 files changed, 1685 insertions(+)
 create mode 100644 target/linux/arc/Makefile
 create mode 100644 target/linux/arc/axs10x/README
 create mode 100644 target/linux/arc/axs10x/base-files/etc/config/network
 create mode 100644 target/linux/arc/axs10x/base-files/etc/inittab
 create mode 100644 target/linux/arc/axs10x/config-4.1
 create mode 100644 target/linux/arc/axs10x/target.mk
 create mode 100644 target/linux/arc/image/Makefile
 create mode 100644 target/linux/arc/nsim/README
 create mode 100644 target/linux/arc/nsim/base-files/etc/inittab
 create mode 100644 target/linux/arc/nsim/config-4.1
 create mode 100644 target/linux/arc/nsim/target.mk
 create mode 100644 
target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
 create mode 100644 
target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
 create mode 100644 
target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
 create mode 100644 
target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
 create mode 100644 
target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch

diff --git a/include/kernel.mk b/include/kernel.mk
index 6a613fe..878a366 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -64,6 +64,8 @@ ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
 else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be ))
   LINUX_KARCH := arm64
+else ifneq (,$(findstring $(ARCH) , arceb ))
+  LINUX_KARCH := arc
 else ifneq (,$(findstring $(ARCH) , armeb ))
   LINUX_KARCH := arm
 else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
diff --git a/target/Config.in b/target/Config.in
index baae8d6..571b06e 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -100,6 +100,13 @@ config aarch64_be
select BIG_ENDIAN
bool
 
+config arc
+   bool
+
+config arceb
+   select BIG_ENDIAN
+   bool
+
 config arm
bool
 
@@ -179,6 +186,8 @@ config ARCH
string
default "aarch64"   if aarch64
default "aarch64_be" if aarch64_be
+   default "arc"   if arc
+   default "arceb" if arceb
default "arm"   if arm
default "armeb" if armeb
default "i386"  if i386
diff --git a/target/linux/arc/Makefile b/target/linux/arc/Makefile
new file mode 100644
index 000..ad252cb
--- /dev/null
+++ b/target/l

Re: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC architecture

2015-08-27 Thread Alexey Brodkin
Hi John,

On Thu, 2015-08-27 at 13:59 +0200, John Crispin wrote:
> Hi Alexey,
> 
> have you already sent these patches upstream to the gcc people ?

I'm not really sure which patches you're talking about.

If you're talking about patches I put in "toolchain/gcc/patches/arc-2015.06"
folder those are selected [mostly arch-independent] ones from
"toolchain/gcc/patches/4.8-linaro".

If you're talking about patches for GCC/binutils with support of ARC
then we're actively working on upstreaming both projects.

Moreover initial support of ARC is already in upstream GCC but that lacks many
recent improvements. We're looking forward to get all our work upstream in 
coming
months.

Hope I answered your question. Otherwise please feel free to clarify your
question and I'll answer it then.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC architecture

2015-08-27 Thread Alexey Brodkin
Hi John,

On Thu, 2015-08-27 at 14:25 +0200, John Crispin wrote:
> 
> On 27/08/2015 14:15, Alexey Brodkin wrote:
> > Hi John,
> > 
> > On Thu, 2015-08-27 at 13:59 +0200, John Crispin wrote:
> > > Hi Alexey,
> > > 
> > > have you already sent these patches upstream to the gcc people ?
> > 
> > I'm not really sure which patches you're talking about.
> > 
> > If you're talking about patches I put in "toolchain/gcc/patches/arc-2015.06"
> > folder those are selected [mostly arch-independent] ones from
> > "toolchain/gcc/patches/4.8-linaro".
> > 
> > If you're talking about patches for GCC/binutils with support of ARC
> > then we're actively working on upstreaming both projects.
> > 
> > Moreover initial support of ARC is already in upstream GCC but that lacks 
> > many
> > recent improvements. We're looking forward to get all our work upstream in 
> > coming
> > months.
> > 
> > Hope I answered your question. Otherwise please feel free to clarify your
> > question and I'll answer it then.
> > 
> > -Alexey
> > 
> 
> great, i just wanted to make sure that you are aware of the real
> upstream :) would hate to see patches bit rot in our tree

Well our position is we're working toward upstreaming.
Moreover we used to develop project on our GitHub and then submit things
upstream. But now when we have more experience and lots of stuff made its
way upstream we attempt to work literally upstream. Partially having 
maintainer's
repositories in upstream projects partially sending patches right away.

I mean I have no copy of OpenWRT tree on GitHub. I'm sending you guys
everything once I have anything to send :)

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/3] Add support of ARC architecture

2015-08-31 Thread Alexey Brodkin
Hello,

On Thu, 2015-08-27 at 14:03 +0300, Alexey Brodkin wrote:
> This patch series adds support for the Synopsys DesignWare ARC architecture.
> 
> DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.
> 
> Since version 3.9 ARC architecture is supported in mainline Linux developemnt.
> Since version 2014.04 ARC architecture is supported in mainline U-Boot.
> For quite some time ARC architecture is supported in upstream uClibc
> development but since there were no recent releases of uClibc support of
> ARC is available from uClibc's fork uClibc-ng now.
> 
> Here we add toolchain for ARC architecture and 2 target boards that could
> be used for trying OpenWRT on ARC.
> 
> Alexey Brodkin (3):
>   toolchain: add support of ARC architecture
>   ARC: specify location of output elf
>   linux: add support of Synopsys ARC boards

I'm wondering if there're any comment on this series?
Otherwise any chance for it to be applied?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC architecture

2015-09-02 Thread Alexey Brodkin
Hi Jonas,

On Wed, 2015-09-02 at 10:08 +0200, Jonas Gorski wrote:
> Hi,
> 
> On Thu, Aug 27, 2015 at 1:03 PM, Alexey Brodkin
>  wrote:
> > This includes binutils, gcc, gdb and uClibc-ng.
> > 
> > Latest release of ARC gcc (as of today it is "arc-2015.06")
> > is based on upstream gcc 4.8.4.
> > 
> > Sources are available on GitHub, see:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/gcc
> > 
> > Latest release of ARC binutils (as of today it is "arc-2015.06")
> > is based on upstream binutils 2.23.
> > 
> > Sources are available on GitHub, see:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06
> > 
> > Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
> > is based on upstream gdb 7.9.1.
> > 
> > Sources are available on GitHub, see:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb
> > 

[snip]

> > diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
> > index 8d91223..0f670f1 100644
> > --- a/toolchain/binutils/Config.in
> > +++ b/toolchain/binutils/Config.in
> > @@ -2,13 +2,19 @@
> > 
> >  choice
> > prompt "Binutils Version" if TOOLCHAINOPTS
> > -   default BINUTILS_VERSION_LINARO
> > +   default BINUTILS_VERSION_ARC if arc
> > +   default BINUTILS_VERSION_LINARO if !arc
> > help
> >   Select the version of binutils you wish to use.
> > 
> > config BINUTILS_VERSION_LINARO
> > +   depends on !arc
> > bool "Linaro binutils 2.24"
> > 
> > +   config BINUTILS_VERSION_ARC
> > +   depends on arc
> > +   bool "ARC binutils 2015.06"
> > +
> >  endchoice
> > 
> >  config EXTRA_BINUTILS_CONFIG_OPTIONS
> > @@ -21,5 +27,5 @@ config EXTRA_BINUTILS_CONFIG_OPTIONS
> >  config BINUTILS_VERSION
> > string
> > prompt "Binutils Version" if (TOOLCHAINOPTS && NULL)
> > -   default "linaro"  if BINUTILS_VERSION_LINARO
> > -   default "linaro"
> > +   default "linaro"  if BINUTILS_VERSION_LINARO || 
> > (!TOOLCHAINOPTS && !arc)
> > +   default "arc" if BINUTILS_VERSION_ARC || 
> > (!TOOLCHAINOPTS && arc)
> 
> One of BINUTILS_VERSION_ARC and BINUTILS_VERSION_LINARO will always be
> set regardless of TOOLCHAINOPTS being set, so you can drop the || ( )
> part.

Well that's not entirely correct.
If TOOLCHAIN is not set then BINUTILS_VERSION_xxx won't be set as well.
In other words following construction will lead to missing BINUTILS_VERSION
in .config:
>8
default "linaro"  if BINUTILS_VERSION_LINARO || (!TOOLCHAINOPTS && !arc)
default "arc" if BINUTILS_VERSION_ARC || (!TOOLCHAINOPTS && arc)
>8

Following construction will work:
>8
default "linaro"  if !arc
default "arc" if arc
>8

But then this thing "prompt "Binutils Version" if TOOLCHAINOPTS" makes no sense
because we force set ARC binutils for ARC and Linaro binutils for anything else.

Well even now that prompt is useless because it doesn't allow to choose anything
except Linaro :)


> > diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
> > index 0276512..d420802 100644
> > --- a/toolchain/binutils/Makefile
> > +++ b/toolchain/binutils/Makefile
> > @@ -10,11 +10,20 @@ PKG_NAME:=binutils
> >  PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
> >  BIN_VERSION:=$(PKG_VERSION)
> > 
> > -PKG_SOURCE_URL:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
> > -PKG_REV:=2.24.0-2014.09
> > -PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
> > -PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
> > -BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
> > +ifeq ($(findstring arc, $(CONFIG_BINUTILS_VERSION)),arc)
> 
> Any reason why ifeq($(CONFIG_BINUTILS_VERSION),arc) directly doesn't work?

Well it's possible to do that this way but it requires quotes word we're 
comparing to.
So following string will work:
>8
ifeq ($(CONFIG_BINUTILS_VERSION),"arc")
-

Re: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-09-02 Thread Alexey Brodkin
Hi Jonas,

On Wed, 2015-09-02 at 10:32 +0200, Jonas Gorski wrote:
> On Thu, Aug 27, 2015 at 1:03 PM, Alexey Brodkin
>  wrote:
> > This patch introduces support of new boards with ARC cores.
> > 
> >  [1] Synopsys SDP board
> >  This is a new-generation development board from Synopsys that
> >  consists of base-board and CPU tile-board (which might have a real
> >  ASIC or FPGA with CPU image).
> >  It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
> >  etc and is intended to be used for early development of ARC-based
> >  products.
> > 
> >  [2] nSIM
> >  This is a virtual board implemented in Synopsys proprietary
> >  software simulator (even though available for free for open source
> >  community). This board has only serial port as a peripheral and so
> >  it is meant to be used for runtime testing which is especially
> >  useful during bring-up of new tools and platforms.
> >  What's also important ARC cores are very configurable so there're
> >  many variations of options like cache sizes, their line lengths,
> >  additional hardware blocks like multipliers, dividers etc. And this
> >  board could be used to make sure built software still runs on
> >  different HW configurations.
> > 
> > Note there's a prerequisite http://patchwork.ozlabs.org/patch/502081/

[snip]

> > diff --git a/target/linux/arc/axs10x/config-4.1 
> > b/target/linux/arc/axs10x/config-4.1
> > new file mode 100644
> > index 000..2cd3471
> > --- /dev/null
> > +++ b/target/linux/arc/axs10x/config-4.1
> > @@ -0,0 +1,127 @@
> > +#
> > +# ARC Architecture Configuration
> > +#
> 
> Please run make kernel_{menu|old|def}config to make this configs
> contain only the differences to the generic config.

Hm... even though I see "kernel_menuconfig" and "kernel_oldconfig"
targets exist in OpenWRT I cannot fing "kernel_defconfig". So I'm not sure
if there's an automated way for creation of minimalistic defconfig that
takes into account all levels of higher-level configs.

And kernel's "make savedefconfig" won't help here as well because
lots of items will be stripped from defconfig and so OpenWRT on build will
ask user to decide if this and that option should be on or off.

I tried to create very minimal configs that still have all options covered
on oldconfig.

If there's a how-to or guide on hoe to prepare configs for OpenWRT target
I'll try to conform its requirements.

> Also please move
> all common options from both subtargets into a
> target/linux/arc/config-4.1.

Well indeed there're same options in both configs.
But please note nSIM and AXS10x are completely different boards.
And each of those boards may have different CPU.

This first set of patches only covers ARC legacy architecture (ARC 700).

But with 4.2 release of Linux kernel new gen ARC architecture (ARC HS38)
was introduced and once that patch set is accepted in OpenWRT I'll
send another patch that add support of new gen ARC CPUs.

My plan was to have following files structure:

target/linux/arc/axs10x/profiles/arc700.mk
/archs38.mk
/nsim/profiles/arc700.mk
  /archs38.mk

Is it acceptable or I need to modify it?

> > diff --git a/target/linux/arc/nsim/target.mk 
> > b/target/linux/arc/nsim/target.mk
> > new file mode 100644
> > index 000..a36d98b
> > --- /dev/null
> > +++ b/target/linux/arc/nsim/target.mk
> > @@ -0,0 +1,9 @@
> > +BOARDNAME:=nSIM
> > +
> > +define Target/Description
> > +   Simple nSIM simulator of ARC cores.
> > +   Its only peripheral is serial port.
> > +   Useful for simple smoke-testing.
> > +endef
> > +
> > +FEATURES += ramdisk
> > \ No newline at end of file
> 
> Please fix this ^ ;)

Ooops somehow slipped through the cracks.
Will definitely fix it.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] toolchain: add support of ARC architecture

2015-09-03 Thread Alexey Brodkin
Hi Jonas,

On Thu, 2015-09-03 at 15:18 +0200, Jonas Gorski wrote:
> Hi,
> 
> On Wed, Sep 2, 2015 at 9:58 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Wed, 2015-09-02 at 10:08 +0200, Jonas Gorski wrote:
> > > Hi,
> > > 
> > > On Thu, Aug 27, 2015 at 1:03 PM, Alexey Brodkin
> > >  wrote:
> > > > This includes binutils, gcc, gdb and uClibc-ng.
> > > > 
> > > > Latest release of ARC gcc (as of today it is "arc-2015.06")
> > > > is based on upstream gcc 4.8.4.
> > > > 
> > > > Sources are available on GitHub, see:
> > > > https://github.com/foss-for-synopsys-dwc-arc-processors/gcc
> > > > 
> > > > Latest release of ARC binutils (as of today it is "arc-2015.06")
> > > > is based on upstream binutils 2.23.
> > > > 
> > > > Sources are available on GitHub, see:
> > > > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06
> > > > 
> > > > Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
> > > > is based on upstream gdb 7.9.1.
> > > > 
> > > > Sources are available on GitHub, see:
> > > > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb
> > > > 
> > 
> > [snip]
> > 
> > > > diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
> > > > index 8d91223..0f670f1 100644
> > > > --- a/toolchain/binutils/Config.in
> > > > +++ b/toolchain/binutils/Config.in
> > > > @@ -2,13 +2,19 @@
> > > > 
> > > >  choice
> > > > prompt "Binutils Version" if TOOLCHAINOPTS
> > > > -   default BINUTILS_VERSION_LINARO
> > > > +   default BINUTILS_VERSION_ARC if arc
> > > > +   default BINUTILS_VERSION_LINARO if !arc
> > > > help
> > > >   Select the version of binutils you wish to use.
> > > > 
> > > > config BINUTILS_VERSION_LINARO
> > > > +   depends on !arc
> > > > bool "Linaro binutils 2.24"
> > > > 
> > > > +   config BINUTILS_VERSION_ARC
> > > > +   depends on arc
> > > > +   bool "ARC binutils 2015.06"
> > > > +
> > > >  endchoice
> > > > 
> > > >  config EXTRA_BINUTILS_CONFIG_OPTIONS
> > > > @@ -21,5 +27,5 @@ config EXTRA_BINUTILS_CONFIG_OPTIONS
> > > >  config BINUTILS_VERSION
> > > > string
> > > > prompt "Binutils Version" if (TOOLCHAINOPTS && NULL)
> > > > -   default "linaro"  if BINUTILS_VERSION_LINARO
> > > > -   default "linaro"
> > > > +   default "linaro"  if BINUTILS_VERSION_LINARO || 
> > > > (!TOOLCHAINOPTS && !arc)
> > > > +   default "arc" if BINUTILS_VERSION_ARC || 
> > > > (!TOOLCHAINOPTS && arc)
> > > 
> > > One of BINUTILS_VERSION_ARC and BINUTILS_VERSION_LINARO will always be
> > > set regardless of TOOLCHAINOPTS being set, so you can drop the || ( )
> > > part.
> > 
> > Well that's not entirely correct.
> > If TOOLCHAIN is not set then BINUTILS_VERSION_xxx won't be set as well.
> > In other words following construction will lead to missing BINUTILS_VERSION
> > in .config:
> > >8
> > default "linaro"  if BINUTILS_VERSION_LINARO || (!TOOLCHAINOPTS && 
> > !arc)
> > default "arc" if BINUTILS_VERSION_ARC || (!TOOLCHAINOPTS && arc)
> > >8
> > 
> > Following construction will work:
> > >8
> > default "linaro"  if !arc
> > default "arc" if arc
> > >8
> > 
> > But then this thing "prompt "Binutils Version" if TOOLCHAINOPTS" makes no 
> > sense
> > because we force set ARC binutils for ARC and Linaro binutils for anything 
> > else.
> > 
> > Well even now that prompt is useless because it doesn't allow to choose 
> > anything
> > except Linaro :)
> 
> T

Re: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-09-03 Thread Alexey Brodkin
Hi Jonas,

On Thu, 2015-09-03 at 15:33 +0200, Jonas Gorski wrote:
> Hi,
> 
> On Wed, Sep 2, 2015 at 10:40 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Wed, 2015-09-02 at 10:32 +0200, Jonas Gorski wrote:
> > > On Thu, Aug 27, 2015 at 1:03 PM, Alexey Brodkin
> > >  wrote:
> > > > This patch introduces support of new boards with ARC cores.
> > > > 
> > > >  [1] Synopsys SDP board
> > > >  This is a new-generation development board from Synopsys that
> > > >  consists of base-board and CPU tile-board (which might have a real
> > > >  ASIC or FPGA with CPU image).
> > > >  It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
> > > >  etc and is intended to be used for early development of ARC-based
> > > >  products.
> > > > 
> > > >  [2] nSIM
> > > >  This is a virtual board implemented in Synopsys proprietary
> > > >  software simulator (even though available for free for open source
> > > >  community). This board has only serial port as a peripheral and so
> > > >  it is meant to be used for runtime testing which is especially
> > > >  useful during bring-up of new tools and platforms.
> > > >  What's also important ARC cores are very configurable so there're
> > > >  many variations of options like cache sizes, their line lengths,
> > > >  additional hardware blocks like multipliers, dividers etc. And this
> > > >  board could be used to make sure built software still runs on
> > > >  different HW configurations.
> > > > 
> > > > Note there's a prerequisite http://patchwork.ozlabs.org/patch/502081/
> > 
> > [snip]
> > 
> > > > diff --git a/target/linux/arc/axs10x/config-4.1 
> > > > b/target/linux/arc/axs10x/config-4.1
> > > > new file mode 100644
> > > > index 000..2cd3471
> > > > --- /dev/null
> > > > +++ b/target/linux/arc/axs10x/config-4.1
> > > > @@ -0,0 +1,127 @@
> > > > +#
> > > > +# ARC Architecture Configuration
> > > > +#
> > > 
> > > Please run make kernel_{menu|old|def}config to make this configs
> > > contain only the differences to the generic config.
> > 
> > Hm... even though I see "kernel_menuconfig" and "kernel_oldconfig"
> > targets exist in OpenWRT I cannot fing "kernel_defconfig". So I'm not sure
> > if there's an automated way for creation of minimalistic defconfig that
> > takes into account all levels of higher-level configs.
> 
> Right, kernel_defconfig doesn't exist, I always forget that. Buf
> running kernel_oldconfig or kernel_menuconfig and saving should work
> mostly the same way.
> 
> You can choose which config to modify with CONFIG_TARGET=platform for
> the top target config and CONFIG_TARGET=subtarget for the subtarget.
> The target config will be the difference to the generic config, and
> the subtarget config will be then the difference to (generic +
> target).

Ok I'll try to do that.

> > And kernel's "make savedefconfig" won't help here as well because
> > lots of items will be stripped from defconfig and so OpenWRT on build will
> > ask user to decide if this and that option should be on or off.
> > 
> > I tried to create very minimal configs that still have all options covered
> > on oldconfig.
> > 
> > If there's a how-to or guide on hoe to prepare configs for OpenWRT target
> > I'll try to conform its requirements.
> 
> There is no how-to, but if running make kernel_oldconfig for either
> CONFIG_TARGET={platform|subtarget} results in no changed files, then
> you did it right.

Understood :)

> > > Also please move
> > > all common options from both subtargets into a
> > > target/linux/arc/config-4.1.
> > 
> > Well indeed there're same options in both configs.
> > But please note nSIM and AXS10x are completely different boards.
> > And each of those boards may have different CPU.
> > 
> > This first set of patches only covers ARC legacy architecture (ARC 700).
> > 
> > But with 4.2 release of Linux kernel new gen ARC architecture (ARC HS38)
> > was introduced and once that patch set is accepted in OpenWRT I'll
> > send another patch that add support of new gen ARC CPUs.
> > 
> > My plan was to have following files structure:
> > 
> > target/linux/arc/axs1

Re: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-09-04 Thread Alexey Brodkin
Hi Jonas,

On Fri, 2015-09-04 at 12:25 +0200, Jonas Gorski wrote:
> Hi,
> 
> On Thu, Sep 3, 2015 at 6:11 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Thu, 2015-09-03 at 15:33 +0200, Jonas Gorski wrote:
> > > Hi,
> > > 
> > > On Wed, Sep 2, 2015 at 10:40 PM, Alexey Brodkin
> > >  wrote:
> > > > Hi Jonas,
> > > > 
> > > > On Wed, 2015-09-02 at 10:32 +0200, Jonas Gorski wrote:
> > > > > Also please move
> > > > > all common options from both subtargets into a
> > > > > target/linux/arc/config-4.1.
> > > > 
> > > > Well indeed there're same options in both configs.
> > > > But please note nSIM and AXS10x are completely different boards.
> > > > And each of those boards may have different CPU.
> > > > 
> > > > This first set of patches only covers ARC legacy architecture (ARC 700).
> > > > 
> > > > But with 4.2 release of Linux kernel new gen ARC architecture (ARC HS38)
> > > > was introduced and once that patch set is accepted in OpenWRT I'll
> > > > send another patch that add support of new gen ARC CPUs.
> > > > 
> > > > My plan was to have following files structure:
> > > > 
> > > > target/linux/arc/axs10x/profiles/arc700.mk
> > > > /archs38.mk
> > > > /nsim/profiles/arc700.mk
> > > >   /archs38.mk
> > > > 
> > > > Is it acceptable or I need to modify it?
> > > 
> > > That seems backward, since arc700 and hs38 are different
> > > architectures, so I would assume their kernels and toolchains won't be
> > > compatible.
> > > 
> > > So I would use
> > > 
> > > target/linuxarc/arc700
> > > and
> > > target/linux/arc/hs38
> > > 
> > > and then
> > > 
> > > target/linux/arc/profiles/axs10x.mk
> > > and
> > > target/linux/arc/profiles/nsim.mk
> > > 
> > > (You can have "toplevel" profiles that apply to all subtargets)
> > 
> > Well I don't understand how that will work.
> > I mean we need to have different:
> >  [1] kernel config options for both pairs: boards (axs10x vs nsim)
> >  and architectures (arcv1 vs arcv2)
> >  [2] basefiles for boards (axs10x vs nsim)
> > 
> > I.e. setting profiles for axs10x and nsim won't be enough.
> > 
> > Maybe this all is not very clear, so I'll try to put here what we need to 
> > accommodate:
> >  [1] For axs10x board:
> > a) base files for axs10x board
> > b) kernel options for axs10x board
> > c) kernel options for arc700 core in axs10x
> > d) kernel options for archs38 core in axs10x
> > 
> >  [2] For nsim board:
> > a) base files for nsim board
> > b) kernel options for nsim board
> > c) kernel options for arc700
> > core in nsim
> > d) kernel options for archs38 core in nsim
> > 
> > So maybe the only option that will work is having 2 top-level arc entries 
> > like:
> >  * target/linux/arcv1 (or arc700)
> >  * target/linux/arcv2 (or archs38)
> > 
> > Or another alternative is 4 subtargets like that (I see something similar 
> > for RPi,
> > see target/linux/brcm2708):
> 
> brcm2708 does this because bcm2709 supports a newer arm instruction
> set, so to not be limited by the older one we split it into 2708 and
> 2709. If they both supported the same arm version, then there would be
> no need for subtargets.
> 
> >  * target/linux/axs101 (which is axs10x with arc700)
> >  * target/linux/axs103 (which is axs10x with archs38)
> >  * target/linux/nsim_700 (which is nsim with arc700)
> >  * target/linux/nsim_hs (which is nsim with archs38)
> > 
> > But that in its turn will require to duplicate basefiles and kernel configs
> > relevant to boards but not cores.
> > 
> > Any thoughts about that are much appreciated.
> 
> Unfortunately that is not how OpenWrt is supposed to work. The
> expectation is that a (sub)target is for all boards that share a
> certain (family of) SoCs, not just a single board. Looking at Linux
> 4.2, you are using device tree, so I would assume it would be possible
> to build a kenrel that "supports" all boards with a arc700 cpu,
> through passing the appropriate dtb to it. And likewise for the hs38.
> If the bootloader does not support passing a dtb, then it maybe
> ap

Re: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-09-04 Thread Alexey Brodkin
Hi Jonas,

On Fri, 2015-09-04 at 12:40 +0200, Jonas Gorski wrote:
> Hi,
> 
> On Fri, Sep 4, 2015 at 12:35 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Fri, 2015-09-04 at 12:25 +0200, Jonas Gorski wrote:
> > > Hi,
> > > 
> > > On Thu, Sep 3, 2015 at 6:11 PM, Alexey Brodkin
> > >  wrote:
> > > > Hi Jonas,
> > > > 
> > > > On Thu, 2015-09-03 at 15:33 +0200, Jonas Gorski wrote:
> > > > > Hi,
> > > > > 
> > > > > On Wed, Sep 2, 2015 at 10:40 PM, Alexey Brodkin
> > > > >  wrote:
> > > > > > Hi Jonas,
> > > > > > 
> > > > > > On Wed, 2015-09-02 at 10:32 +0200, Jonas Gorski wrote:
> > > > > > > Also please move
> > > > > > > all common options from both subtargets into a
> > > > > > > target/linux/arc/config-4.1.
> > > > > > 
> > > > > > Well indeed there're same options in both configs.
> > > > > > But please note nSIM and AXS10x are completely different boards.
> > > > > > And each of those boards may have different CPU.
> > > > > > 
> > > > > > This first set of patches only covers ARC legacy architecture (ARC 
> > > > > > 700).
> > > > > > 
> > > > > > But with 4.2 release of Linux kernel new gen ARC architecture (ARC 
> > > > > > HS38)
> > > > > > was introduced and once that patch set is accepted in OpenWRT I'll
> > > > > > send another patch that add support of new gen ARC CPUs.
> > > > > > 
> > > > > > My plan was to have following files structure:
> > > > > > 
> > > > > > target/linux/arc/axs10x/profiles/arc700.mk
> > > > > > /archs38.mk
> > > > > > /nsim/profiles/arc700.mk
> > > > > >   /archs38.mk
> > > > > > 
> > > > > > Is it acceptable or I need to modify it?
> > > > > 
> > > > > That seems backward, since arc700 and hs38 are different
> > > > > architectures, so I would assume their kernels and toolchains won't be
> > > > > compatible.
> > > > > 
> > > > > So I would use
> > > > > 
> > > > > target/linuxarc/arc700
> > > > > and
> > > > > target/linux/arc/hs38
> > > > > 
> > > > > and then
> > > > > 
> > > > > target/linux/arc/profiles/axs10x.mk
> > > > > and
> > > > > target/linux/arc/profiles/nsim.mk
> > > > > 
> > > > > (You can have "toplevel" profiles that apply to all subtargets)
> > > > 
> > > > Well I don't understand how that will work.
> > > > I mean we need to have different:
> > > >  [1] kernel config options for both pairs: boards (axs10x vs nsim)
> > > >  and architectures (arcv1 vs arcv2)
> > > >  [2] basefiles for boards (axs10x vs nsim)
> > > > 
> > > > I.e. setting profiles for axs10x and nsim won't be enough.
> > > > 
> > > > Maybe this all is not very clear, so I'll try to put here what we need 
> > > > to accommodate:
> > > >  [1] For axs10x board:
> > > > a) base files for axs10x board
> > > > b) kernel options for axs10x board
> > > > c) kernel options for arc700 core in axs10x
> > > > d) kernel options for archs38 core in axs10x
> > > > 
> > > >  [2] For nsim board:
> > > > a) base files for nsim board
> > > > b) kernel options for nsim board
> > > > c) kernel options for arc700
> > > > core in nsim
> > > > d) kernel options for archs38 core in nsim
> > > > 
> > > > So maybe the only option that will work is having 2 top-level arc 
> > > > entries like:
> > > >  * target/linux/arcv1 (or arc700)
> > > >  * target/linux/arcv2 (or archs38)
> > > > 
> > > > Or another alternative is 4 subtargets like that (I see something 
> > > > similar for RPi,
> > > > see target/linux/brcm2708):
> > > 
> > > brcm2708 does this because bcm2709 supports a newer arm instruction
> > > set, so to not be limited by the older o

Re: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-09-04 Thread Alexey Brodkin
Hi Jonas,

On Fri, 2015-09-04 at 13:01 +0200, Jonas Gorski wrote:
> On Fri, Sep 4, 2015 at 12:45 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Fri, 2015-09-04 at 12:40 +0200, Jonas Gorski wrote:
> > > Hi,
> > > 
> > > On Fri, Sep 4, 2015 at 12:35 PM, Alexey Brodkin
> > > > If one of my proposals above ok?
> > > > For example this one?
> > > > --->8
> > > >  * target/linux/arcv1 (or arc700)
> > > >  * target/linux/arcv2 (or archs38)
> > > > --->8
> > > > 
> > > > In this scheme we do have different architectures with incompatible
> > > > tools and binaries.
> > > 
> > > Right, although I would think
> > > 
> > > target/linux/arc/arcv1/
> > > target/linux/arc/arcv2/
> > > 
> > > would be better, as surely they will share all the driver options, and
> > > only differ in the selected cpu. Also that would mean you/we only have
> > > one set of kernel patches to maintain.
> > 
> > Agree.
> > So then what about boards? Where should they be placed in this hierarchy?
> > Will it be something like that?
> > 
> >  * target/linux/arc/arcv1/axs101 (or "axs10x" for uniformity)
> >  /nsim_700 (or "nsim" for uniformity)
> >  * target/linux/arc/arcv2/axs103 (or "axs10x")
> >  /nsim_hs (or "nsim")
> 
> Boards usually don't have their own directories, you would define
> profiles in target/linux/arc//profiles. These are usually
> grouped by manufacturer, so a synopsis.mk would contain all
> reference/development boards directly offered by you. It is also
> common to provide a "Default" / "Generic" profile for building all
> boards at once, which has a reasonable set of packages (mostly kmods)
> to include that cover the most common devices found on the boards
> (e.g. if most boards have usb, it should include the usb modules etc).
> 
> Within your target/linux/arc/base-files you would use a runtime
> detection mechanism for determining the board at first boot to
> generate an appropriate network config etc. Since you are using device
> tree, you can easily use /proc/device-tree/model (or compatible) for
> identifying the board you are running on.
> 
> The most recent iteration of setup-default-config uses
> base-files/etc/board.d/ (see ramips), and the most common is setting
> up through base-files/etc/uci-defaults/ scripts. I can't really give
> you much information about the former, since I haven't used it myself.

Thanks for the pointer, I'll play with that dynamic setup of board
things and .dts patching.

Still I have one question unsolved.
ARC architecture is very configurable, i.e. there could be
arc700-based SoC with MMU page 4, 8 or 16 kB or cache line length
typically of 32 or 64 bytes.

And unfortunately .dts doesn't help here because those values
a defined during kernel configuration and then become built-ins.

I.e. I need to have a way to use a bit different kernel config for
each board. Well it's not really required for all boards to have
different configs - at least within Synopsys we try to keep configs
aligned between platforms but tomorrow new board will appear with
different core settings and I'd like to be prepared to it.

Any thoughts on how to solve it properly in OpenWRT?

-Alexey

P.S. Yes, I know that super-configurability is a bit of pain when it comes
to support it but that's how we differentiate ourselves from others and
so we have to support it, otherwise why make that different hardware? :)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/3] linux: add support of Synopsys ARC boards

2015-09-04 Thread Alexey Brodkin
Hi Jonas,

On Fri, 2015-09-04 at 15:44 +0200, Jonas Gorski wrote:
> Hi,
> 
> On Fri, Sep 4, 2015 at 1:24 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Fri, 2015-09-04 at 13:01 +0200, Jonas Gorski wrote:
> > > On Fri, Sep 4, 2015 at 12:45 PM, Alexey Brodkin
> > >  wrote:
> > > > Hi Jonas,
> > > > 
> > > > On Fri, 2015-09-04 at 12:40 +0200, Jonas Gorski wrote:
> > > > > Hi,
> > > > > 
> > > > > On Fri, Sep 4, 2015 at 12:35 PM, Alexey Brodkin
> > > > > > If one of my proposals above ok?
> > > > > > For example this one?
> > > > > > --->8
> > > > > >  * target/linux/arcv1 (or arc700)
> > > > > >  * target/linux/arcv2 (or archs38)
> > > > > > --->8
> > > > > > 
> > > > > > In this scheme we do have different architectures with incompatible
> > > > > > tools and binaries.
> > > > > 
> > > > > Right, although I would think
> > > > > 
> > > > > target/linux/arc/arcv1/
> > > > > target/linux/arc/arcv2/
> > > > > 
> > > > > would be better, as surely they will share all the driver options, and
> > > > > only differ in the selected cpu. Also that would mean you/we only have
> > > > > one set of kernel patches to maintain.
> > > > 
> > > > Agree.
> > > > So then what about boards? Where should they be placed in this 
> > > > hierarchy?
> > > > Will it be something like that?
> > > > 
> > > >  * target/linux/arc/arcv1/axs101 (or "axs10x" for uniformity)
> > > >  /nsim_700 (or "nsim" for uniformity)
> > > >  * target/linux/arc/arcv2/axs103 (or "axs10x")
> > > >  /nsim_hs (or "nsim")
> > > 
> > > Boards usually don't have their own directories, you would define
> > > profiles in target/linux/arc//profiles. These are usually
> > > grouped by manufacturer, so a synopsis.mk would contain all
> > > reference/development boards directly offered by you. It is also
> > > common to provide a "Default" / "Generic" profile for building all
> > > boards at once, which has a reasonable set of packages (mostly kmods)
> > > to include that cover the most common devices found on the boards
> > > (e.g. if most boards have usb, it should include the usb modules etc).
> > > 
> > > Within your target/linux/arc/base-files you would use a runtime
> > > detection mechanism for determining the board at first boot to
> > > generate an appropriate network config etc. Since you are using device
> > > tree, you can easily use /proc/device-tree/model (or compatible) for
> > > identifying the board you are running on.
> > > 
> > > The most recent iteration of setup-default-config uses
> > > base-files/etc/board.d/ (see ramips), and the most common is setting
> > > up through base-files/etc/uci-defaults/ scripts. I can't really give
> > > you much information about the former, since I haven't used it myself.
> > 
> > Thanks for the pointer, I'll play with that dynamic setup of board
> > things and .dts patching.
> > 
> > Still I have one question unsolved.
> > ARC architecture is very configurable, i.e. there could be
> > arc700-based SoC with MMU page 4, 8 or 16 kB or cache line length
> > typically of 32 or 64 bytes.
> > 
> > And unfortunately .dts doesn't help here because those values
> > a defined during kernel configuration and then become built-ins.
> > 
> > I.e. I need to have a way to use a bit different kernel config for
> > each board. Well it's not really required for all boards to have
> > different configs - at least within Synopsys we try to keep configs
> > aligned between platforms but tomorrow new board will appear with
> > different core settings and I'd like to be prepared to it.
> > 
> > Any thoughts on how to solve it properly in OpenWRT?
> 
> Are the MMU page sizes hardcoded in the silicon/by pin strapping, or
> are they selectable at run time? Of course which are available likely
> depends on the core. But maybe there is a common one that's always
> available.

No this those options are selected during ASIC design process HW
engineer and then RTL gets built with hard-coded setting.
That said if MMU pa

Re: [OpenWrt-Devel] [PATCH 0/3] Add support of ARC architecture

2015-09-14 Thread Alexey Brodkin
Hi Felix,

On Fri, 2015-09-11 at 15:09 +0200, Felix Fietkau wrote:
> On 2015-08-27 13:03, Alexey Brodkin wrote:
> > This patch series adds support for the Synopsys DesignWare ARC architecture.
> > 
> > DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.
> > 
> > Since version 3.9 ARC architecture is supported in mainline Linux 
> > developemnt.
> > Since version 2014.04 ARC architecture is supported in mainline U-Boot.
> > For quite some time ARC architecture is supported in upstream uClibc
> > development but since there were no recent releases of uClibc support of
> > ARC is available from uClibc's fork uClibc-ng now.
> Does Synopsys plan to add ARC support to musl as well? The code quality
> of musl is so much better than uClibc, and it also requires much less
> architecture specific code.
> I think more projects will switch from uClibc to musl in the future.

We do have plans for adding support of ARC in musl.
But these are long-term plans and we don't have any dates in mind yet.

So for now we'll keep using uClibc.
And I hope this fact won't block ARC port from being accepted in OpenWRt.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/3] Add support of ARC architecture

2015-09-14 Thread Alexey Brodkin
Hi John,

On Mon, 2015-09-14 at 13:41 +0200, John Crispin wrote:
> 
> On 14/09/2015 13:35, Alexey Brodkin wrote:
> > Hi Felix,
> > 
> > On Fri, 2015-09-11 at 15:09 +0200, Felix Fietkau wrote:
> > > On 2015-08-27 13:03, Alexey Brodkin wrote:
> > > > This patch series adds support for the Synopsys DesignWare ARC 
> > > > architecture.
> > > > 
> > > > DesignWare ARC700 is family of 32-bit CPUs developed by Synopsys, Inc.
> > > > 
> > > > Since version 3.9 ARC architecture is supported in mainline Linux 
> > > > developemnt.
> > > > Since version 2014.04 ARC architecture is supported in mainline U-Boot.
> > > > For quite some time ARC architecture is supported in upstream uClibc
> > > > development but since there were no recent releases of uClibc support of
> > > > ARC is available from uClibc's fork uClibc-ng now.
> > > Does Synopsys plan to add ARC support to musl as well? The code quality
> > > of musl is so much better than uClibc, and it also requires much less
> > > architecture specific code.
> > > I think more projects will switch from uClibc to musl in the future.
> > 
> > We do have plans for adding support of ARC in musl.
> > But these are long-term plans and we don't have any dates in mind yet.
> > 
> > So for now we'll keep using uClibc.
> > And I hope this fact won't block ARC port from being accepted in OpenWRt.
> > 
> 
> not a blocker but something we wanted to be sure that cannot be avoided :)

Unfortunately for now we don't have any option other than uClibc.

But as mentioned above we do plan to support with time more and more 
alternatives.
The problem is we have plenty of things to support while still being a small 
group
of engineers.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Questions about "binutils: add binutils 2.25.1"

2015-09-14 Thread Alexey Brodkin
Hi Hauke,

I noticed your change made in "toolchain/binutils" recently:
->8-
http://git.openwrt.org/?p=openwrt.git;a=commit;h=fece50d94033c1dcfc3f290acbd428f9125c30aa

binutils: add binutils 2.25.1

This adds binutils 2.25.1 as an option to OpenWrt.

Signed-off-by: Hauke Mehrtens 

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46874 
3c298f89-4303-0410-b956-a3cf2f4a3e73
->8-

First of all I cannot find that patch in neither OpenWRT mailing list
(I mean openwrt-devel@lists.openwrt.org) nor in OpenWRT patchwork.

Did I overlook something?

But my real question was in "toolchain/binutils/Config.in" you added
the following:
->8-
   config BINUTILS_VERSION_2_25_1
   bool "Linaro binutils 2.25.1" <-- note "Linaro" word
->8-

But in all other places I see there's no mention of "Linaro" for that
2.25.1 version.

In fact PKG_SOURCE_URL:=@GNU/binutils/ for it so it looks like this is
pristine binutils with no Linaro changes.

So probably description of BINUTILS_VERSION_2_25_1 should be changed.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2] ARC770 updates

2016-01-14 Thread Alexey Brodkin
This series introduces quite minor changes for ARC770 SoC:
 [1] Linux kernel 4.4 is used now
 [2] Kernel patches are moved to generic 4.4 patches

Alexey Brodkin (2):
  arc770: bump linux kernel from 4.3 to 4.4
  arc770: move arc patches to taregt/linux/generic

 target/linux/arc770/Makefile   |   2 +-
 target/linux/arc770/config-4.3 | 179 -
 target/linux/arc770/config-4.4 | 169 +++
 target/linux/arc770/dts/axc001.dtsi|   2 +-
 target/linux/arc770/dts/axs101.dts |   2 +-
 target/linux/arc770/dts/axs10x_mb.dtsi |   1 +
 target/linux/arc770/dts/skeleton.dtsi  |   2 +-
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  31 
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  82 --
 .../331-arc-remove-dependency-on-DEVTMPFS.patch|  36 +
 .../patches-4.4/332-arc-add-OWRTDTB-section.patch  |  91 +++
 11 files changed, 301 insertions(+), 296 deletions(-)
 delete mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/config-4.4
 delete mode 100644 
target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 delete mode 100644 
target/linux/arc770/patches-4.3/0002-openwrt-arc-add-OWRTDTB-section.patch
 create mode 100644 
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/generic/patches-4.4/332-arc-add-OWRTDTB-section.patch

-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] arc770: bump linux kernel from 4.3 to 4.4

2016-01-14 Thread Alexey Brodkin
This switch involved:
 [1] Regeneration of config (few options went away)
 [2] Regeneration of patches so they apply cleanly (different offsets)
 [3] Update of .dts files because we now explicitly specify
 memory regions in use as opposed to previously used offset
 from 0x8000_

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---
 target/linux/arc770/Makefile   |   2 +-
 target/linux/arc770/config-4.3 | 179 -
 target/linux/arc770/config-4.4 | 169 +++
 target/linux/arc770/dts/axc001.dtsi|   2 +-
 target/linux/arc770/dts/axs101.dts |   2 +-
 target/linux/arc770/dts/axs10x_mb.dtsi |   1 +
 target/linux/arc770/dts/skeleton.dtsi  |   2 +-
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  31 
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  82 --
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  91 +++
 11 files changed, 301 insertions(+), 296 deletions(-)
 delete mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/config-4.4
 delete mode 100644 
target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 delete mode 100644 
target/linux/arc770/patches-4.3/0002-openwrt-arc-add-OWRTDTB-section.patch
 create mode 100644 
target/linux/arc770/patches-4.4/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/arc770/patches-4.4/0002-openwrt-arc-add-OWRTDTB-section.patch

diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile
index f62bf0e..52c5e00 100644
--- a/target/linux/arc770/Makefile
+++ b/target/linux/arc770/Makefile
@@ -13,7 +13,7 @@ CFLAGS:=-Os -pipe -fno-caller-saves -matomic
 MAINTAINER:=Alexey Brodkin 
 SUBTARGETS:=generic
 
-KERNEL_PATCHVER:=4.3
+KERNEL_PATCHVER:=4.4
 
 DEVICE_TYPE:=developerboard
 
diff --git a/target/linux/arc770/config-4.3 b/target/linux/arc770/config-4.3
deleted file mode 100644
index 7a13480..000
--- a/target/linux/arc770/config-4.3
+++ /dev/null
@@ -1,179 +0,0 @@
-# CONFIG_16KSTACKS is not set
-CONFIG_ARC=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARC_BUILTIN_DTB_NAME=""
-CONFIG_ARC_CACHE=y
-CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_ARC_CACHE_PAGES=y
-# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
-# CONFIG_ARC_CANT_LLSC is not set
-# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
-# CONFIG_ARC_CPU_750D is not set
-CONFIG_ARC_CPU_770=y
-CONFIG_ARC_CURR_IN_REG=y
-CONFIG_ARC_DBG=y
-# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
-# CONFIG_ARC_DBG_TLB_PARANOIA is not set
-CONFIG_ARC_DW2_UNWIND=y
-# CONFIG_ARC_EMUL_UNALIGNED is not set
-# CONFIG_ARC_FPU_SAVE_RESTORE is not set
-CONFIG_ARC_HAS_DCACHE=y
-# CONFIG_ARC_HAS_DCCM is not set
-CONFIG_ARC_HAS_HW_MPY=y
-CONFIG_ARC_HAS_ICACHE=y
-# CONFIG_ARC_HAS_ICCM is not set
-CONFIG_ARC_HAS_LLSC=y
-CONFIG_ARC_HAS_SWAPE=y
-# CONFIG_ARC_METAWARE_HLINK is not set
-# CONFIG_ARC_MMU_V1 is not set
-# CONFIG_ARC_MMU_V2 is not set
-CONFIG_ARC_MMU_V3=y
-# CONFIG_ARC_PAGE_SIZE_16K is not set
-# CONFIG_ARC_PAGE_SIZE_4K is not set
-CONFIG_ARC_PAGE_SIZE_8K=y
-CONFIG_ARC_PLAT_AXS10X=y
-CONFIG_ARC_PLAT_SIM=y
-# CONFIG_ARC_PLAT_TB10X is not set
-# CONFIG_ARC_UBOOT_SUPPORT is not set
-CONFIG_AXS101=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_COMMON_CLK=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_WORKQUEUE=y
-CONFIG_DTC=y
-CONFIG_DWMAC_GENERIC=y
-# CONFIG_DWMAC_IPQ806X is not set
-# CONFIG_DWMAC_LPC18XX is not set
-# CONFIG_DWMAC_MESON is not set
-# CONFIG_DWMAC_ROCKCHIP is not set
-# CONFIG_DWMAC_SOCFPGA is not set
-# CONFIG_DWMAC_STI is not set
-# CONFIG_DWMAC_SUNXI is not set
-CONFIG_DW_APB_ICTL=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CSUM=y
-CONFIG_GENERIC_FIND_FIRST_BIT=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-# CONFIG_GEN_RTC is not set
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
-CONFIG_GPIO_DWAPB=y
-CONFIG_GPIO_GENERIC=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-# CONFIG_HAVE_ARCH_BITREVERSE is not set
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_FUTEX_CMPXCHG=y
-# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
-CONFIG_HAVE_IOREMAP_PROT=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HZ_PERIODIC=y
-CONFIG_INITRAMFS_SOURCE="&quo

[OpenWrt-Devel] [PATCH 2/2] arc770: move arc patches to taregt/linux/generic

2016-01-14 Thread Alexey Brodkin
Given those patches are relevant to any ARC platform and even
ISA version it makes perfect sense for patches to exist
in one place instead of being duplicated for each new ARC-based ASIC.

Note this is a prerequisite for upstreaming of ARC HS38 support in
OpenWRT.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch | 36 -
 .../0002-openwrt-arc-add-OWRTDTB-section.patch | 91 --
 .../331-arc-remove-dependency-on-DEVTMPFS.patch| 36 +
 .../patches-4.4/332-arc-add-OWRTDTB-section.patch  | 91 ++
 4 files changed, 127 insertions(+), 127 deletions(-)
 delete mode 100644 
target/linux/arc770/patches-4.4/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 delete mode 100644 
target/linux/arc770/patches-4.4/0002-openwrt-arc-add-OWRTDTB-section.patch
 create mode 100644 
target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/generic/patches-4.4/332-arc-add-OWRTDTB-section.patch

diff --git 
a/target/linux/arc770/patches-4.4/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 
b/target/linux/arc770/patches-4.4/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
deleted file mode 100644
index 29d9bff..000
--- 
a/target/linux/arc770/patches-4.4/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From adfbf9e6cad93281cffceab078e7f6f2a8e094f9 Mon Sep 17 00:00:00 2001
-From: Alexey Brodkin 
-Date: Thu, 13 Aug 2015 01:56:02 +0300
-Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS
-
-OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping
-this dependency. That helps to escape 2 separate kernel rebuilds with
-and without initramfs.
-
-2 builds happen because OpenWRT first builds kernel and later modules.
-When building entire kernel with simple "make" INITRAMFS sets to a real
-value and so was triggering DEVTMPFS selection. Then when building only
-modules with "make modules" command INITRAMFS is zeroed and so kernel
-config was changing that lead to full kernel rebuild.
-
-Signed-off-by: Alexey Brodkin 

- arch/arc/Kconfig | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
-index 6312f60..a95bab3 100644
 a/arch/arc/Kconfig
-+++ b/arch/arc/Kconfig
-@@ -12,8 +12,6 @@ config ARC
-   select BUILDTIME_EXTABLE_SORT
-   select COMMON_CLK
-   select CLONE_BACKWARDS
--  # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
--  select DEVTMPFS if !INITRAMFS_SOURCE=""
-   select GENERIC_ATOMIC64
-   select GENERIC_CLOCKEVENTS
-   select GENERIC_FIND_FIRST_BIT
--- 
-2.4.3
-
diff --git 
a/target/linux/arc770/patches-4.4/0002-openwrt-arc-add-OWRTDTB-section.patch 
b/target/linux/arc770/patches-4.4/0002-openwrt-arc-add-OWRTDTB-section.patch
deleted file mode 100644
index 02e9198..000
--- a/target/linux/arc770/patches-4.4/0002-openwrt-arc-add-OWRTDTB-section.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 690e7f2cad271595ff68cace1c45fb10779bde41 Mon Sep 17 00:00:00 2001
-From: Alexey Brodkin 
-Date: Fri, 15 Jan 2016 00:34:01 +0300
-Subject: [PATCH 2/2] openwrt: arc - add OWRTDTB section
-
-This change allows OpenWRT to patch resulting kernel binary with
-external .dtb.
-
-That allows us to re-use exactky the same vmlinux on different boards
-given its ARC core configurations match (at least cache line sizes etc).
-
-""patch-dtb" searches for ASCII "OWRTDTB:" strign and copies external
-.dtb right after it, keeping the string in place.
-
-Signed-off-by: Alexey Brodkin 

- arch/arc/kernel/head.S| 10 ++
- arch/arc/kernel/setup.c   |  4 +++-
- arch/arc/kernel/vmlinux.lds.S | 13 +
- 3 files changed, 26 insertions(+), 1 deletion(-)
-
-diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
-index 689dd86..51154ae 100644
 a/arch/arc/kernel/head.S
-+++ b/arch/arc/kernel/head.S
-@@ -49,6 +49,16 @@
- 1:
- .endm
- 
-+; Here "patch-dtb" will embed external .dtb
-+; Note "patch-dtb" searches for ASCII "OWRTDTB:" string
-+; and pastes .dtb right after it, hense the string precedes
-+; __image_dtb symbol.
-+  .section .owrt, "aw",@progbits
-+  .ascii  "OWRTDTB:"
-+ENTRY(__image_dtb)
-+  .fill   0x4000
-+END(__image_dtb)
-+
-   .section .init.text, "ax",@progbits
- 
- ;
-diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
-index e1b8744..9481c9d 100644
 a/arch/arc/kernel/setup.c
-+++ b/arch/arc/kernel/setup.c
-@@ -370,6 +370,8 @@ static inline int is_kernel(unsigned long addr)
-   return 0;
- }
- 
-+extern struct boot_param_header __image_dtb;
-+
- void __init setup_arch(char **cmdline_p)
- {
- #ifdef CONFIG_ARC_UBOO

Re: [OpenWrt-Devel] [PATCH 2/2] arc770: move arc patches to taregt/linux/generic

2016-01-15 Thread Alexey Brodkin
Hi Felix,

On Fri, 2016-01-15 at 11:45 +0100, Felix Fietkau wrote:
> On 2016-01-15 00:12, Alexey Brodkin wrote:
> > Given those patches are relevant to any ARC platform and even
> > ISA version it makes perfect sense for patches to exist
> > in one place instead of being duplicated for each new ARC-based ASIC.
> > 
> > Note this is a prerequisite for upstreaming of ARC HS38 support in
> > OpenWRT.
> > 
> > Signed-off-by: Alexey Brodkin 
> > Cc: Felix Fietkau 
> > Cc: Jo-Philipp Wich 
> > Cc: Jonas Gorski 
> > --- /dev/null
> > +++ 
> > b/target/linux/generic/patches-4.4/331-arc-remove-dependency-on-DEVTMPFS.patch
> > @@ -0,0 +1,36 @@
> > +From adfbf9e6cad93281cffceab078e7f6f2a8e094f9 Mon Sep 17 00:00:00 2001
> > +From: Alexey Brodkin 
> > +Date: Thu, 13 Aug 2015 01:56:02 +0300
> > +Subject: [PATCH 1/2] openwrt: arc - remove dependency on DEVTMPFS
> > +
> > +OpenWRT builds initramfs so that it doesn't require DEVTMPFS so dropping
> > +this dependency. That helps to escape 2 separate kernel rebuilds with
> > +and without initramfs.
> > +
> > +2 builds happen because OpenWRT first builds kernel and later modules.
> > +When building entire kernel with simple "make" INITRAMFS sets to a real
> > +value and so was triggering DEVTMPFS selection. Then when building only
> > +modules with "make modules" command INITRAMFS is zeroed and so kernel
> > +config was changing that lead to full kernel rebuild.
> > +
> > +Signed-off-by: Alexey Brodkin 
> > +---
> > + arch/arc/Kconfig | 2 --
> > + 1 file changed, 2 deletions(-)
> > +
> > +diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> > +index 6312f60..a95bab3 100644
> > +--- a/arch/arc/Kconfig
> >  b/arch/arc/Kconfig
> > +@@ -12,8 +12,6 @@ config ARC
> > +   select BUILDTIME_EXTABLE_SORT
> > +   select COMMON_CLK
> > +   select CLONE_BACKWARDS
> > +-  # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
> > +-  select DEVTMPFS if !INITRAMFS_SOURCE=""
> > +   select GENERIC_ATOMIC64
> > +   select GENERIC_CLOCKEVENTS
> > +   select GENERIC_FIND_FIRST_BIT
> Could you please send this one upstream as well?

Adding Vineet so he may comment if that change makes sense upstream.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] arc770/axs101: fix console output

2016-01-18 Thread Alexey Brodkin
While bumping kernel version kernel command line was
unintentionally modified in attempt to make it closer
to upstream version.

In case of AXS that has not only serial port but HDMI/USB
both capable of being debug console we have 2 entries in
kernel's command line:
--->8-
console=tty0 console=ttyS3,115200n8
--->8-

But as it turned out OpenWRT uses procd as init instead of
Busybox. And in its turn procd gets the first "console"
entry from kernel command line (/proc/cmdline) and uses it
if default inittab is used:
--->8-
...
::askconsole:/bin/ash --login
--->8-

So what we got is non-functional serial console.
That change removes "console=tty0" which brings serial
console back to life.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---
 target/linux/arc770/dts/axs101.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/arc770/dts/axs101.dts 
b/target/linux/arc770/dts/axs101.dts
index 769e81a..8718eb4 100644
--- a/target/linux/arc770/dts/axs101.dts
+++ b/target/linux/arc770/dts/axs101.dts
@@ -17,6 +17,6 @@
compatible = "snps,axs101", "snps,arc-sdp";
 
chosen {
-   bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 
console=tty0 console=ttyS3,115200n8 consoleblank=0";
+   bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 
console=ttyS3,115200n8";
};
 };
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] arc: clean-up and move CFLAGS to include/target.mk

2016-01-18 Thread Alexey Brodkin
Most of currently mentioned CFLAGS in arc770/Makefile
are not really required because:
 [1] "-Os -pipe" are set by default in include/target.mk
 [2] "-fno-caller-saves" gets enabled via menuconfig
 as an extra compiler flag for developers

So the only one that makes sense is "-matomic" and
that one is really essential. Without it many software
packges won't build complainin on unresolved atomic ops.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---
 include/target.mk| 1 +
 target/linux/arc770/Makefile | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/target.mk b/include/target.mk
index f129298..d8c0212 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -263,6 +263,7 @@ ifeq ($(DUMP),1)
   endif
   ifeq ($(ARCH),arc)
 CPU_TYPE ?= arc700
+CPU_CFLAGS += -matomic
 CPU_CFLAGS_arc700 = -marc700
   endif
   DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) 
$(CPU_CFLAGS_$(CPU_SUBTYPE)))
diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile
index 52c5e00..f917338 100644
--- a/target/linux/arc770/Makefile
+++ b/target/linux/arc770/Makefile
@@ -9,7 +9,6 @@ include $(TOPDIR)/rules.mk
 ARCH:=arc
 BOARD:=arc770
 BOARDNAME:=Synopsys DesignWare ARC 770D
-CFLAGS:=-Os -pipe -fno-caller-saves -matomic
 MAINTAINER:=Alexey Brodkin 
 SUBTARGETS:=generic
 
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2 v2] linux: add support of ARC HS38-based boards

2016-01-18 Thread Alexey Brodkin
This patch introduces support of new boards with ARC HS38 cores.

ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
Because of new ISA ARC HS38 are binary incompatible with ARC 700
cores which requires both separate toolchain and target applications
including Linux kernel for that new cores.

As with ARC770 we're addind support for 2 boards for now:

 [1] Synopsys SDP board (AXS103)
 This is the same base-board as in AXS101 but with
 FPGA-based CPU-tile where ARCHs38 core is implemented.

 [2] nSIM
 Again this is the same simulation engine but configured for
 new instruction set and features of new CPU.

Alexey Brodkin (2):
  toolchain: add support of ARCv2 architecture
  linux: add support of Synopsys ARCHS38-based boards

 include/target.mk  |   1 +
 target/linux/archs38/Makefile  |  26 +++
 target/linux/archs38/base-files.mk |   3 +
 .../archs38/base-files/etc/board.d/02_network  |  19 ++
 target/linux/archs38/base-files/lib/arc.sh |  50 +
 .../base-files/lib/preinit/01_preinit_arc.sh   |   9 +
 target/linux/archs38/config-4.4| 183 +
 target/linux/archs38/dts/axc003_idu.dtsi   | 126 
 target/linux/archs38/dts/axs103_idu.dts|  25 +++
 target/linux/archs38/dts/axs10x_mb.dtsi| 225 +
 target/linux/archs38/dts/nsim_hs_idu.dts   |  73 +++
 target/linux/archs38/dts/skeleton.dtsi |  37 
 .../linux/archs38/generic/profiles/00-default.mk   |  16 ++
 .../linux/archs38/generic/profiles/01-minimal.mk   |  15 ++
 target/linux/archs38/generic/profiles/02-axs103.mk |  16 ++
 .../linux/archs38/generic/profiles/03-nsim_hs.mk   |  15 ++
 target/linux/archs38/generic/target.mk |   8 +
 target/linux/archs38/image/Makefile|  41 
 toolchain/gcc/common.mk|   1 +
 toolchain/uClibc/common.mk |   3 +-
 toolchain/uClibc/config/archs  |  10 +
 21 files changed, 901 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/archs38/Makefile
 create mode 100644 target/linux/archs38/base-files.mk
 create mode 100755 target/linux/archs38/base-files/etc/board.d/02_network
 create mode 100644 target/linux/archs38/base-files/lib/arc.sh
 create mode 100644 
target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/archs38/config-4.4
 create mode 100644 target/linux/archs38/dts/axc003_idu.dtsi
 create mode 100644 target/linux/archs38/dts/axs103_idu.dts
 create mode 100644 target/linux/archs38/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/archs38/dts/nsim_hs_idu.dts
 create mode 100644 target/linux/archs38/dts/skeleton.dtsi
 create mode 100644 target/linux/archs38/generic/profiles/00-default.mk
 create mode 100644 target/linux/archs38/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/archs38/generic/profiles/02-axs103.mk
 create mode 100644 target/linux/archs38/generic/profiles/03-nsim_hs.mk
 create mode 100644 target/linux/archs38/generic/target.mk
 create mode 100644 target/linux/archs38/image/Makefile
 create mode 100644 toolchain/uClibc/config/archs

-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2 v2] toolchain: add support of ARCv2 architecture

2016-01-18 Thread Alexey Brodkin
This change adds support of ARC ISAv2 processors in
OpenWRT toolchain.

In general gcc for ARC may compile code for both ISA versions
simultaneously but libgcc will be built only for default
architecture that's why it's necessary to specify --with-cpu
on gcc configuration.

As for uClibc we need to use different configurations for
different ARC ISAs.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---

Changes v1 -> v2:
 * Toolchain changes were moved to a separate patch

 toolchain/gcc/common.mk   |  1 +
 toolchain/uClibc/common.mk|  3 ++-
 toolchain/uClibc/config/archs | 10 ++
 3 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 toolchain/uClibc/config/archs

diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index 648cd2d..458215f 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -133,6 +133,7 @@ GCC_CONFIGURE:= \
$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
$(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
--with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \
+   $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \
--with-gmp=$(TOPDIR)/staging_dir/host \
--with-mpfr=$(TOPDIR)/staging_dir/host \
--with-mpc=$(TOPDIR)/staging_dir/host \
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index ad6ff02..2828156 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -41,8 +41,9 @@ GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \
$(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard 
$(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \
$(CONFIG_DIR)/$(ARCH)$(strip \
$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \
+   $(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, 
\
$(if $(CONFIG_MIPS64_ABI),.$(subst 
",,$(CONFIG_MIPS64_ABI)), \
-   $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard 
$(CONFIG_DIR)/$(ARCH).e500),.e500)
+   $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard 
$(CONFIG_DIR)/$(ARCH).e500),.e500))
 
 CPU_CFLAGS = \
-funsigned-char -fno-builtin -fno-asm \
diff --git a/toolchain/uClibc/config/archs b/toolchain/uClibc/config/archs
new file mode 100644
index 000..961628e
--- /dev/null
+++ b/toolchain/uClibc/config/archs
@@ -0,0 +1,10 @@
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+TARGET_ARCH="arc"
+TARGET_arc=y
+# CONFIG_ARC_CPU_700 is not set
+CONFIG_ARC_CPU_HS=y
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2 v2] linux: add support of Synopsys ARCHS38-based boards

2016-01-18 Thread Alexey Brodkin
This patch introduces support of new boards with ARC HS38 cores.

ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
As with ARC770 we're addind support for 2 boards for now:

 [1] Synopsys SDP board (AXS103)
 This is the same base-board as in AXS101 but with
 FPGA-based CPU-tile where ARCHs38 core is implemented.

 [2] nSIM
 Again this is the same simulation engine but configured for
 new instruction set and features of new CPU.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---

Changes v1 -> v2:
 * Toolchain changes were moved to a separate patch
 * Kernel patches were moved to target/linux/generic

 include/target.mk  |   1 +
 target/linux/archs38/Makefile  |  26 +++
 target/linux/archs38/base-files.mk |   3 +
 .../archs38/base-files/etc/board.d/02_network  |  19 ++
 target/linux/archs38/base-files/lib/arc.sh |  50 +
 .../base-files/lib/preinit/01_preinit_arc.sh   |   9 +
 target/linux/archs38/config-4.4| 183 +
 target/linux/archs38/dts/axc003_idu.dtsi   | 126 
 target/linux/archs38/dts/axs103_idu.dts|  25 +++
 target/linux/archs38/dts/axs10x_mb.dtsi| 225 +
 target/linux/archs38/dts/nsim_hs_idu.dts   |  73 +++
 target/linux/archs38/dts/skeleton.dtsi |  37 
 .../linux/archs38/generic/profiles/00-default.mk   |  16 ++
 .../linux/archs38/generic/profiles/01-minimal.mk   |  15 ++
 target/linux/archs38/generic/profiles/02-axs103.mk |  16 ++
 .../linux/archs38/generic/profiles/03-nsim_hs.mk   |  15 ++
 target/linux/archs38/generic/target.mk |   8 +
 target/linux/archs38/image/Makefile|  41 
 18 files changed, 888 insertions(+)
 create mode 100644 target/linux/archs38/Makefile
 create mode 100644 target/linux/archs38/base-files.mk
 create mode 100755 target/linux/archs38/base-files/etc/board.d/02_network
 create mode 100644 target/linux/archs38/base-files/lib/arc.sh
 create mode 100644 
target/linux/archs38/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/archs38/config-4.4
 create mode 100644 target/linux/archs38/dts/axc003_idu.dtsi
 create mode 100644 target/linux/archs38/dts/axs103_idu.dts
 create mode 100644 target/linux/archs38/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/archs38/dts/nsim_hs_idu.dts
 create mode 100644 target/linux/archs38/dts/skeleton.dtsi
 create mode 100644 target/linux/archs38/generic/profiles/00-default.mk
 create mode 100644 target/linux/archs38/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/archs38/generic/profiles/02-axs103.mk
 create mode 100644 target/linux/archs38/generic/profiles/03-nsim_hs.mk
 create mode 100644 target/linux/archs38/generic/target.mk
 create mode 100644 target/linux/archs38/image/Makefile

diff --git a/include/target.mk b/include/target.mk
index d8c0212..f712244 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -265,6 +265,7 @@ ifeq ($(DUMP),1)
 CPU_TYPE ?= arc700
 CPU_CFLAGS += -matomic
 CPU_CFLAGS_arc700 = -marc700
+CPU_CFLAGS_archs = -marchs
   endif
   DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) 
$(CPU_CFLAGS_$(CPU_SUBTYPE)))
 endif
diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile
new file mode 100644
index 000..166d3d5
--- /dev/null
+++ b/target/linux/archs38/Makefile
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+ARCH:=arc
+CPU_TYPE:=archs
+BOARD:=archs38
+BOARDNAME:=Synopsys DesignWare ARC HS38
+MAINTAINER:=Alexey Brodkin 
+SUBTARGETS:=generic
+
+KERNEL_PATCHVER:=4.4
+
+DEVICE_TYPE:=developerboard
+
+include $(INCLUDE_DIR)/target.mk
+
+define Target/Description
+   Synopsys DesignWare boards
+endef
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/archs38/base-files.mk 
b/target/linux/archs38/base-files.mk
new file mode 100644
index 000..fdd2c71
--- /dev/null
+++ b/target/linux/archs38/base-files.mk
@@ -0,0 +1,3 @@
+define Package/base-files/install-target
+   rm -f $(1)/etc/config/network
+endef
diff --git a/target/linux/archs38/base-files/etc/board.d/02_network 
b/target/linux/archs38/base-files/etc/board.d/02_network
new file mode 100755
index 000..da86ee0
--- /dev/null
+++ b/target/linux/archs38/base-files/etc/board.d/02_network
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+
+. /lib/arc.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$( arc_board_name )" in
+"arc-sdp"*)
+   ucidef_set_interface_lan "eth0" "dhcp"
+   ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/archs38/base-files/lib/arc.sh 
b/target/linux/ar

Re: [OpenWrt-Devel] [PATCH 0/2 v2] linux: add support of ARC HS38-based boards

2016-01-22 Thread Alexey Brodkin
Hi Felix,

On Mon, 2016-01-18 at 20:51 +0300, Alexey Brodkin wrote:
> This patch introduces support of new boards with ARC HS38 cores.
> 
> ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
> Because of new ISA ARC HS38 are binary incompatible with ARC 700
> cores which requires both separate toolchain and target applications
> including Linux kernel for that new cores.
> 
> As with ARC770 we're addind support for 2 boards for now:
> 
>  [1] Synopsys SDP board (AXS103)
>  This is the same base-board as in AXS101 but with
>  FPGA-based CPU-tile where ARCHs38 core is implemented.
> 
>  [2] nSIM
>  Again this is the same simulation engine but configured for
>  new instruction set and features of new CPU.

Any chance that tiny series gets reviewed sometime soon?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/2 v2] linux: add support of ARC HS38-based boards

2016-02-01 Thread Alexey Brodkin
Hello,

On Fri, 2016-01-22 at 23:44 +0300, Alexey Brodkin wrote:
> Hi Felix,
> 
> On Mon, 2016-01-18 at 20:51 +0300, Alexey Brodkin wrote:
> > This patch introduces support of new boards with ARC HS38 cores.
> > 
> > ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
> > Because of new ISA ARC HS38 are binary incompatible with ARC 700
> > cores which requires both separate toolchain and target applications
> > including Linux kernel for that new cores.
> > 
> > As with ARC770 we're addind support for 2 boards for now:
> > 
> >  [1] Synopsys SDP board (AXS103)
> >  This is the same base-board as in AXS101 but with
> >  FPGA-based CPU-tile where ARCHs38 core is implemented.
> > 
> >  [2] nSIM
> >  Again this is the same simulation engine but configured for
> >  new instruction set and features of new CPU.
> 
> Any chance that tiny series gets reviewed sometime soon?

Ping!

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] build: don't add -fno-plt for ARC

2016-02-04 Thread Alexey Brodkin
Curent ARC toolchain fails to build libstdc++ if -fno-plt is used.
Lots of following error messages appear:
--->8--
...
staging_dir/toolchain-arc_arc700_gcc-arc-2015.06_uClibc-1.0.9/arc-openwrt-linux-uclibc/bin/ld:
BFD (GNU Binutils) 2.23.2 assertion fail elf32-arc.c:2786
collect2: error: ld returned 1 exit status
--->8--

In newer binutils (still in development) for ARC rewritten from
scratch this seem to not happen, so once new binutils for ARC hit
the street this patch might be reverted.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Cc: Jonas Gorski 
---
 config/Config-devel.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/Config-devel.in b/config/Config-devel.in
index 5970ac2..938f0b3 100644
--- a/config/Config-devel.in
+++ b/config/Config-devel.in
@@ -106,7 +106,7 @@ menuconfig DEVEL
 
config EXTRA_OPTIMIZATION
string "Additional compiler options" if DEVEL
-   default "-fno-caller-saves -fno-plt" if 
!CONFIG_EXTERNAL_TOOLCHAIN
+   default "-fno-caller-saves -fno-plt" if 
!CONFIG_EXTERNAL_TOOLCHAIN && !arc
default "-fno-caller-saves"
help
  Extra target-independent optimizations to use when building 
for the target.
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/2 v2] linux: add support of ARC HS38-based boards

2016-02-11 Thread Alexey Brodkin
Hi Felix, Jonas,

On Mon, 2016-02-01 at 19:21 +0300, Alexey Brodkin wrote:
> Hello,
> 
> On Fri, 2016-01-22 at 23:44 +0300, Alexey Brodkin wrote:
> > Hi Felix,
> > 
> > On Mon, 2016-01-18 at 20:51 +0300, Alexey Brodkin wrote:
> > > This patch introduces support of new boards with ARC HS38 cores.
> > > 
> > > ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
> > > Because of new ISA ARC HS38 are binary incompatible with ARC 700
> > > cores which requires both separate toolchain and target applications
> > > including Linux kernel for that new cores.
> > > 
> > > As with ARC770 we're addind support for 2 boards for now:
> > > 
> > >  [1] Synopsys SDP board (AXS103)
> > >  This is the same base-board as in AXS101 but with
> > >  FPGA-based CPU-tile where ARCHs38 core is implemented.
> > > 
> > >  [2] nSIM
> > >  Again this is the same simulation engine but configured for
> > >  new instruction set and features of new CPU.
> > 
> > Any chance that tiny series gets reviewed sometime soon?
> 
> Ping!

I'm wondering if there's a problem with this series?
It's been a while since I sent that last respin and it would be nice
to get it either reviewed or accepted if there're no complaints.

Regards,
Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/2 v2] toolchain: add support of ARCv2 architecture

2016-02-17 Thread Alexey Brodkin
Hello,

On Mon, 2016-01-18 at 20:51 +0300, Alexey Brodkin wrote:
> This change adds support of ARC ISAv2 processors in
> OpenWRT toolchain.
> 
> In general gcc for ARC may compile code for both ISA versions
> simultaneously but libgcc will be built only for default
> architecture that's why it's necessary to specify --with-cpu
> on gcc configuration.
> 
> As for uClibc we need to use different configurations for
> different ARC ISAs.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Felix Fietkau 
> Cc: Jo-Philipp Wich 
> Cc: Jonas Gorski 
> ---
> 
> Changes v1 -> v2:
>  * Toolchain changes were moved to a separate patch

I'm wondering if there's a chance to get this patch applied?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2 v2] linux: add support of Synopsys ARCHS38-based boards

2016-02-17 Thread Alexey Brodkin
On Mon, 2016-01-18 at 20:51 +0300, Alexey Brodkin wrote:
> This patch introduces support of new boards with ARC HS38 cores.
> 
> ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
> As with ARC770 we're addind support for 2 boards for now:
> 
>  [1] Synopsys SDP board (AXS103)
>  This is the same base-board as in AXS101 but with
>  FPGA-based CPU-tile where ARCHs38 core is implemented.
> 
>  [2] nSIM
>  Again this is the same simulation engine but configured for
>  new instruction set and features of new CPU.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Felix Fietkau 
> Cc: Jo-Philipp Wich 
> Cc: Jonas Gorski 
> ---
> 
> Changes v1 -> v2:
>  * Toolchain changes were moved to a separate patch
>  * Kernel patches were moved to target/linux/generic

I'm wondering if there's a chance to get this patch applied?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mac80211: install old firmware for ath9k-htc on target as well

2016-03-15 Thread Alexey Brodkin
In commit
http://git.openwrt.org/?p=openwrt.git;a=commit;h=3990e15258808b145226d7e95332c4708f9f9463
I got rid of older ath9k_htc firmware in favor of newer ones.

But that was not completely correct.
New v1.4 ath9k_htc firmwares are supported in Linux kernels >= 4.4.
And since not all boards were moved to 4.4 yet it makes perfect
sense to get back installation of older firmwares for compatibility
purposes.

Signed-off-by: Alexey Brodkin 
Cc: John Crispin 
---
 package/firmware/linux-firmware/qca.mk | 5 +
 1 file changed, 5 insertions(+)

diff --git a/package/firmware/linux-firmware/qca.mk 
b/package/firmware/linux-firmware/qca.mk
index 7ad27ef..e5faa8a 100644
--- a/package/firmware/linux-firmware/qca.mk
+++ b/package/firmware/linux-firmware/qca.mk
@@ -9,6 +9,11 @@ $(eval $(call BuildPackage,ar3k-firmware))
 
 Package/ath9k-htc-firmware = $(call Package/firmware-default,AR9271/AR7010 
firmware)
 define Package/ath9k-htc-firmware/install
+   $(INSTALL_DIR) $(1)/lib/firmware
+   $(INSTALL_DATA) \
+   $(PKG_BUILD_DIR)/htc_9271.fw \
+   $(PKG_BUILD_DIR)/htc_7010.fw \
+   $(1)/lib/firmware
$(INSTALL_DIR) $(1)/lib/firmware/ath9k_htc
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/ath9k_htc/htc_9271-1.4.0.fw \
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mac80211: install old firmware for ath9k-htc on target as well

2016-03-15 Thread Alexey Brodkin
Hi Paul,

On Tue, 2016-03-15 at 17:36 +0300, Paul Fertser wrote:
> Hello Alexey,
> 
> Alexey Brodkin  writes:
> > 
> > In commit
> > http://git.openwrt.org/?p=openwrt.git;a=commit;h=3990e15258808b145226d7e95332c4708f9f9463
> > I got rid of older ath9k_htc firmware in favor of newer ones.
> Please see
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e904cf6fe23022cde4e0ea9d41601411a315a3dc
> for more details about the specific kernel change. Oleksij Rempel
> (ath9k_htc firmware maintainer) says that older kernels will work with
> firmware version 1.4.0 too if the filenames match older firmware. So
> probably to support all kernels currently in use the latest firmware
> should be installed to the old location. And once < 4.4 is phased out,
> you can move to the proper new location.

Frankly I don't see Oleksij says v1.4 could be moved on top of v1.3
file (I mean older file will be replaced).

What that patch does it allows developers to use another (3rd) firmware
blob from "/lib/firmware/ath9k_htc" with name "htc_[9271|7010]-1.dev.0.fw"
if special module arg "ath9k_htc use_dev_fw=1" is set.

Even though if replacement could work i.e. if we copy
"/lib/firmware/ath9k_htc/htc_[9271|7010]-1.4.0.fw" over
"/lib/firmware/htc_[9271|7010].fw" and USB dongle will work
(but first somebody must test it - and I cannot because I only have device
with OpenWRT with kernel 4.4) I don't see a reason to add this mess.

We're talking about extra ~100k of space. Does it worth these games?

I'd prefer strict solution which matches what all other distributions
including Buildroot and full-scale Fedora/Debian ones.

Moreover fixup on removal of the last <4.4 kernel will be much simpler -
we'll need just to remove a couple of extra lines but not modify paths
very carefully.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mac80211: install old firmware for ath9k-htc on target as well

2016-03-19 Thread Alexey Brodkin
Hi Paul,

On Wed, 2016-03-16 at 12:35 +0300, Paul Fertser wrote:
> Hi Alexey,
> 
> On Tue, Mar 15, 2016 at 06:05:29PM +0000, Alexey Brodkin wrote:
> > 
> > Frankly I don't see Oleksij says v1.4 could be moved on top of v1.3
> > file (I mean older file will be replaced).
> Yes, he didn't mention it in his commit message but he clarified that
> to me in private talk.
> 
> > 
> > (but first somebody must test it - and I cannot because I only have device
> > with OpenWRT with kernel 4.4) I don't see a reason to add this mess.
> > 
> > We're talking about extra ~100k of space. Does it worth these games?
> I'm not saying it does, just wanted to highlight that the newer
> firmware can work with the older kernels too, but of course it's up to
> the OpenWrt maintainers to decide on the best course of actions.

Well given your sacred knowledge I would suggest to send a patch to
"linux-firmware" which does exactly that - moves v1.4 on top of older
version and then out discussion here would become pointless :)

Care to send a patch with explanation?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] mac80211: install old firmware for ath9k-htc on target as well

2016-03-19 Thread Alexey Brodkin
Hi Hauke,

On Tue, 2016-03-15 at 23:31 +0100, Hauke Mehrtens wrote:
> On 03/15/2016 02:06 PM, Alexey Brodkin wrote:
> > 
> > In commit
> > http://git.openwrt.org/?p=openwrt.git;a=commit;h=3990e15258808b145226d7e95332c4708f9f9463
> > I got rid of older ath9k_htc firmware in favor of newer ones.
> > 
> > But that was not completely correct.
> > New v1.4 ath9k_htc firmwares are supported in Linux kernels >= 4.4.
> > And since not all boards were moved to 4.4 yet it makes perfect
> > sense to get back installation of older firmwares for compatibility
> > purposes.
> > 
> NACK
> 
> ath9k_htc is provided by compat-wireless and not taken from normal
> kernel. The compat-wireless version in trunk is based on a version more
> recent than 4.4 independent of the kernel actually in use. You can
> assume that the ath9k_htc driver is similar to the one used in kernel
> 4.5 for all OpenWrt kernels in trunk.

That makes perfect sense.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] arc770: build kmod-ath9k-htc wpad-mini by default

2016-04-01 Thread Alexey Brodkin
AXS101 beind a development board lacks built-in wireles inerfaces.
So we have to use external USB dongles to turn the board into
wireless router.

The best USB Wi-Fi dongles to work in AP-mode seem to be based on
ath9k-htc chipset.

And so with that change we add support of mentioned dongles in
default and axs101 builds.

Signed-off-by: Alexey Brodkin 
---
 target/linux/arc770/generic/profiles/00-default.mk | 2 +-
 target/linux/arc770/generic/profiles/02-axs101.mk  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/arc770/generic/profiles/00-default.mk 
b/target/linux/arc770/generic/profiles/00-default.mk
index b12ceb1..c30317a 100644
--- a/target/linux/arc770/generic/profiles/00-default.mk
+++ b/target/linux/arc770/generic/profiles/00-default.mk
@@ -7,7 +7,7 @@
 
 define Profile/Default
NAME:=Default Profile (all drivers)
-   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci
+   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci 
kmod-ath9k-htc wpad-mini
 endef
 
 define Profile/Default/Description
diff --git a/target/linux/arc770/generic/profiles/02-axs101.mk 
b/target/linux/arc770/generic/profiles/02-axs101.mk
index 60cf0fc..56a97e5 100644
--- a/target/linux/arc770/generic/profiles/02-axs101.mk
+++ b/target/linux/arc770/generic/profiles/02-axs101.mk
@@ -7,7 +7,7 @@
 
 define Profile/axs101
NAME:=Synopsys DesignWare AXS101
-   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci
+   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci 
kmod-ath9k-htc wpad-mini
 endef
 
 define Profile/axs101/Description
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] arc770: enable unaligned access handling simulation in software

2016-04-01 Thread Alexey Brodkin
This enables misaligned access handling by software in Linux kernel.

With some wireless drivers (ath9k-htc and mt7601u for example) we see
misaligned accesses here and there and to cope with that without
fixing stuff in the drivers we're just gracefully handling it on ARC.

Signed-off-by: Alexey Brodkin 
---
 target/linux/arc770/config-4.4 |  5 ++--
 ...rc-enable-unaligned-access-in-kernel-mode.patch | 31 ++
 2 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 
target/linux/generic/patches-4.4/333-arc-enable-unaligned-access-in-kernel-mode.patch

diff --git a/target/linux/arc770/config-4.4 b/target/linux/arc770/config-4.4
index c8f021d..87fd7e3 100644
--- a/target/linux/arc770/config-4.4
+++ b/target/linux/arc770/config-4.4
@@ -19,7 +19,7 @@ CONFIG_ARC_DBG=y
 # CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
 # CONFIG_ARC_DBG_TLB_PARANOIA is not set
 CONFIG_ARC_DW2_UNWIND=y
-# CONFIG_ARC_EMUL_UNALIGNED is not set
+CONFIG_ARC_EMUL_UNALIGNED=y
 # CONFIG_ARC_FPU_SAVE_RESTORE is not set
 CONFIG_ARC_HAS_DCACHE=y
 # CONFIG_ARC_HAS_DCCM is not set
@@ -162,7 +162,8 @@ CONFIG_SRCU=y
 CONFIG_STACKTRACE=y
 CONFIG_STMMAC_ETH=y
 CONFIG_STMMAC_PLATFORM=y
-# CONFIG_SUNXI_SRAM is not set
+CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW=y
+CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_UNINLINE_SPIN_UNLOCK=y
 CONFIG_USB_SUPPORT=y
diff --git 
a/target/linux/generic/patches-4.4/333-arc-enable-unaligned-access-in-kernel-mode.patch
 
b/target/linux/generic/patches-4.4/333-arc-enable-unaligned-access-in-kernel-mode.patch
new file mode 100644
index 000..76a9ce8
--- /dev/null
+++ 
b/target/linux/generic/patches-4.4/333-arc-enable-unaligned-access-in-kernel-mode.patch
@@ -0,0 +1,31 @@
+From af737b55fc7c61f17da9ae89fba536e0a9338e98 Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin 
+Date: Mon, 14 Mar 2016 17:26:34 +0300
+Subject: [PATCH] arc: enable unaligned access in kernel mode
+
+This enables misaligned access handling even in kernel mode.
+Some wireless drivers (ath9k-htc and mt7601u) use misaligned accesses
+here and there and to cope with that without fixing stuff in the drivers
+we're just gracefully handling it on ARC.
+
+Signed-off-by: Alexey Brodkin 
+---
+ arch/arc/kernel/unaligned.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c
+index abd961f..0b0cc97 100644
+--- a/arch/arc/kernel/unaligned.c
 b/arch/arc/kernel/unaligned.c
+@@ -206,7 +206,7 @@ int misaligned_fixup(unsigned long address, struct pt_regs 
*regs,
+   char buf[TASK_COMM_LEN];
+ 
+   /* handle user mode only and only if enabled by sysadmin */
+-  if (!user_mode(regs) || !unaligned_enabled)
++  if (!unaligned_enabled)
+   return 1;
+ 
+   if (no_unaligned_warning) {
+-- 
+2.5.0
+
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] arc770: enable unaligned access handling simulation in software

2016-04-05 Thread Alexey Brodkin
Hi John,

> 
> From: Alexey Brodkin [abrod...@synopsys.com]
> Sent: Friday, April 01, 2016 5:43 PM
> To: John Crispin
> Cc: openwrt-devel@lists.openwrt.org; Alexey Brodkin
> Subject: [PATCH] arc770: enable unaligned access handling simulation in 
> software
> 
> This enables misaligned access handling by software in Linux kernel.
> 
> With some wireless drivers (ath9k-htc and mt7601u for example) we see
> misaligned accesses here and there and to cope with that without
> fixing stuff in the drivers we're just gracefully handling it on ARC.
> 
> Signed-off-by: Alexey Brodkin 

I'm wondering if there're any comments on this one or it could be applied?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] arc770: build kmod-ath9k-htc wpad-mini by default

2016-04-05 Thread Alexey Brodkin
Hi John,

> 
> From: Alexey Brodkin [abrod...@synopsys.com]
> Sent: Friday, April 01, 2016 5:39 PM
> To: John Crispin
> Cc: openwrt-devel@lists.openwrt.org; Alexey Brodkin
> Subject: [PATCH] arc770: build kmod-ath9k-htc wpad-mini by default
> 
> AXS101 beind a development board lacks built-in wireles inerfaces.
> So we have to use external USB dongles to turn the board into
> wireless router.
> 
> The best USB Wi-Fi dongles to work in AP-mode seem to be based on
> ath9k-htc chipset.
> 
> And so with that change we add support of mentioned dongles in
> default and axs101 builds.
> 
> Signed-off-by: Alexey Brodkin 

I'm wondering if there're any comments on this one or it could be applied?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] arc770/axs101: mimic real wireless router

2016-04-08 Thread Alexey Brodkin
Even though ARC SDP board has only 1 wired connection (eth0)
and barely might be treated as a full-scale router we're mimicking
that so the one ond only eth0 wired interface is wan and wlan0
serves its own network behind NAT.

For that we enable firewall and DNS server on the board and rearranging
interfaces: eth0 becomes wan, wlan0 is leff in lan but gets its
internal static IP address (192.168.1.1).

Signed-off-by: Alexey Brodkin 
---
 target/linux/arc770/base-files/etc/board.d/02_network | 3 ++-
 target/linux/arc770/generic/profiles/00-default.mk| 2 +-
 target/linux/arc770/generic/profiles/02-axs101.mk | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/linux/arc770/base-files/etc/board.d/02_network 
b/target/linux/arc770/base-files/etc/board.d/02_network
index dabc539..da53f91 100755
--- a/target/linux/arc770/base-files/etc/board.d/02_network
+++ b/target/linux/arc770/base-files/etc/board.d/02_network
@@ -10,7 +10,8 @@ board_config_update
 
 case "$( arc_board_name )" in
 "arc-sdp"*)
-   ucidef_set_interface_lan "eth0" "dhcp"
+   ucidef_set_interface_wan "eth0" "dhcp"
+   ucidef_set_interface_lan "wlan0"
;;
 esac
 
diff --git a/target/linux/arc770/generic/profiles/00-default.mk 
b/target/linux/arc770/generic/profiles/00-default.mk
index c30317a..88fd96b 100644
--- a/target/linux/arc770/generic/profiles/00-default.mk
+++ b/target/linux/arc770/generic/profiles/00-default.mk
@@ -7,7 +7,7 @@
 
 define Profile/Default
NAME:=Default Profile (all drivers)
-   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci 
kmod-ath9k-htc wpad-mini
+   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci 
kmod-ath9k-htc wpad-mini firewall dnsmasq
 endef
 
 define Profile/Default/Description
diff --git a/target/linux/arc770/generic/profiles/02-axs101.mk 
b/target/linux/arc770/generic/profiles/02-axs101.mk
index 56a97e5..7525066 100644
--- a/target/linux/arc770/generic/profiles/02-axs101.mk
+++ b/target/linux/arc770/generic/profiles/02-axs101.mk
@@ -7,7 +7,7 @@
 
 define Profile/axs101
NAME:=Synopsys DesignWare AXS101
-   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci 
kmod-ath9k-htc wpad-mini
+   PACKAGES:= kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci 
kmod-ath9k-htc wpad-mini firewall dnsmasq
 endef
 
 define Profile/axs101/Description
-- 
2.5.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] toolchain/uClibc: enable UCLIBC_HAS_OBSOLETE_BSD_SIGNAL

2016-04-14 Thread Alexey Brodkin
This is required to build net-snmp.

If that options is disabled in uClibc then net-snmp doesn't
detect sighold support on its configuration stage and so
defines HAVE_SIGHOLD as 0. That in its turn causes compilation of
the following branch of timerPause() in apps/snmpnetstat:
-->8
int oldmask;
oldmask = sigblock(sigmask(SIGALRM));
if (!signalled) {
sigpause(0);
}
sigsetmask(oldmask);
-->8

Now in uClibc all 3 sigblock(), sigmask() and sigsetmask()
were removed back in 2005, see:
https://git.busybox.net/uClibc/commit/?id=5aa7aa7fa7ec2a0fe567ac0b2595b46add6f3594

And all that causes net-snmp linkage to fail this way:
-->8
.libs/if.o: In function `intpr':
if.c:(.text+0x908): undefined reference to `sigmask'
if.c:(.text+0x90e): undefined reference to `sigblock'
if.c:(.text+0x924): undefined reference to `sigsetmask'
-->8

If we enable UCLIBC_HAS_OBSOLETE_BSD_SIGNAL in uClibc then
branch with sighold is used in timerPause() and everything builds as
expected.

Signed-off-by: Alexey Brodkin 
---
 toolchain/uClibc/config/common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/uClibc/config/common b/toolchain/uClibc/config/common
index ec72701..b476639 100644
--- a/toolchain/uClibc/config/common
+++ b/toolchain/uClibc/config/common
@@ -144,7 +144,7 @@ UCLIBC_HAS_LIBUTIL=y
 UCLIBC_HAS_LONG_DOUBLE_MATH=y
 UCLIBC_HAS_NETWORK_SUPPORT=y
 UCLIBC_HAS_NFTW=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
+UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
 # UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
 UCLIBC_HAS_PRINTF_M_SPEC=y
 # UCLIBC_HAS_PROFILING is not set
-- 
2.5.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: enable UCLIBC_HAS_OBSOLETE_BSD_SIGNAL

2016-04-15 Thread Alexey Brodkin
Hi Karl,

On Fri, 2016-04-15 at 10:01 +, Karl Palsson wrote:
> Alexey Brodkin  wrote:
> > 
> > This is required to build net-snmp.
> What version of net-snmp are you using? Is this because ARC is
> still on uclibc instead of musl like everyone else?

Indeed as of today the only libc for ARC is uClibc.
We're working now on glibc port for ARC and once done will look
at musl.

> net-snmp (5.4.4) built fine (and still builds fine) on uclibc in the 15.05
> branch.

Well frankly I haven't tried to build 15.05 so not really sure
if net-snmp will be built with uClibc. But I'll be surprised if it will.
Because from what I saw uClibc 0.9.33.2 used in 15.05 has no
differences in regard of sighold and friends. I think I'll try it.
Still IMHO observation that I made when building from current master is
pretty valid but let's see what gives 15.05 building.

> When are you planning on moving off uclibc?

Well I don't have a solid answer for this. As I said we're working on
glibc now and I think soon we'll be sending patches for upstream review
but it will take some time before our port gets accepted upstream.
In comparison ARC port of uClibc is now completely upstream in both
olde good uClibc and its new and shiny uClibc-ng fork. And that's exactly
what we want - use upstream projects but not a fork on our GitHub etc.

> snmpnetstat isn't even installed, could you just disable building it?

Essentially I may disable it but that's not a solution right?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] libffi: bump to version 3.2.1

2016-04-28 Thread Alexey Brodkin
Among many fixes and improvements this new version adds
support of ARC architecture (ARC port was actually introduced
in v3.1 but while at it why not to update to the most recent version).
Which allows to build dependent projects like Python etc.

Signed-off-by: Alexey Brodkin 
---
 libs/libffi/Makefile |  6 ++--
 libs/libffi/patches/001-fix-includedir-pkg.patch | 36 
 2 files changed, 3 insertions(+), 39 deletions(-)
 delete mode 100644 libs/libffi/patches/001-fix-includedir-pkg.patch

diff --git a/libs/libffi/Makefile b/libs/libffi/Makefile
index cd16a85..b5daa13 100644
--- a/libs/libffi/Makefile
+++ b/libs/libffi/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libffi
-PKG_VERSION:=3.0.13
+PKG_VERSION:=3.2.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
-PKG_MD5SUM:=45f3b6dbc9ee7c7dfbbbc5feba571529
+PKG_MD5SUM:=83b89587607e3eb65c70d361f13bab43
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
@@ -66,7 +66,7 @@ define Build/InstallDev
 
$(INSTALL_DIR) $(1)/usr/include
$(CP) \
-   $(PKG_INSTALL_DIR)/usr/include/*.h \
+   
$(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)-$(PKG_VERSION)/include/*.h \
$(1)/usr/include/
 endef
 
diff --git a/libs/libffi/patches/001-fix-includedir-pkg.patch 
b/libs/libffi/patches/001-fix-includedir-pkg.patch
deleted file mode 100644
index 812d7a4..000
--- a/libs/libffi/patches/001-fix-includedir-pkg.patch
+++ /dev/null
@@ -1,36 +0,0 @@
 a/libffi.pc.in
-+++ b/libffi.pc.in
-@@ -1,10 +1,10 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- libdir=@libdir@
--includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-+includedir=@includedir@
- 
- Name: @PACKAGE_NAME@
- Description: Library supporting Foreign Function Interfaces
- Version: @PACKAGE_VERSION@
--Libs: -L${libdir} -lffi
--Cflags: -I${includedir}
-+Libs: -lffi
-+Cflags:
 a/include/Makefile.am
-+++ b/include/Makefile.am
-@@ -5,5 +5,5 @@ AUTOMAKE_OPTIONS=foreign
- DISTCLEANFILES=ffitarget.h
- EXTRA_DIST=ffi.h.in ffi_common.h
- 
--includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-+includesdir = $(includedir)
- nodist_includes_HEADERS = ffi.h ffitarget.h
 a/include/Makefile.in
-+++ b/include/Makefile.in
-@@ -250,7 +250,7 @@ top_srcdir = @top_srcdir@
- AUTOMAKE_OPTIONS = foreign
- DISTCLEANFILES = ffitarget.h
- EXTRA_DIST = ffi.h.in ffi_common.h
--includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-+includesdir = $(includedir)
- nodist_includes_HEADERS = ffi.h ffitarget.h
- all: all-am
- 
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Failed to execute /usr/libexec/login.sh

2016-05-11 Thread Alexey Brodkin
Hi Daniel,

Looks like one recent commit:
->8-
commit a1860283b37c7a26f78c7387227a42219e8b4d4d
Author: luka 
Date:   Tue May 10 22:36:25 2016 +

image / basefiles: make console password configurable

Signed-off-by: Daniel Dickinson 
Signed-off-by: John Crispin 

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49325 
3c298f89-4303-0410-b956-a3cf2f4a3e73
->8-

breaks something for my boards (in particular arc770-based boards).
I'm unable to activate console now. That's what I'm getting
every time I press ENTER:
->8-
Failed to execute /usr/libexec/login.sh
Please press Enter to activate this console.
Failed to execute /usr/libexec/login.sh
Please press Enter to activate this console.
->8-

If I revert mentioned commit problem goes away.

Any thoughts on what might be wrong here?
Probably something is missing in my board's init scripts etc?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] Failed to execute /usr/libexec/login.sh

2016-05-12 Thread Alexey Brodkin
Hi Alvaro, Daniel,

On Thu, 2016-05-12 at 08:36 +0200, Álvaro Fernández Rojas wrote:
Hello Daniel,

It looks like Luka has already fixed this:
https://dev.openwrt.org/changeset/49376


Indeed mentioned commit fixes previously observed problem.
Thanks for the pointer.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] include/kernel: Do not strip kernel's Elf

2016-05-16 Thread Alexey Brodkin
If an image gets built as an Elf there's a chance
it will be used by developers for debugging purposes.
In that case it's very helpful to keep debugging info
in that image.

I would think that most OWRT-powered devices in production
will use some form of binary image for booting so Elf
flavours could be left a bit bulkier with more debug info
inside.

Signed-off-by: Alexey Brodkin 
---
 include/kernel-defaults.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 406fd46..0166dc5 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -142,7 +142,7 @@ endif
 define Kernel/CopyImage
cmp -s $(LINUX_DIR)/vmlinux $(KERNEL_BUILD_DIR)/vmlinux$(1).debug || { \
$(KERNEL_CROSS)objcopy -O binary $(OBJCOPY_STRIP) -S 
$(LINUX_DIR)/vmlinux $(LINUX_KERNEL)$(1); \
-   $(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) -S $(LINUX_DIR)/vmlinux 
$(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
+   $(KERNEL_CROSS)objcopy $(OBJCOPY_STRIP) $(LINUX_DIR)/vmlinux 
$(KERNEL_BUILD_DIR)/vmlinux$(1).elf; \
$(CP) $(LINUX_DIR)/vmlinux 
$(KERNEL_BUILD_DIR)/vmlinux$(1).debug; \
$(foreach k, \
$(if $(KERNEL_IMAGES),$(KERNEL_IMAGES),$(filter-out 
dtbs,$(KERNELNAME))), \
-- 
2.5.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] include/kernel: Do not strip kernel's Elf

2016-05-18 Thread Alexey Brodkin
Hi Felix,

On Wed, 2016-05-18 at 14:57 +0200, Felix Fietkau wrote:
> On 2016-05-16 16:42, Alexey Brodkin wrote:
> > 
> > If an image gets built as an Elf there's a chance
> > it will be used by developers for debugging purposes.
> > In that case it's very helpful to keep debugging info
> > in that image.
> > 
> > I would think that most OWRT-powered devices in production
> > will use some form of binary image for booting so Elf
> > flavours could be left a bit bulkier with more debug info
> > inside.
> > 
> > Signed-off-by: Alexey Brodkin 
> You can get the bulky one directly from the kernel source directory, and
> there is definitely some value in having stripped ELF binaries as well
> for devices that can load them.

Well indeed in kernel's source directory we have an unstripped elf.
But what happens at least in case of ARC we build only one kernel's elf
and then as a post-built step we patch in .dtb for all boards we build OWRT.

In other words in "bin/arc770-uClibc" folder I have:
 1) openwrt-arc770-generic-axs101-initramfs.elf
 2) openwrt-arc770-generic-nsim_700-initramfs.elf

Both are stripped but work as they are on the corresponding boards.

In "build_dir/target-arc_arc700_uClibc-1.0.9/linux-arc770_generic/linux-4.4.7/"
I have perfectly unstripped vmlinux but it won't work on either board because of
missing device tree blob.

That means if one wants to get image for a board X with debug symbols he or she
will need to do manual patching in of .dtb. Which is not the most convenient 
thing ever.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] include/kernel: Do not strip kernel's Elf

2016-05-18 Thread Alexey Brodkin
Hi Felix,

On Wed, 2016-05-18 at 15:49 +0200, Felix Fietkau wrote:
> On 2016-05-18 15:06, Alexey Brodkin wrote:
> > 
> > Hi Felix,
> > 
> > On Wed, 2016-05-18 at 14:57 +0200, Felix Fietkau wrote:
> > > 
> > > On 2016-05-16 16:42, Alexey Brodkin wrote:
> > > > 
> > > > 
> > > > If an image gets built as an Elf there's a chance
> > > > it will be used by developers for debugging purposes.
> > > > In that case it's very helpful to keep debugging info
> > > > in that image.
> > > > 
> > > > I would think that most OWRT-powered devices in production
> > > > will use some form of binary image for booting so Elf
> > > > flavours could be left a bit bulkier with more debug info
> > > > inside.
> > > > 
> > > > Signed-off-by: Alexey Brodkin 
> > > You can get the bulky one directly from the kernel source directory, and
> > > there is definitely some value in having stripped ELF binaries as well
> > > for devices that can load them.
> > Well indeed in kernel's source directory we have an unstripped elf.
> > But what happens at least in case of ARC we build only one kernel's elf
> > and then as a post-built step we patch in .dtb for all boards we build OWRT.
> > 
> > In other words in "bin/arc770-uClibc" folder I have:
> >  1) openwrt-arc770-generic-axs101-initramfs.elf
> >  2) openwrt-arc770-generic-nsim_700-initramfs.elf
> > 
> > Both are stripped but work as they are on the corresponding boards.
> > 
> > In 
> > "build_dir/target-arc_arc700_uClibc-1.0.9/linux-arc770_generic/linux-4.4.7/"
> > I have perfectly unstripped vmlinux but it won't work on either board 
> > because of
> > missing device tree blob.
> > 
> > That means if one wants to get image for a board X with debug symbols he or 
> > she
> > will need to do manual patching in of .dtb. Which is not the most 
> > convenient thing ever.
> It's a lot simpler than that: You can boot the stripped and patched elf
> image from bin/ and use the vmlinux from the kernel source for the
> debugger afterwards. They are fully compatible.

Good point. So indeed if we do want stuff in "bin/" folder to be stripped
that seems to be the simplest approach.

But what if we with addition of another config option:
 a) toggle kernel's CONFIG_DEBUG_INFO
 b) use "--strip-unneeded" instead of currently used "-S" (which is an alias to 
"--strip-all").

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] toolchain: Bump ARC tools to arc-2016.03

2016-05-18 Thread Alexey Brodkin
This change switches ARC tools to the most recent arc-2016.03
version.

ARC GNU tools of version arc-2016.03 bring some quite significant
changes like:
 * Binutils v2.26+ (upstream commit id 202ac19 with additional ARC
 * patches)
 * GCC v4.8.5
 * GDB 7.10

More about changes, improvements and fixes could be found here:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/tag/arc-2016.03

Signed-off-by: Alexey Brodkin 
---
 toolchain/binutils/Config.in|  8 
 toolchain/binutils/Config.version   |  4 ++--
 toolchain/binutils/Makefile |  8 
 .../patches/arc-2016.03/200-arc-fix-target-mask.patch   | 13 +
 toolchain/gcc/Config.version|  2 +-
 toolchain/gcc/common.mk |  8 
 .../001-revert_register_mode_search.patch   |  0
 .../{arc-2015.06 => arc-2016.03}/002-weak_data_fix.patch|  0
 .../003-universal_initializer.patch |  0
 .../{arc-2015.06 => arc-2016.03}/004-case_insensitive.patch |  0
 .../{arc-2015.06 => arc-2016.03}/010-documentation.patch|  0
 .../{arc-2015.06 => arc-2016.03}/020-no-plt-backport.patch  |  0
 .../{arc-2015.06 => arc-2016.03}/100-uclibc-conf.patch  |  0
 .../210-disable_libsanitizer_off_t_check.patch  |  0
 .../800-arc-disablelibgmon.patch|  0
 .../{arc-2015.06 => arc-2016.03}/820-libgcc_pic.patch   |  0
 .../850-use_shared_libgcc.patch |  0
 .../{arc-2015.06 => arc-2016.03}/851-libgcc_no_compat.patch |  0
 .../{arc-2015.06 => arc-2016.03}/860-use_eh_frame.patch |  0
 .../{arc-2015.06 => arc-2016.03}/870-ppc_no_crtsavres.patch |  0
 .../{arc-2015.06 => arc-2016.03}/880-no_java_section.patch  |  0
 .../{arc-2015.06 => arc-2016.03}/910-mbsd_multi.patch   |  0
 .../920-specs_nonfatal_getenv.patch |  0
 .../940-no-clobber-stamp-bits.patch |  0
 toolchain/gdb/Makefile  |  6 +++---
 .../100-no_extern_inline.patch  |  4 ++--
 .../{arc-2015.06-gdb => arc-2016.03}/110-no_testsuite.patch |  4 ++--
 .../120-fix-compile-flag-mismatch.patch |  2 +-
 .../gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch   | 13 +
 29 files changed, 49 insertions(+), 23 deletions(-)
 create mode 100644 
toolchain/binutils/patches/arc-2016.03/200-arc-fix-target-mask.patch
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/001-revert_register_mode_search.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/002-weak_data_fix.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/003-universal_initializer.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/004-case_insensitive.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/010-documentation.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/020-no-plt-backport.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/100-uclibc-conf.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/210-disable_libsanitizer_off_t_check.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/800-arc-disablelibgmon.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => arc-2016.03}/820-libgcc_pic.patch 
(100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/850-use_shared_libgcc.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/851-libgcc_no_compat.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/860-use_eh_frame.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/870-ppc_no_crtsavres.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/880-no_java_section.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => arc-2016.03}/910-mbsd_multi.patch 
(100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/920-specs_nonfatal_getenv.patch (100%)
 rename toolchain/gcc/patches/{arc-2015.06 => 
arc-2016.03}/940-no-clobber-stamp-bits.patch (100%)
 rename toolchain/gdb/patches/{arc-2015.06-gdb => 
arc-2016.03}/100-no_extern_inline.patch (91%)
 rename toolchain/gdb/patches/{arc-2015.06-gdb => 
arc-2016.03}/110-no_testsuite.patch (73%)
 rename toolchain/gdb/patches/{arc-2015.06-gdb => 
arc-2016.03}/120-fix-compile-flag-mismatch.patch (85%)
 create mode 100644 
toolchain/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch

diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in
index c32f43c..2960c94 100644
--- a/toolchain/binutils/Config.in
+++ b/toolchain/binutils/Config.in
@@ -3,7 +3,7 @@
 choice
prompt &quo

[OpenWrt-Devel] [PATCH] package/util-linux: Fix libmount build under uClibc

2016-05-23 Thread Alexey Brodkin
This fixes util-linux building with uClibc.
Patch is taken as it is from Buildroot:
https://git.busybox.net/buildroot/plain/package/util-linux/0001-Fix-libmount-build-under-uClibc.patch?id=baccb506a6feabf114623866568121f49712f5df

Signed-off-by: Alexey Brodkin 
---
 .../004-Fix-libmount-build-under-uClibc.patch  | 153 +
 1 file changed, 153 insertions(+)
 create mode 100644 
package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch

diff --git 
a/package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch 
b/package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch
new file mode 100644
index 000..10cc3a5
--- /dev/null
+++ b/package/utils/util-linux/patches/004-Fix-libmount-build-under-uClibc.patch
@@ -0,0 +1,153 @@
+From 44d733203637666926964957af7af23429ddcecf Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias 
+Date: Mon, 18 Apr 2016 09:58:56 -0300
+Subject: [PATCH] Fix libmount build under uClibc
+
+See https://bugs.gentoo.org/show_bug.cgi?id=406303
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/util-linux/files/util-linux-2.21.1-no-printf-alloc.patch?revision=1.2
+
+[Gustavo: converted to git format for 2.28]
+
+Signed-off-by: Gustavo Zacarias 
+---
+ configure.ac |  1 -
+ libmount/src/tab_parse.c | 52 
+ 2 files changed, 52 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5a00403..3422f11 100644
+--- a/configure.ac
 b/configure.ac
+@@ -948,7 +948,6 @@ AC_ARG_ENABLE([libmount],
+ )
+ UL_BUILD_INIT([libmount])
+ UL_REQUIRES_BUILD([libmount], [libblkid])
+-UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc 
modifier])
+ AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
+ AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a 
"x$enable_static" = xyes])
+ AS_IF([test "x$build_libmount" = xyes], [
+diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
+index 3f5e14a..2ff1795 100644
+--- a/libmount/src/tab_parse.c
 b/libmount/src/tab_parse.c
+@@ -39,6 +39,10 @@ static void parser_cleanup(struct libmnt_parser *pa)
+   memset(pa, 0, sizeof(*pa));
+ }
+ 
++#ifndef HAVE_SCANF_MS_MODIFIER
++# define UL_SCNsA "%s"
++#endif
++
+ static int next_number(char **s, int *num)
+ {
+   char *end = NULL;
+@@ -69,16 +73,31 @@ static int mnt_parse_table_line(struct libmnt_fs *fs, char 
*s)
+   int rc, n = 0, xrc;
+   char *src = NULL, *fstype = NULL, *optstr = NULL;
+ 
++#ifndef HAVE_SCANF_MS_MODIFIER
++  size_t len = strlen(s) + 1;
++  src = malloc(len);
++  fstype = malloc(len);
++  fs->target = malloc(len);
++  optstr = malloc(len);
++#endif
++
+   rc = sscanf(s,  UL_SCNsA" " /* (1) source */
+   UL_SCNsA" " /* (2) target */
+   UL_SCNsA" " /* (3) FS type */
+   UL_SCNsA" " /* (4) options */
+   "%n",   /* byte count */
+ 
++#ifdef HAVE_SCANF_MS_MODIFIER
+   &src,
+   &fs->target,
+   &fstype,
+   &optstr,
++#else
++  src,
++  fs->target,
++  fstype,
++  optstr,
++#endif
+   &n);
+   xrc = rc;
+ 
+@@ -144,6 +163,16 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, 
char *s)
+   unsigned int maj, min;
+   char *fstype = NULL, *src = NULL, *p;
+ 
++#ifndef HAVE_SCANF_MS_MODIFIER
++  size_t len = strlen(s) + 1;
++  fs->root = malloc(len);
++  fs->target = malloc(len);
++  fs->vfs_optstr = malloc(len);
++  fs->fs_optstr = malloc(len);
++  fstype = malloc(len);
++  src = malloc(len);
++#endif
++
+   rc = sscanf(s,  "%d "   /* (1) id */
+   "%d "   /* (2) parent */
+   "%u:%u "/* (3) maj:min */
+@@ -155,9 +184,15 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, 
char *s)
+   &fs->id,
+   &fs->parent,
+   &maj, &min,
++#ifdef HAVE_SCANF_MS_MODIFIER
+   &fs->root,
+   &fs->target,
+   &fs->vfs_optstr,
++#else
++  fs->root,
++  fs->target,
++  fs->vfs_optstr,
++#endif
+   &end);
+ 
+   if (rc >= 7 && end > 0)
+@@ -177,9 +212,15 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, 
char *s)
+   UL_SCNsA" " /* (9) source */
+ 

[OpenWrt-Devel] [PATCH] toolchain: uClibc: Bump to the most recent version 1.0.14

2016-05-23 Thread Alexey Brodkin
This change updates uClibc version to the most recent 1.0.14 release.

Signed-off-by: Alexey Brodkin 
---
 toolchain/uClibc/Config.version | 2 +-
 toolchain/uClibc/common.mk  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index b9c0627..3c1c54d 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -1,7 +1,7 @@
 config UCLIBC_VERSION
string
depends on USE_UCLIBC
-   default "1.0.9"
+   default "1.0.14"
 
 config UCLIBC_VERSION_NG
bool
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index 2828156..878bd76 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -16,7 +16,7 @@ CONFIG_DIR:=$(PATH_PREFIX)/config
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 LIBC_SO_VERSION:=$(PKG_VERSION)
 
-PKG_MD5SUM=64bbe13301ffa6ba30c5c1ddec335583
+PKG_MD5SUM=8eed7f3635216142c1c5e122874b89c6
 
 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION)
 
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] _GNU_SOURCE should be defined for building vs uClibc

2016-05-23 Thread Alexey Brodkin
In uClibc-ng O_PATH and O_DIRECTORY are only defined if _GNU_SOURCE is
defined.

So explicitly define _GNU_SOURCE in sources that use O_PATH and
O_DIRECTORY.

Without that extra definition that's what happens when building procd.

utils/utils.c:
->8--
.../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:
In function 'patch_fd':
.../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:168:22:
error: 'O_PATH' undeclared (first use in this function)
   dfd = open("/dev", O_PATH|O_DIRECTORY);
  ^
.../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:168:22:
note: each undeclared identifier is reported only once for each function
it appears in
.../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/utils/utils.c:168:29:
error: 'O_DIRECTORY' undeclared (first use in this function)
   dfd = open("/dev", O_PATH|O_DIRECTORY);
 ^
CMakeFiles/init.dir/build.make:182: recipe for target
'CMakeFiles/init.dir/utils/utils.c.o' failed
->8--

inittab.c:
->8--
.../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:
In function 'dev_exist':
.../openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:72:21:
error: 'O_PATH' undeclared (first use in this function)
  dfd = open("/dev", O_PATH|O_DIRECTORY);
 ^
.../git/openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:72:21:
note: each undeclared identifier is reported only once for each function
it appears in
.../git/openwrt/build_dir/target-arc_arc700_uClibc-1.0.14/procd-2016-05-19/inittab.c:72:28:
error: 'O_DIRECTORY' undeclared (first use in this function)
  dfd = open("/dev", O_PATH|O_DIRECTORY);
^
CMakeFiles/procd.dir/build.make:134: recipe for target
'CMakeFiles/procd.dir/inittab.c.o' failed
make[6]: *** [CMakeFiles/procd.dir/inittab.c.o] Error 1
->8--

Signed-off-by: Alexey Brodkin 
Cc: Waldemar Brodkorb 
Cc: John Crispin 
Cc: Jo-Philipp Wich 
---
 inittab.c | 1 +
 utils/utils.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/inittab.c b/inittab.c
index 528396e..6dde11a 100644
--- a/inittab.c
+++ b/inittab.c
@@ -12,6 +12,7 @@
  * GNU General Public License for more details.
  */
 
+#define _GNU_SOURCE
 #include 
 #include 
 #include 
diff --git a/utils/utils.c b/utils/utils.c
index e2e3396..8f14aad 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -12,6 +12,7 @@
  * GNU General Public License for more details.
  */
 
+#define _GNU_SOURCE
 #include 
 #include 
 #include "utils.h"
-- 
2.5.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] procd: Update to latest head

2016-05-24 Thread Alexey Brodkin
This includes a fix for building against uClibc:
http://git.openwrt.org/?p=project/procd.git;a=commit;h=9a6f83d3c168523ac7b898ae481c2fd8c501d6a6

Signed-off-by: Alexey Brodkin 
Cc: John Crispin 
---
 package/system/procd/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index 7ba2be3..cb7ab05 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=procd
-PKG_VERSION:=2016-05-19
+PKG_VERSION:=2016-05-24
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(OPENWRT_GIT)/project/procd.git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=1418c6ce8559ea125c525c2663105fa5ff14905e
+PKG_SOURCE_VERSION:=9a6f83d3c168523ac7b898ae481c2fd8c501d6a6
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
 CMAKE_INSTALL:=1
 
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] arc: Build uImage as well as vmlinux output files

2016-05-31 Thread Alexey Brodkin
Initially for ARC we were building vmlinux images because it
was both simpler and more convenient to debug Linux kernel
in runt-time via JTAG. Now when base system works quite nice
we may finally use U-Boot for loading the system image as
well. Still we keep building vmlinux images as some of our
boards are development boards and loading images with JTAG
could be at some points very beneficial.

Note for U-Boot header it's required to specify 2 values:
 * loading address
 * entry point (if it doesn't match loading address)

and in case of ARC entry point (EP) not only differs from
loading address but also changes from build to build due to
initramfs being placed between loading address and text section.
To accommodate that feature we have to calculate EP after
vmlinux gets built and before call to mkimage.

Signed-off-by: Alexey Brodkin 
---
 target/linux/arc770/image/Makefile  | 44 ++---
 target/linux/archs38/image/Makefile | 44 ++---
 2 files changed, 72 insertions(+), 16 deletions(-)

diff --git a/target/linux/arc770/image/Makefile 
b/target/linux/arc770/image/Makefile
index 6b9c5e4..47c936e 100644
--- a/target/linux/arc770/image/Makefile
+++ b/target/linux/arc770/image/Makefile
@@ -7,6 +7,13 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
+# On ARC initramfs is put before entry point and so entry point moves
+# in memory from build to built. Thus we need to extract EP from vmlinux
+# every time late in building process.
+define Build/calculate-ep
+   $(eval KERNEL_ENTRY=$(shell $(KERNEL_CROSS)readelf -h 
$(LINUX_DIR)/vmlinux | grep "Entry point address" | grep -o 0x.*))
+endef
+
 define Build/patch-dtb
$(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
$(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
@@ -16,26 +23,47 @@ endef
 define Device/Default
   PROFILES = Default $$(DEVICE_PROFILE)
   KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
-  KERNEL_SUFFIX := .elf
-  KERNEL_INITRAMFS := kernel-bin | patch-dtb
-  KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs.elf
   DEVICE_PROFILE :=
   DEVICE_DTS :=
 endef
 DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS
 
-define add_arc770
-  define Device/$(1)
+define Device/vmlinux
+  KERNEL_SUFFIX := .elf
+  KERNEL_INITRAMFS := kernel-bin | patch-dtb
+  KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf
+endef
+
+define Device/uImage
+  KERNEL_SUFFIX := .bin
+  KERNEL_INITRAMFS := kernel-bin | patch-dtb | calculate-ep | uImage none
+  KERNEL_LOADADDR := 0x8000
+endef
+
+define add_arc770_uImage
+  define Device/$(1)-uImage
+$(call Device/uImage)
+DEVICE_PROFILE := $(1)
+DEVICE_DTS := $(1)
+  endef
+  TARGET_DEVICES += $(1)-uImage
+endef
+
+define add_arc770_vmlinux
+  define Device/$(1)-vmlinux
+$(call Device/vmlinux)
 DEVICE_PROFILE := $(1)
 DEVICE_DTS := $(1)
   endef
-  TARGET_DEVICES += $(1)
+  TARGET_DEVICES += $(1)-vmlinux
 endef
 
 # DesignWare AXS101
-$(eval $(call add_arc770,axs101))
+$(eval $(call add_arc770_vmlinux,axs101))
+$(eval $(call add_arc770_uImage,axs101))
 
 # nSIM with ARC770
-$(eval $(call add_arc770,nsim_700))
+$(eval $(call add_arc770_vmlinux,nsim_700))
+$(eval $(call add_arc770_uImage,nsim_700))
 
 $(eval $(call BuildImage))
diff --git a/target/linux/archs38/image/Makefile 
b/target/linux/archs38/image/Makefile
index 9b0e53f..03bd8ee 100644
--- a/target/linux/archs38/image/Makefile
+++ b/target/linux/archs38/image/Makefile
@@ -7,6 +7,13 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
+# On ARC initramfs is put before entry point and so entry point moves
+# in memory from build to built. Thus we need to extract EP from vmlinux
+# every time before generation of uImage.
+define Build/calculate-ep
+   $(eval KERNEL_ENTRY=$(shell $(KERNEL_CROSS)readelf -h 
$(LINUX_DIR)/vmlinux | grep "Entry point address" | grep -o 0x.*))
+endef
+
 define Build/patch-dtb
$(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
$(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
@@ -16,26 +23,47 @@ endef
 define Device/Default
   PROFILES = Default $$(DEVICE_PROFILE)
   KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
-  KERNEL_SUFFIX := .elf
-  KERNEL_INITRAMFS := kernel-bin | patch-dtb
-  KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs.elf
   DEVICE_PROFILE :=
   DEVICE_DTS :=
 endef
 DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS
 
-define add_archs38
-  define Device/$(1)
+define Device/vmlinux
+  KERNEL_SUFFIX := .elf
+  KERNEL_INITRAMFS := kernel-bin | patch-dtb
+  KERNEL_INITRAMFS_NAME = vmlinux-initramfs.elf
+endef
+
+define Device/uImage
+  KERNEL_SUFFIX := .bin
+  KERNEL_INITRAMFS := kernel-bin | patch-dtb | calculate-ep | uImage none
+  KERNEL_LOADADDR := 0x8000
+endef
+
+define add_archs38_uImage
+  define Device/$(1)-uImage
+$(call Device/uImage)
+DEVICE_PROFILE := $(1)
+DEVICE_DTS := $(1)
+  endef
+  TARGET_DEVICES += $(1)-uImage
+endef

[OpenWrt-Devel] [PATCH] package/devel/gdb: Add support of ARC gdb

2016-06-01 Thread Alexey Brodkin
As of today gdb port for ARC is not yet in upstream even though
we're working hard on that.

Still to allow ARC users to debug user-space apps on top of
Linux kernel we're adding here support for building GDB from
sources hosted on our GitHub here:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2016.03-gdb

Likewise for host GDB sources that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of binutils in gdb:
-->8--
--disable-binutils
--disable-ld
--disable-gas
-->8--

Also we disable sim because if the following breakage while
building with it:
>8
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
-mono -fast -pbb -switch sem5-switch.c \
-cpu a5f -infile ./mloop5.in \
-outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
>8--------

Signed-off-by: Alexey Brodkin 
Cc: John Crispin 
Cc: Felix Fietkau 
---
 package/devel/gdb/Makefile | 23 ++--
 .../001-gdb-pr14523-mips-signal-number.patch   |  0
 .../gdb/patches/{ => 7.11}/100-musl_fix.patch  |  0
 .../patches/arc-2016.03/100-no_extern_inline.patch | 32 ++
 .../gdb/patches/arc-2016.03/110-no_testsuite.patch | 21 ++
 .../120-fix-compile-flag-mismatch.patch| 11 
 .../arc-2016.03/200-arc-fix-target-mask.patch  | 13 +
 7 files changed, 98 insertions(+), 2 deletions(-)
 rename package/devel/gdb/patches/{ => 
7.11}/001-gdb-pr14523-mips-signal-number.patch (100%)
 rename package/devel/gdb/patches/{ => 7.11}/100-musl_fix.patch (100%)
 create mode 100644 
package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch
 create mode 100644 package/devel/gdb/patches/arc-2016.03/110-no_testsuite.patch
 create mode 100644 
package/devel/gdb/patches/arc-2016.03/120-fix-compile-flag-mismatch.patch
 create mode 100644 
package/devel/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch

diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile
index f6d5fec..2e6b332 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb/Makefile
@@ -8,12 +8,27 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gdb
+
+ifeq ($(CONFIG_arc),y)
+PKG_VERSION:=arc-2016.03-gdb
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION)
+PKG_MD5SUM:=775caaf6385c16f20b6f53c0a2b95f79
+GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
+else
 PKG_VERSION:=7.11
-PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gdb
 PKG_MD5SUM:=b5c784685e1cde65ba135feea86b6d75
+GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
+endif
+
+PKG_RELEASE:=1
+
+PATCH_DIR:=./patches/$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(GDB_DIR)
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -55,7 +70,11 @@ CONFIGURE_ARGS+= \
--with-system-readline \
--without-expat \
--without-lzma \
-   --disable-werror
+   --disable-werror \
+   --disable-binutils \
+   --disable-ld \
+   --disable-gas \
+   --disable-sim
 
 CONFIGURE_VARS+= \
ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
diff --git a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch 
b/package/devel/gdb/patches/7.11/001-gdb-pr14523-mips-signal-number.patch
similarity index 100%
rename from package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch
rename to 
package/devel/gdb/patches/7.11/001-gdb-pr14523-mips-signal-number.patch
diff --git a/package/devel/gdb/patches/100-musl_fix.patch 
b/package/devel/gdb/patches/7.11/100-musl_fix.patch
similarity index 100%
rename from package/devel/gdb/patches/100-musl_fix.patch
rename to package/devel/gdb/patches/7.11/100-musl_fix.patch
diff --git a/package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch 
b/package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch
new file mode 100644
index 000..8c18c6e
--- /dev/null
+++ b/package/devel/gdb/patches/arc-2016.03/100-no_extern_inline.patch
@@ -0,0 +1,32 @@
+--- a/sim/common/sim-arange.c
 b/sim/common/sim-arange.c
+@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a
+   build_search_tree (ar);
+ }
+ 
+-#endif /* DEFINE_NON_INLINE_P */
+-
+-#if DEFINE_INLINE_P
+-
+-SIM_ARANGE_INLINE int
++int
+ sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr)
+ {
+   ADDR_RANGE_TREE *t = ar->range_tree;
+@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad
+   return 0;
+ }
+ 
+-#endif /* DEFINE_INLINE_P */
++#endif /* DEFINE_NON_INLINE_P */
+--- a/sim/common/sim-arange.h
 b/sim/common/sim-arange.h
+@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_
+ 
+ /* Return non-zero if ADDR is in range AR, traversing the entire t

Re: [OpenWrt-Devel] [PATCH] package/devel/gdb: Add support of ARC gdb

2016-06-01 Thread Alexey Brodkin
Hi Dirk,

On Wed, 2016-06-01 at 18:21 +0200, Dirk Neukirchen wrote:
> On 01.06.2016 17:32, Alexey Brodkin wrote:
> > 
> > Also we disable sim because if the following breakage while
> > building with it:
> > >8
> > /usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
> > -mono -fast -pbb -switch sem5-switch.c \
> > -cpu a5f -infile ./mloop5.in \
> > -outfile-suffix 5
> > unknown option: bash
> > Makefile:699: recipe for target 'stamp-5mloop' failed
> > make[7]: *** [stamp-5mloop] Error 1
> > >8
> rules.mk with its SHELL:=/usr/bin/env bash is the culprit

I think so.

> I had some issues when I set CONFIG_SHELL in the same  way
> - using SHELL:=/bin/bash probably fixes this but might have
> other side effects or breakage (globally/for other packages)

Indeed.

But anyways we don't need GDB's simulator to be built here,
so change itself is pretty sane.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] package/devel/gdb: Add support of ARC gdb

2016-06-03 Thread Alexey Brodkin
Hi John,

On Fri, 2016-06-03 at 11:09 +0200, John Crispin wrote:
> Hi,
> 
> On 01/06/2016 17:32, Alexey Brodkin wrote:
> > 
> > As of today gdb port for ARC is not yet in upstream even though
> > we're working hard on that.
> > 
> > Still to allow ARC users to debug user-space apps on top of
> > Linux kernel we're adding here support for building GDB from
> > sources hosted on our GitHub here:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2016.03-gdb
> > 
> > Likewise for host GDB sources that come from unified git repository
> > (which is the case for upstream binutils/gdb today) we need to disable
> > building of binutils in gdb:
> > -->8--
> > --disable-binutils
> > --disable-ld
> > --disable-gas
> > -->8--
> > 
> these work for !arc targets. disabling them for all targets because they
> are broken on arc seem weird even if they might not be used.
> 
> rather than cluttering the makefile how about marking the packahe broken
> for arc and adding a new one called gdb-arc that depends on arc only.
> this will allow us to keep gdb clean and just drop the gdb-arc package
> once the fixes treacled down the tree.

Well all 3 options except "--sim" are very valid because modern GDB sources
come from "unified" git repo where binutils co-exist with gdb.

That's done on purpose because a lot of stuff indeed is the same in both
projects. And there's really no point in building either binutils, ld or gas
when we're building GDB. Disabling those options we at least saving some time
and in some cases may escape build failures.

Mentioned build failures might happen with some even release versions of GDB
tarballs. Again that is because gdb comes from the same unified repo BUT
(and that's important) still from the separate branch and so some parts of
binutils might be taken from "binutils" branch in unstable state.

In other words disabling build of not used components is pretty safe and
future-proof. And simulator falls here as well - we don't need it anyways
for either arch/board.

As for adding a separate package... we'll need to propagate new Kconfig symbol 
in
other files and so instead of limiting changes to 1 file we'll spread our
contamination all over source tree. Do we really want it?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] package/devel/gdb-arc: Add target GDB for ARC

2016-06-07 Thread Alexey Brodkin
ARC port of GDB is not yet upstream so we need to use
sources from Synopsys GitHub repo.

Given Synopys' commitment to upstream ARC support in GDB
in the nearest future it might be simpler to add a separate
package for ARC GDB instead of patching generic GDB package.
This way once ARC GDB stuff gets uptreamed we'll only need
to remove that new "gdb-arc" package.

Note 1 very minor change in generic gdb package was done -
it now depends on !arc (while "gdb-arc" depends on "arc").

Signed-off-by: Alexey Brodkin 
---
 package/devel/{gdb => gdb-arc}/Makefile| 44 --
 .../gdb-arc/patches/100-no_extern_inline.patch | 32 
 .../devel/gdb-arc/patches/110-no_testsuite.patch   | 21 +++
 .../patches/120-fix-compile-flag-mismatch.patch| 11 ++
 package/devel/gdb/Makefile |  2 +-
 5 files changed, 90 insertions(+), 20 deletions(-)
 copy package/devel/{gdb => gdb-arc}/Makefile (64%)
 create mode 100644 package/devel/gdb-arc/patches/100-no_extern_inline.patch
 create mode 100644 package/devel/gdb-arc/patches/110-no_testsuite.patch
 create mode 100644 
package/devel/gdb-arc/patches/120-fix-compile-flag-mismatch.patch

diff --git a/package/devel/gdb/Makefile b/package/devel/gdb-arc/Makefile
similarity index 64%
copy from package/devel/gdb/Makefile
copy to package/devel/gdb-arc/Makefile
index f6d5fec..c42b108 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb-arc/Makefile
@@ -7,13 +7,15 @@
 
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=gdb
-PKG_VERSION:=7.11
+PKG_NAME:=gdb-arc
+PKG_VERSION:=arc-2016.03-gdb
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@GNU/gdb
-PKG_MD5SUM:=b5c784685e1cde65ba135feea86b6d75
+PKG_SOURCE:=gdb-arc-2016.03-gdb.tar.gz
+PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION)
+PKG_MD5SUM:=775caaf6385c16f20b6f53c0a2b95f79
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2016.03-gdb
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
@@ -21,31 +23,31 @@ PKG_LICENSE:=GPL-3.0+
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/gdb/Default
+define Package/gdb-arc/Default
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib
+  DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib @arc
   URL:=http://www.gnu.org/software/gdb/
 endef
 
-define Package/gdb
-$(call Package/gdb/Default)
-  TITLE:=GNU Debugger
+define Package/gdb-arc
+$(call Package/gdb-arc/Default)
+  TITLE:=GNU Debugger for ARC
   DEPENDS+=+libreadline +libncurses +zlib
 endef
 
-define Package/gdb/description
+define Package/gdb-arc/description
 GDB, the GNU Project debugger, allows you to see what is going on `inside'
 another program while it executes -- or what another program was doing at the
 moment it crashed.
 endef
 
-define Package/gdbserver
-$(call Package/gdb/Default)
+define Package/gdbserver-arc
+$(call Package/gdb-arc/Default)
   TITLE:=Remote server for GNU Debugger
 endef
 
-define Package/gdbserver/description
+define Package/gdbserver-arc/description
 GDBSERVER is a program that allows you to run GDB on a different machine than 
the
 one which is running the program being debugged.
 endef
@@ -55,7 +57,11 @@ CONFIGURE_ARGS+= \
--with-system-readline \
--without-expat \
--without-lzma \
-   --disable-werror
+   --disable-werror \
+   --disable-binutils \
+   --disable-ld \
+   --disable-gas \
+   --disable-sim
 
 CONFIGURE_VARS+= \
ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
@@ -74,15 +80,15 @@ define Build/Install
install-gdb
 endef
 
-define Package/gdb/install
+define Package/gdb-arc/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/
 endef
 
-define Package/gdbserver/install
+define Package/gdbserver-arc/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/
 endef
 
-$(eval $(call BuildPackage,gdb))
-$(eval $(call BuildPackage,gdbserver))
+$(eval $(call BuildPackage,gdb-arc))
+$(eval $(call BuildPackage,gdbserver-arc))
diff --git a/package/devel/gdb-arc/patches/100-no_extern_inline.patch 
b/package/devel/gdb-arc/patches/100-no_extern_inline.patch
new file mode 100644
index 000..8c18c6e
--- /dev/null
+++ b/package/devel/gdb-arc/patches/100-no_extern_inline.patch
@@ -0,0 +1,32 @@
+--- a/sim/common/sim-arange.c
 b/sim/common/sim-arange.c
+@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a
+   build_search_tree (ar);
+ }
+ 
+-#endif /* DEFINE_NON_INLINE_P */
+-
+-#if DEFINE_INLINE_P
+-
+-SIM_ARANGE_INLINE int
++int
+ sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr)
+ {
+   ADDR_RANGE_TREE *t = ar->range_tree;
+@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad
+   return 0;
+ }
+ 
+-#endif /* 

[OpenWrt-Devel] [PATCH] toolchain/gdb: Use correct folder name for ARC patches

2016-06-09 Thread Alexey Brodkin
Even though ARC tools were released as arc-2016.03
we have a little bit different version name for GDB.
That's because both Binutils and GDB come from the same
git repo but from different branches (and so different tags).

Also removing an extra patch that made its way into release.

Signed-off-by: Alexey Brodkin 
---
 .../100-no_extern_inline.patch  |  0
 .../{arc-2016.03 => arc-2016.03-gdb}/110-no_testsuite.patch |  0
 .../120-fix-compile-flag-mismatch.patch |  0
 .../gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch   | 13 -
 4 files changed, 13 deletions(-)
 rename toolchain/gdb/patches/{arc-2016.03 => 
arc-2016.03-gdb}/100-no_extern_inline.patch (100%)
 rename toolchain/gdb/patches/{arc-2016.03 => 
arc-2016.03-gdb}/110-no_testsuite.patch (100%)
 rename toolchain/gdb/patches/{arc-2016.03 => 
arc-2016.03-gdb}/120-fix-compile-flag-mismatch.patch (100%)
 delete mode 100644 
toolchain/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch

diff --git a/toolchain/gdb/patches/arc-2016.03/100-no_extern_inline.patch 
b/toolchain/gdb/patches/arc-2016.03-gdb/100-no_extern_inline.patch
similarity index 100%
rename from toolchain/gdb/patches/arc-2016.03/100-no_extern_inline.patch
rename to toolchain/gdb/patches/arc-2016.03-gdb/100-no_extern_inline.patch
diff --git a/toolchain/gdb/patches/arc-2016.03/110-no_testsuite.patch 
b/toolchain/gdb/patches/arc-2016.03-gdb/110-no_testsuite.patch
similarity index 100%
rename from toolchain/gdb/patches/arc-2016.03/110-no_testsuite.patch
rename to toolchain/gdb/patches/arc-2016.03-gdb/110-no_testsuite.patch
diff --git 
a/toolchain/gdb/patches/arc-2016.03/120-fix-compile-flag-mismatch.patch 
b/toolchain/gdb/patches/arc-2016.03-gdb/120-fix-compile-flag-mismatch.patch
similarity index 100%
rename from 
toolchain/gdb/patches/arc-2016.03/120-fix-compile-flag-mismatch.patch
rename to 
toolchain/gdb/patches/arc-2016.03-gdb/120-fix-compile-flag-mismatch.patch
diff --git a/toolchain/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch 
b/toolchain/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch
deleted file mode 100644
index 7e51d588..000
--- a/toolchain/gdb/patches/arc-2016.03/200-arc-fix-target-mask.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/bfd/config.bfd b/bfd/config.bfd
-index 5145d4a..a9c9c99 100644
 a/bfd/config.bfd
-+++ b/bfd/config.bfd
-@@ -275,7 +275,7 @@ case "${targ}" in
- targ_defvec=am33_elf32_linux_vec
- ;;
- 
--  arc*-*-elf* | arc*-*-linux-uclibc*)
-+  arc*-*-elf* | arc*-*-linux-*)
- targ_defvec=arc_elf32_le_vec
- targ_selvecs=arc_elf32_be_vec
- ;;
-- 
2.5.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] linux: arc: disable kernel unwinding to fix modules loading

2016-06-22 Thread Alexey Brodkin
With update of binutils for ARC (this is now based on upstream 2.26)
we noticed issues with loadable kernel modules.

Something like that was happening:
->8---
mbcache: unknown relocation: 49
insmod: can't insert './mbcache.ko': invalid module format
->8---

More details could be found in that discussion in binutils mailing list:
http://thread.gmane.org/gmane.comp.gnu.binutils/74662

As of now the simplest work-around is to disable in-kernel unwinder
for now. That will at least allow us to use modules again.

Signed-off-by: Alexey Brodkin 
Cc: Vineet Gupta 
Cc: John Crispin 
---
 target/linux/arc770/config-4.4  | 3 +--
 target/linux/archs38/config-4.4 | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/target/linux/arc770/config-4.4 b/target/linux/arc770/config-4.4
index 87fd7e3..d6905d7 100644
--- a/target/linux/arc770/config-4.4
+++ b/target/linux/arc770/config-4.4
@@ -18,7 +18,7 @@ CONFIG_ARC_CURR_IN_REG=y
 CONFIG_ARC_DBG=y
 # CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
 # CONFIG_ARC_DBG_TLB_PARANOIA is not set
-CONFIG_ARC_DW2_UNWIND=y
+# CONFIG_ARC_DW2_UNWIND is not set
 CONFIG_ARC_EMUL_UNALIGNED=y
 # CONFIG_ARC_FPU_SAVE_RESTORE is not set
 CONFIG_ARC_HAS_DCACHE=y
@@ -78,7 +78,6 @@ CONFIG_HAVE_FUTEX_CMPXCHG=y
 CONFIG_HAVE_IOREMAP_PROT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_HAVE_NET_DSA=y
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_PERF_EVENTS=y
diff --git a/target/linux/archs38/config-4.4 b/target/linux/archs38/config-4.4
index 9ea33c6..c7dc264 100644
--- a/target/linux/archs38/config-4.4
+++ b/target/linux/archs38/config-4.4
@@ -15,7 +15,7 @@ CONFIG_ARC_CURR_IN_REG=y
 CONFIG_ARC_DBG=y
 # CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
 # CONFIG_ARC_DBG_TLB_PARANOIA is not set
-CONFIG_ARC_DW2_UNWIND=y
+# CONFIG_ARC_DW2_UNWIND is not set
 CONFIG_ARC_HAS_COH_CACHES=y
 CONFIG_ARC_HAS_DCACHE=y
 # CONFIG_ARC_HAS_DCCM is not set
@@ -85,7 +85,6 @@ CONFIG_HAVE_FUTEX_CMPXCHG=y
 CONFIG_HAVE_IOREMAP_PROT=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_HAVE_NET_DSA=y
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_PERF_EVENTS=y
@@ -175,7 +174,6 @@ CONFIG_SRCU=y
 CONFIG_STACKTRACE=y
 CONFIG_STMMAC_ETH=y
 CONFIG_STMMAC_PLATFORM=y
-# CONFIG_SUNXI_SRAM is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_UNINLINE_SPIN_UNLOCK=y
 CONFIG_USB_SUPPORT=y
-- 
2.5.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Add ARC platforms to platforms wiki

2016-07-21 Thread Alexey Brodkin
Hello,

I'm wondering if there's a chance to add information about ARC
platforms in the Wiki here https://dev.openwrt.org/wiki/platforms?

I think something like this will work
==
Target name Platform               Architecture Endianness  
Developer(s)Known
Issues/Notes
--
arc770          Synopsys DesignWare ARC 770D   ARC              little          
abrodkin        arc770
archs38         Synopsys DesignWare ARC HS38   ARC              little          
abrodkin        archs38
==

Regards,
Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Add ARC platforms to platforms wiki

2016-07-21 Thread Alexey Brodkin
Hi Florian,

On Thu, 2016-07-21 at 11:23 -0700, Florian Fainelli wrote:
> On 07/21/2016 10:45 AM, Alexey Brodkin wrote:
> > 
> > Hello,
> > 
> > I'm wondering if there's a chance to add information about ARC
> > platforms in the Wiki here https://dev.openwrt.org/wiki/platforms?
> 
> Done

Thanks a lot!

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Do we really need 000-keep_initrafs_the_default.patch?

2016-07-22 Thread Alexey Brodkin
Hello,

I'm wondering why there's a need for "000-keep_initrafs_the_default.patch"?
It could be found here:
-->8
target/linux/generic/patches-3.18/000-keep_initrafs_the_default.patch
target/linux/generic/patches-4.1/000-keep_initrafs_the_default.patch
target/linux/generic/patches-4.4/000-keep_initrafs_the_default.patch
-->8

With that patch in place for initramfs no additional options are reported
for "/" partition. What's really important is missing info about sizes.
Which in its turn makes opkg think that there's no space on "/" partition
to install software.

I understand that's a sort of corner-case, people rarely install packages on
ramfs but anyways why not?

Just in case that's what I see with the patch:
-->8
root@lede:/# cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
-->8

And without:
-->8
root@lede:/# cat /proc/mounts
rootfs / rootfs rw,size=256168k,nr_inodes=32021 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
-->8

Note how different is entry for rootfs.

If there're no objections I'll go ahead and send a patch that
gets rid of all 3 patches mentioned above.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] sunxi/pcduino3: Remove selection of absent rtl8188eu

2016-07-22 Thread Alexey Brodkin
Since commit 217a64375547 "wireless: remove rtl8188eu (staging)"
there's no point in selection of the missing module.

Signed-off-by: Alexey Brodkin 
Cc: John Crispin 
Cc: Zoltan Herpai 
---
 target/linux/sunxi/profiles/pcduino3.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/sunxi/profiles/pcduino3.mk 
b/target/linux/sunxi/profiles/pcduino3.mk
index 4d6dcb1..1c4e753 100644
--- a/target/linux/sunxi/profiles/pcduino3.mk
+++ b/target/linux/sunxi/profiles/pcduino3.mk
@@ -9,7 +9,7 @@ define Profile/Linksprite_pcDuino3
NAME:=pcDuino3
PACKAGES:=\
uboot-sunxi-Linksprite_pcDuino3 kmod-sun4i-emac kmod-rtc-sunxi \
-   kmod-net-rtl8188eu kmod-ata-core kmod-ata-sunxi
+   kmod-ata-core kmod-ata-sunxi
 endef
 
 define Profile/Linksprite_pcDuino3/Description
-- 
2.7.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] linux: Get rid of 000-keep_initrafs_the_default.patch

2016-07-22 Thread Alexey Brodkin
With that patch in place for initramfs no additional options are
reported for "/" partition. What's really important is missing
info about sizes. Which in its turn makes opkg think that there's
no space on "/" partition to install software.

I understand that's a sort of corner-case, people rarely install
packages on ramfs but anyways why not?

Just in case that's what I see with the patch:
-->8
root@lede:/# cat /proc/mounts
rootfs / rootfs rw 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
-->8

And without:
-->8
root@lede:/# cat /proc/mounts
rootfs / rootfs rw,size=256168k,nr_inodes=32021 0 0
proc /proc proc rw,nosuid,nodev,noexec,noatime 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,noatime 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,size=512k,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600 0 0
debugfs /sys/kernel/debug debugfs rw,noatime 0 0
-->8

Note how different is entry for rootfs.

And given there's no known rationale for that patch we're
getting rid of it.

Signed-off-by: Alexey Brodkin 
Cc: Jonas Gorski 
Cc: Rafał Miłecki 
Cc: John Crispin 
Cc: Felix Fietkau 
---
 .../000-keep_initrafs_the_default.patch| 25 --
 .../000-keep_initrafs_the_default.patch| 25 --
 .../000-keep_initrafs_the_default.patch| 25 --
 3 files changed, 75 deletions(-)
 delete mode 100644 
target/linux/generic/patches-3.18/000-keep_initrafs_the_default.patch
 delete mode 100644 
target/linux/generic/patches-4.1/000-keep_initrafs_the_default.patch
 delete mode 100644 
target/linux/generic/patches-4.4/000-keep_initrafs_the_default.patch

diff --git 
a/target/linux/generic/patches-3.18/000-keep_initrafs_the_default.patch 
b/target/linux/generic/patches-3.18/000-keep_initrafs_the_default.patch
deleted file mode 100644
index d4164ca..000
--- a/target/linux/generic/patches-3.18/000-keep_initrafs_the_default.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Upstream changed the default rootfs to tmpfs when none has been passed
-to the kernel - this doesn't fit our purposes, so change it back.
-
-Signed-off-by: Imre Kaloz 
-
 a/init/do_mounts.c
-+++ b/init/do_mounts.c
-@@ -623,6 +623,7 @@ int __init init_rootfs(void)
-   if (err)
-   return err;
- 
-+#if 0
-   if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
-   (!root_fs_names || strstr(root_fs_names, "tmpfs"))) {
-   err = shmem_init();
-@@ -630,6 +631,9 @@ int __init init_rootfs(void)
-   } else {
-   err = init_ramfs_fs();
-   }
-+#else
-+  err = init_ramfs_fs();
-+#endif
- 
-   if (err)
-   unregister_filesystem(&rootfs_fs_type);
diff --git 
a/target/linux/generic/patches-4.1/000-keep_initrafs_the_default.patch 
b/target/linux/generic/patches-4.1/000-keep_initrafs_the_default.patch
deleted file mode 100644
index 5e56d44..000
--- a/target/linux/generic/patches-4.1/000-keep_initrafs_the_default.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Upstream changed the default rootfs to tmpfs when none has been passed
-to the kernel - this doesn't fit our purposes, so change it back.
-
-Signed-off-by: Imre Kaloz 
-
 a/init/do_mounts.c
-+++ b/init/do_mounts.c
-@@ -628,6 +628,7 @@ int __init init_rootfs(void)
-   if (err)
-   return err;
- 
-+#if 0
-   if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
-   (!root_fs_names || strstr(root_fs_names, "tmpfs"))) {
-   err = shmem_init();
-@@ -635,6 +636,9 @@ int __init init_rootfs(void)
-   } else {
-   err = init_ramfs_fs();
-   }
-+#else
-+  err = init_ramfs_fs();
-+#endif
- 
-   if (err)
-   unregister_filesystem(&rootfs_fs_type);
diff --git 
a/target/linux/generic/patches-4.4/000-keep_initrafs_the_default.patch 
b/target/linux/generic/patches-4.4/000-keep_initrafs_the_default.patch
deleted file mode 100644
index e6f1be4..000
--- a/target/linux/generic/patches-4.4/000-keep_initrafs_the_default.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Upstream changed the default rootfs to tmpfs when none has been passed
-to the kernel - this doesn't fit our purposes, so change it back.
-
-Signed-off-by: Imre Kaloz 
-
 a/init/do_mounts.c
-+++ b/init/do_mounts.c
-@@ -633,6 +633,7 @@ int __init init_rootfs(void)
-   if (err)
-   return err;

[OpenWrt-Devel] [PATCH] linux/arc*: disable MAC frame filter in DW GMAC

2016-07-27 Thread Alexey Brodkin
For some [still unknown] reason in ARC SDP boards
DW GMAC doesn't enter promiscuous mode if eth0 gets
added to the br-lan interface before Ethernet PHY finishes
autonegotiation (PHY gets reset on DW GMAC start).

As a work-around we completely disable frame filtering
in GMAC hardware which gives us working bridge that consists
of eth0 and wlan0 (USB Wi-Fi dongle). I.e. we finally have
working "Dumb AP" setup made of ARC AXS10x boards.

Given this is pretty ugly hack we're applying it only for
affected platforms which do require eth0 to enter promiscuous
mode to operate in a bridge with wlan0.

Signed-off-by: Alexey Brodkin 
---
 ...-stmmac-Disable-fame-filtering-completely.patch | 36 ++
 ...-stmmac-Disable-fame-filtering-completely.patch | 36 ++
 2 files changed, 72 insertions(+)
 create mode 100644 
target/linux/arc770/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
 create mode 100644 
target/linux/archs38/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch

diff --git 
a/target/linux/arc770/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
 
b/target/linux/arc770/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
new file mode 100644
index 000..d47f155
--- /dev/null
+++ 
b/target/linux/arc770/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
@@ -0,0 +1,36 @@
+From 0031b9011cb2b2b1de4dbb4f9620303aec760db4 Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin 
+Date: Wed, 27 Jul 2016 11:33:14 +0300
+Subject: [PATCH] stmmac: Disable fame filtering completely
+
+For some [still unknown] reason in ARC SDP boards
+DW GMAC doesn't enter promiscuous mode if eth0 gets
+added to the br-lan interface before Ethernet PHY finishes
+autonegotiation (PHY gets reset on DW GMAC start).
+
+As a work-around we completely disable frame filtering
+in GMAC hardware which gives us working bridge that consists
+of eth0 and wlan0 (USB Wi-Fi dongle). I.e. we finally have
+working "Dumb AP" setup made of ARC AXS10x boards.
+
+Signed-off-by: Alexey Brodkin 
+---
+ drivers/net/ethernet/stmicro/stmmac/common.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h 
b/drivers/net/ethernet/stmicro/stmmac/common.h
+index 623c6ed..6396b81 100644
+--- a/drivers/net/ethernet/stmicro/stmmac/common.h
 b/drivers/net/ethernet/stmicro/stmmac/common.h
+@@ -42,7 +42,7 @@
+ #define   DWMAC_CORE_3_50 0x35
+ 
+ #undef FRAME_FILTER_DEBUG
+-/* #define FRAME_FILTER_DEBUG */
++#define FRAME_FILTER_DEBUG
+ 
+ /* Extra statistic and debug information exposed by ethtool */
+ struct stmmac_extra_stats {
+-- 
+2.7.4
+
diff --git 
a/target/linux/archs38/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
 
b/target/linux/archs38/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
new file mode 100644
index 000..d47f155
--- /dev/null
+++ 
b/target/linux/archs38/patches-4.4/700-stmmac-Disable-fame-filtering-completely.patch
@@ -0,0 +1,36 @@
+From 0031b9011cb2b2b1de4dbb4f9620303aec760db4 Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin 
+Date: Wed, 27 Jul 2016 11:33:14 +0300
+Subject: [PATCH] stmmac: Disable fame filtering completely
+
+For some [still unknown] reason in ARC SDP boards
+DW GMAC doesn't enter promiscuous mode if eth0 gets
+added to the br-lan interface before Ethernet PHY finishes
+autonegotiation (PHY gets reset on DW GMAC start).
+
+As a work-around we completely disable frame filtering
+in GMAC hardware which gives us working bridge that consists
+of eth0 and wlan0 (USB Wi-Fi dongle). I.e. we finally have
+working "Dumb AP" setup made of ARC AXS10x boards.
+
+Signed-off-by: Alexey Brodkin 
+---
+ drivers/net/ethernet/stmicro/stmmac/common.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h 
b/drivers/net/ethernet/stmicro/stmmac/common.h
+index 623c6ed..6396b81 100644
+--- a/drivers/net/ethernet/stmicro/stmmac/common.h
 b/drivers/net/ethernet/stmicro/stmmac/common.h
+@@ -42,7 +42,7 @@
+ #define   DWMAC_CORE_3_50 0x35
+ 
+ #undef FRAME_FILTER_DEBUG
+-/* #define FRAME_FILTER_DEBUG */
++#define FRAME_FILTER_DEBUG
+ 
+ /* Extra statistic and debug information exposed by ethtool */
+ struct stmmac_extra_stats {
+-- 
+2.7.4
+
-- 
2.7.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] toolchain/gcc/arc-2016.03: Fix building on hosts with gcc 6.x

2016-07-27 Thread Alexey Brodkin
On attempt to build ARC toolchain on the host with gcc 6.1 I saw the
same failure as described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69959

This change adds a back-port of the fix from upstream gcc, see
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=233572

Note the fix is already a part of gcc-5.4 and gcc-6.1 so no need for
the same fix for others.

Signed-off-by: Alexey Brodkin 
---
 .../arc-2016.03/950-fix-building-with-gcc6.patch   | 153 +
 1 file changed, 153 insertions(+)
 create mode 100644 
toolchain/gcc/patches/arc-2016.03/950-fix-building-with-gcc6.patch

diff --git a/toolchain/gcc/patches/arc-2016.03/950-fix-building-with-gcc6.patch 
b/toolchain/gcc/patches/arc-2016.03/950-fix-building-with-gcc6.patch
new file mode 100644
index 000..e958380
--- /dev/null
+++ b/toolchain/gcc/patches/arc-2016.03/950-fix-building-with-gcc6.patch
@@ -0,0 +1,153 @@
+From 5dce741e00f86a08a4c174fb3605d896f210ab52 Mon Sep 17 00:00:00 2001
+From: Bernd Edlinger 
+Date: Wed, 27 Jul 2016 13:30:03 +0300
+Subject: [PATCH] 2016-02-19  Jakub JelinekBernd Edlinger
+  
+
+* Make-lang.in: Invoke gperf with -L C++.
+* cfns.gperf: Remove prototypes for hash and libc_name_p
+inlines.
+* cfns.h: Regenerated.
+* except.c (nothrow_libfn_p): Adjust.
+
+git-svn-id: 
svn+ssh://gcc.gnu.org/svn/gcc/trunk@233572138bc75d-0d04-0410-961f-82ee72b054a4
+
+This patch fixes building of gcc-4.x by gcc-6.x, for more details see
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69959
+
+Signed-off-by: Alexey Brodkin 
+---
+ gcc/cp/Make-lang.in |  2 +-
+ gcc/cp/cfns.gperf   | 10 ++
+ gcc/cp/cfns.h   | 41 ++---
+ gcc/cp/except.c |  3 ++-
+ 4 files changed, 19 insertions(+), 37 deletions(-)
+
+diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
+index dce523a..36a1a97 100644
+--- a/gcc/cp/Make-lang.in
 b/gcc/cp/Make-lang.in
+@@ -115,7 +115,7 @@ else
+ # deleting the $(srcdir)/cp/cfns.h file.
+ $(srcdir)/cp/cfns.h:
+ endif
+-  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
++  gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
+   $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
+ 
+ #
+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
+index c4c4e2a..5c40933 100644
+--- a/gcc/cp/cfns.gperf
 b/gcc/cp/cfns.gperf
+@@ -1,3 +1,5 @@
++%language=C++
++%define class-name libc_name
+ %{
+ /* Copyright (C) 2000-2013 Free Software Foundation, Inc.
+ 
+@@ -16,14 +18,6 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ %}
+ %%
+ # The standard C library functions, for feeding to gperf; the result is used
+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
+index 42dd3cf..6c79864 100644
+--- a/gcc/cp/cfns.h
 b/gcc/cp/cfns.h
+@@ -1,5 +1,5 @@
+-/* ANSI-C code produced by gperf version 3.0.3 */
+-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C 
cfns.gperf  */
++/* C++ code produced by gperf version 3.0.4 */
++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ 
--output-file cfns.h cfns.gperf  */
+ 
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+   && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+@@ -28,7 +28,7 @@
+ #error "gperf generated tables don't work with this execution character set. 
Please report a bug to ."
+ #endif
+ 
+-#line 1 "cfns.gperf"
++#line 3 "cfns.gperf"
+ 
+ /* Copyright (C) 2000-2013 Free Software Foundation, Inc.
+ 
+@@ -47,25 +47,18 @@ for more details.
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+-#ifdef __GNUC__
+-__inline
+-#endif
+-static unsigned int hash (const char *, unsigned int);
+-#ifdef __GNUC__
+-__inline
+-#endif
+-const char * libc_name_p (const char *, unsigned int);
+ /* maximum key range = 391, duplicates = 0 */
+ 
+-#ifdef __GNUC__
+-__inline
+-#else
+-#ifdef __cplusplus
+-inline
+-#endif
+-#endif
+-static unsigned int
+-hash (register const char *str, register unsigned int len)
++class libc_name
++{
++private:
++  static inline unsigned int hash (const char *str, unsigned int len);
++public:
++  static const char *libc_name_p (const char *str, unsigned int len);
++};
++
++inline unsigned int
++libc_name::hash (register const char *str, register un

Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] linux/arc*: disable MAC frame filter in DW GMAC

2016-07-27 Thread Alexey Brodkin
Hi Felix,

On Wed, 2016-07-27 at 17:19 +0200, Felix Fietkau wrote:
> On 2016-07-27 14:11, Alexey Brodkin wrote:
> > 
> > For some [still unknown] reason in ARC SDP boards
> > DW GMAC doesn't enter promiscuous mode if eth0 gets
> > added to the br-lan interface before Ethernet PHY finishes
> > autonegotiation (PHY gets reset on DW GMAC start).
>
> I think this is something we need to look at more closely instead of
> just papering over it in this way. By the way, arc* aren't the only ones
> using stmmac, ipq806x uses it as well and might be equally affected.
> Did you check if the network stack tells the driver to go into promisc
> mode? Or does the frame filtering registers simply get clobbered
> somewhere internally?
> Let's do some more testing and get this fixed properly...

Yeah I know DW GMAC is used a lot around the globe in different forms.
For example I have Cubieboard2 where it is used and there I cannot reproduce
the same problem.

Luckily I have access to GMAC documentation and so I was able to check that
Linux driver correctly programs "MAC frame filter" in different situations
and still in some cases even if "PR" bit (bit #0) is set CPU doesn't get
packages which DST MAC differs from GMAC's one.

I.e. it looks like hardware for some reason operates not in the mode it was
instructed/programmed to be in.

I tried to check if "MAC frame filter" register gets corrupted every time
new value was about to be written there but I haven't seen unexpected values.
So either that "corruption" happens as a side-effect of some other operations
or internal state-machine enters unexpected state based on some external events.

If someone may try my reproduction scenario on other boards with DW GMAC 
it might give us more datapoints here.

So what I do (before connection of network cable!) is:
-->8-
ifconfig eth0 up
brctl addbr br0
brctl addif br0 eth0
ifconfig br0 up
tcpdump -vv -i eth0 -n -e
-->8-

Then connect network cable and see if tcpdump shows anything.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] linux/arc*: disable MAC frame filter in DW GMAC

2016-08-15 Thread Alexey Brodkin
Hi Felix,

On Wed, 2016-07-27 at 17:19 +0200, Felix Fietkau wrote:
> On 2016-07-27 14:11, Alexey Brodkin wrote:
> > 
> > For some [still unknown] reason in ARC SDP boards
> > DW GMAC doesn't enter promiscuous mode if eth0 gets
> > added to the br-lan interface before Ethernet PHY finishes
> > autonegotiation (PHY gets reset on DW GMAC start).
>
> I think this is something we need to look at more closely instead of
> just papering over it in this way. By the way, arc* aren't the only ones
> using stmmac, ipq806x uses it as well and might be equally affected.
> Did you check if the network stack tells the driver to go into promisc
> mode? Or does the frame filtering registers simply get clobbered
> somewhere internally?
>
> Let's do some more testing and get this fixed properly...

So I spent quite some time with that, short summary could be found here:
http://lists.infradead.org/pipermail/linux-snps-arc/2016-August/001395.html

Probably most important summary for us here is:
->8--
Unfortunately I cannot figure out why GMAC behaves that way.
As per GMAC's databook the only reason for it to not react on a register
being written is missing input clock but there's no reason for the
clock to be missing and I don't seem to have a way to check if there's
a problem with clock or not.
->8--

It worth trying on other boards with DW GMAC but the only other board
except ARC SDP ones is Cubieboard2 with sunxi-gmac (which is a kind of
DW GMAC as I may see from its Linux's driver) but on CB2 all works as
exected. If somebody wants to volunteer I'll be more than happy to work
with him/her trying to get more datapoints.

And I do think in the meantime it's good to apply this patch so people
get working Wireless AP without extra patching of sources or what's even
better with snapshot images.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [LEDE-DEV] [PATCH] linux/arc*: disable MAC frame filter in DW GMAC

2016-08-17 Thread Alexey Brodkin
Hi Daniel,

On Tue, 2016-08-16 at 17:12 +0200, Daniel Golle wrote:
> Hi Alexey,
> 
> On Tue, Aug 16, 2016 at 06:06:20AM +0000, Alexey Brodkin wrote:
> > 
> > Hi Felix,
> > 
> > On Wed, 2016-07-27 at 17:19 +0200, Felix Fietkau wrote:
> > > 
> > > On 2016-07-27 14:11, Alexey Brodkin wrote:
> > > > 
> > > > 
> > > > For some [still unknown] reason in ARC SDP boards
> > > > DW GMAC doesn't enter promiscuous mode if eth0 gets
> > > > added to the br-lan interface before Ethernet PHY finishes
> > > > autonegotiation (PHY gets reset on DW GMAC start).
> > > 
> > > I think this is something we need to look at more closely instead of
> > > just papering over it in this way. By the way, arc* aren't the only ones
> > > using stmmac, ipq806x uses it as well and might be equally affected.
> > > Did you check if the network stack tells the driver to go into promisc
> > > mode? Or does the frame filtering registers simply get clobbered
> > > somewhere internally?
> > > 
> > > Let's do some more testing and get this fixed properly...
> > 
> > So I spent quite some time with that, short summary could be found here:
> > http://lists.infradead.org/pipermail/linux-snps-arc/2016-August/001395.html
> > 
> > Probably most important summary for us here is:
> > ->8--
> > Unfortunately I cannot figure out why GMAC behaves that way.
> > As per GMAC's databook the only reason for it to not react on a register
> > being written is missing input clock but there's no reason for the
> > clock to be missing and I don't seem to have a way to check if there's
> > a problem with clock or not.
> > ->8--
> > 
> > It worth trying on other boards with DW GMAC but the only other board
> > except ARC SDP ones is Cubieboard2 with sunxi-gmac (which is a kind of
> > DW GMAC as I may see from its Linux's driver) but on CB2 all works as
> > exected. If somebody wants to volunteer I'll be more than happy to work
> > with him/her trying to get more datapoints.
> 
> stmac/dwmac works as expected on Oxford/PLXTECH OX82x/NAS782x (oxnas
> target on OpenWrt/LEDE) as well.

That's good to know but remember what was my use-case to reproduce the
problem in questions - DW GMAC must be put in promisq mode while PHY
has no link established (the simplest option is to unplug the cable).

Have you tried exactly that scenario?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: add support of uClibc-ng

2015-09-30 Thread Alexey Brodkin
Hi Alexander,

On Wed, 2015-09-30 at 22:37 +0200, Alexander Couzens wrote:
> Hi,
> 
> what's the state of this patch?
> 
> I'm unbreaking sparc for OpenWrt and uclibc is broken as already
> mentioned. musl doesn't support sparc :(.

Unfortunately I haven't heard anything back except that musl
is the right way to go. 

I think you saw it here - https://patchwork.ozlabs.org/patch/510985/

And as in your case for ARC there's no musl yet and won't be
at least anything stable until the next OpenWRT release.

-Alexey


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uclibc-ng: bump version from 1.0.6 to 1.0.8

2015-11-02 Thread Alexey Brodkin
2 new architectures were added in between 1.0.6 and 1.0.8 in uClibc-ng,
these are:
 * lm32
 * or1k

Even thought both are not yet supported in OpenWRT it's important to
disable them both in default config file otherwise user prompt will
appear during uClibc configuration asking to select desired
architecture.

Signed-off-by: Alexey Brodkin 
Cc: Waldemar Brodkorb 
Cc: Mathieu Olivari 
Cc: Felix Fietkau 
Cc: John Crispin 
---
 toolchain/uClibc/Config.version | 2 +-
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/arm   | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/armeb | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/common| 2 ++
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/debug | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/i386  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/i686  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/m68k  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64| 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64.32 | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64.64 | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64.n32| 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el.32   | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el.64   | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el.n32  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mipsel| 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mipsel.cobalt | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/powerpc   | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/powerpc.e500  | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/sparc | 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/sparc.leon| 0
 toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/x86_64| 0
 24 files changed, 3 insertions(+), 1 deletion(-)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/arm (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/armeb (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/common (99%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/debug (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/i386 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/i686 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/m68k (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64.32 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64.64 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64.n32 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el.32 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el.64 (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mips64el.n32 
(100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mipsel (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/mipsel.cobalt 
(100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/powerpc (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/powerpc.e500 
(100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/sparc (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/sparc.leon (100%)
 rename toolchain/uClibc/{config-ng-1.0.6 => config-ng-1.0.8}/x86_64 (100%)

diff --git a/toolchain/uClibc/Config.version b/toolchain/uClibc/Config.version
index b6aa471..7210626 100644
--- a/toolchain/uClibc/Config.version
+++ b/toolchain/uClibc/Config.version
@@ -2,7 +2,7 @@ config UCLIBC_VERSION
string
depends on USE_UCLIBC
default "0.9.33.2"   if UCLIBC_VERSION_0_9_33
-   default "1.0.6"  if UCLIBC_VERSION_NG
+   default "1.0.8"  if UCLIBC_VERSION_NG
default "0.9.33.2"
 
 config UCLIBC_VERSION_0_9_33
diff --git a/toolchain/uClibc/config-ng-1.0.6/arm 
b/toolchain/uClibc/config-ng-1.0.8/arm
similarity index 100%
rename from toolchain/uClibc/config-ng-1.0.6/arm
rename to toolchain/uClibc/config-ng-1.0.8/arm
diff --git a/toolchain/uClibc/config-ng-1.0.6/armeb 
b/toolchain/uClibc/config-ng-1.0.8/

Re: [OpenWrt-Devel] [PATCH v2] include/kernel.mk - better search for ARCH

2015-11-02 Thread Alexey Brodkin
Hi Felix,

On Thu, 2015-07-30 at 14:12 +0300, Alexey Brodkin wrote:
> If "findstring" is used without leading and trailing spaces unexpected matches
> may happen. For example consider ARC=arc then "findstring $(ARCH)" will
> report a false match with "aarch64".
> 
> But "findstring $ARCH " (note trailing space) will correctly skip
> matches for both "aarch64" and "aarch64_be".
> 
> This patch is built-tested against NetGear WNDR3800.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Felix Fietkau 
> Cc: Jo-Philipp Wich 
> ---
> 
> In v2 removed unncecessary space before findstring.
> 
>  include/kernel.mk | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/kernel.mk b/include/kernel.mk
> index 7a0a170..6a613fe 100644
> --- a/include/kernel.mk
> +++ b/include/kernel.mk
> @@ -62,15 +62,15 @@ endif
>  
>  ifneq (,$(findstring uml,$(BOARD)))
>LINUX_KARCH=um
> -else ifneq (,$(findstring $(ARCH), aarch64 aarch64_be))
> +else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be ))
>LINUX_KARCH := arm64
> -else ifneq (,$(findstring $(ARCH), armeb))
> +else ifneq (,$(findstring $(ARCH) , armeb ))
>LINUX_KARCH := arm
> -else ifneq (,$(findstring $(ARCH), mipsel mips64 mips64el))
> +else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
>LINUX_KARCH := mips
> -else ifneq (,$(findstring $(ARCH), sh2 sh3 sh4))
> +else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
>LINUX_KARCH := sh
> -else ifneq (,$(findstring $(ARCH), i386 x86_64))
> +else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
>LINUX_KARCH := x86
>  else
>LINUX_KARCH := $(ARCH)

I'm wondering if there're any comments on this one.
Otherwise please consider applying.

This patch is a prerequisite for ARC port submission I'm going to send out
shortly.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] update config.guess & config.sub

2015-11-02 Thread Alexey Brodkin
Hi Felix,

On Thu, 2015-07-30 at 11:43 +0300, Alexey Brodkin wrote:
> These are from today's master branch of:
> http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree
> 
> In particular it adds support for ARC architecture plus some more
> improvements and fixes.
> 
> This patch is built-tested against NetGear WNDR3800.
> 
> Signed-off-by: Alexey Brodkin 
> Cc: Florian Fainelli 
> Cc: Imre Kaloz 
> ---
>  scripts/config.guess | 378 
> +++
>  scripts/config.sub   | 150 
>  2 files changed, 238 insertions(+), 290 deletions(-)

I'm wondering if there're any comments on this one.
Otherwise please consider applying.

This patch is a prerequisite for ARC port submission I'm going to send out
shortly.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2 v2] OpenWRT port for Designware ARC cores

2015-11-02 Thread Alexey Brodkin
This series introduces support of DesignWare ARC cores in OpenWRT.
In particular it adds support of 2 boards (nSIM and ARc SDP) based on
ARC770D SoC.

Alexey Brodkin (2):
  toolchain: add support of ARC architecture
  linux: add support of Synopsys ARC770-based boards

 include/kernel.mk  |   2 +
 include/site/arc   |  30 +++
 include/target.mk  |   4 +
 target/Config.in   |   9 +
 target/linux/arc770/Makefile   |  26 +++
 target/linux/arc770/base-files.mk  |   3 +
 target/linux/arc770/base-files/etc/config/network  |  18 ++
 target/linux/arc770/base-files/etc/inittab |   4 +
 .../arc770/base-files/etc/uci-defaults/02_network  |  22 ++
 target/linux/arc770/base-files/lib/arc.sh  |  73 ++
 .../base-files/lib/preinit/01_preinit_arc.sh   |  10 +
 target/linux/arc770/config-4.3 | 142 
 target/linux/arc770/dts/axc001.dtsi| 100 
 target/linux/arc770/dts/axs101.dts |  21 ++
 target/linux/arc770/dts/axs10x_mb.dtsi | 224 ++
 target/linux/arc770/dts/nsim_700.dts   |  70 ++
 target/linux/arc770/dts/skeleton.dtsi  |  37 +++
 target/linux/arc770/generic/profiles/00-default.mk |  16 ++
 target/linux/arc770/generic/profiles/01-minimal.mk |  15 ++
 target/linux/arc770/generic/profiles/02-axs101.mk  |  17 ++
 .../linux/arc770/generic/profiles/03-nsim_700.mk   |  16 ++
 target/linux/arc770/generic/target.mk  |   8 +
 target/linux/arc770/image/Makefile |  42 
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +++
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  91 
 toolchain/Config.in|  10 +-
 toolchain/binutils/Config.in   |  23 +-
 toolchain/binutils/Config.version  |  17 ++
 toolchain/binutils/Makefile|  29 ++-
 toolchain/gcc/Config.in|   9 +
 toolchain/gcc/Config.version   |   9 +-
 toolchain/gcc/common.mk|  31 ++-
 .../001-revert_register_mode_search.patch  |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch|  42 
 .../arc-2015.06/003-universal_initializer.patch|  94 
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
 .../patches/arc-2015.06/010-documentation.patch|  23 ++
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
 .../210-disable_libsanitizer_off_t_check.patch |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch   |  18 ++
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
 .../arc-2015.06/850-use_shared_libgcc.patch|  47 
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +
 .../arc-2015.06/920-specs_nonfatal_getenv.patch|  14 ++
 .../arc-2015.06/940-no-clobber-stamp-bits.patch|  11 +
 toolchain/gdb/Makefile |  19 +-
 toolchain/uClibc/Config.in |   2 +
 toolchain/uClibc/Config.version|   3 +-
 toolchain/uClibc/common.mk |   1 +
 toolchain/uClibc/config-ng-1.0.8/arc   |  11 +
 55 files changed, 1932 insertions(+), 33 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 target/linux/arc770/Makefile
 create mode 100644 target/linux/arc770/base-files.mk
 create mode 100644 target/linux/arc770/base-files/etc/config/network
 create mode 100644 target/linux/arc770/base-files/etc/inittab
 create mode 100644 target/linux/arc770/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/arc770/base-files/lib/arc.sh
 create mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/dts/axc001.dtsi
 create mode 100644 target/linux/arc770/dts/axs101.dts
 create mode 100644 target/linux/arc770/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/arc770/dts/nsim_700.dts
 create mode 100644 target/linux/arc770/dts/skeleton.dtsi
 create mode 100644 target/linux/arc770/generic/profiles/00-default.mk
 create mode 100644 target/linux/arc770/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/arc770/generic/profiles/02-axs101.mk
 create mode 100644 target/linux/arc770/generic/profiles/03-nsim_700.mk
 create mode 100644 target/linux/arc770/generic/target.mk
 create mode 100644 target/linux/arc770/image/Makefile
 create mode

[OpenWrt-Devel] [PATCH 1/2 v2] toolchain: add support of ARC architecture

2015-11-02 Thread Alexey Brodkin
This includes binutils, gcc, gdb and uClibc-ng.

Latest release of ARC gcc (as of today it is "arc-2015.06")
is based on upstream gcc 4.8.4.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc

Latest release of ARC binutils (as of today it is "arc-2015.06")
is based on upstream binutils 2.23.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06

Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
is based on upstream gdb 7.9.1.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb

Note that for binutils and gdb that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of gdb in binutils and binutils in gdb hence in binutils:
-->8--
--disable-sim
--disable-gdb
-->8--

and in gdb:
-->8--
--disable-binutils
--disable-ld
--disable-gas
-->8--

Also in gdb we disable sim because if the following breakage while
building with it:
>8
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
-mono -fast -pbb -switch sem5-switch.c \
-cpu a5f -infile ./mloop5.in \
-outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
>8

Prerequisites are:
 [1] http://patchwork.ozlabs.org/patch/539068/ which bumps uClibc-ng version
 from 1.0.6 to 1.0.8
 [2] http://patchwork.ozlabs.org/patch/502022 which updates config.guess
 and config.sub

Cc: Felix Fietkau 
Cc: John Crispin 
Signed-off-by: Alexey Brodkin 
---

Changes compared to v1:
 * Binutils Kconfig description is now similar to Gcc and uClibc.
   This allows selection of different versions of binutils.

 * CONFIG_BINUTILS_VERSION_2_23_ARC is used for deciding if we need to
   obtain ARC's binutils.

 * Rebased on current master

 include/site/arc   |  30 +++
 include/target.mk  |   4 +
 toolchain/Config.in|  10 +-
 toolchain/binutils/Config.in   |  23 +-
 toolchain/binutils/Config.version  |  17 ++
 toolchain/binutils/Makefile|  29 ++-
 toolchain/gcc/Config.in|   9 +
 toolchain/gcc/Config.version   |   9 +-
 toolchain/gcc/common.mk|  31 ++-
 .../001-revert_register_mode_search.patch  |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch|  42 
 .../arc-2015.06/003-universal_initializer.patch|  94 
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
 .../patches/arc-2015.06/010-documentation.patch|  23 ++
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
 .../210-disable_libsanitizer_off_t_check.patch |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch   |  18 ++
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
 .../arc-2015.06/850-use_shared_libgcc.patch|  47 
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +
 .../arc-2015.06/920-specs_nonfatal_getenv.patch|  14 ++
 .../arc-2015.06/940-no-clobber-stamp-bits.patch|  11 +
 toolchain/gdb/Makefile |  19 +-
 toolchain/uClibc/Config.in |   2 +
 toolchain/uClibc/Config.version|   3 +-
 toolchain/uClibc/common.mk |   1 +
 toolchain/uClibc/config-ng-1.0.8/arc   |  11 +
 32 files changed, 930 insertions(+), 33 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 toolchain/binutils/Config.version
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/010-documentation.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/800-arc-dis

[OpenWrt-Devel] [PATCH 2/2 v2] linux: add support of Synopsys ARC770-based boards

2015-11-02 Thread Alexey Brodkin
This patch introduces support of new boards with ARC cores.

 [1] Synopsys SDP board
 This is a new-generation development board from Synopsys that
 consists of base-board and CPU tile-board (which might have a real
 ASIC or FPGA with CPU image).
 It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
 etc and is intended to be used for early development of ARC-based
 products.

 [2] nSIM
 This is a virtual board implemented in Synopsys proprietary
 software simulator (even though available for free for open source
 community). This board has only serial port as a peripheral and so
 it is meant to be used for runtime testing which is especially
 useful during bring-up of new tools and platforms.
 What's also important ARC cores are very configurable so there're
 many variations of options like cache sizes, their line lengths,
 additional hardware blocks like multipliers, dividers etc. And this
 board could be used to make sure built software still runs on
 different HW configurations.

Note there's a prerequisite http://patchwork.ozlabs.org/patch/502081/

Prerequisites are:
 [1] http://patchwork.ozlabs.org/patch/502081/ which allows proper
 selection of ARC architecture for building Linux kernel.

Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Signed-off-by: Alexey Brodkin 
---

Changes compared to v1:
 * Switched to SoC-centered design. Now instead of common ARC700
   support we claim support of boards based on ARC770D.
   This allows to use the same one build of kernel binary for both
   boards.

 * Implemented run-time scripts that parse Device Tree compatible
   tag and according to it do configuration of serial port and network.

 * Implemented ability to patch in built Linux kernel external .dtb

 * Linux kernel switched from 4.1 to 4.3

 * Rebased on current master

 include/kernel.mk  |   2 +
 target/Config.in   |   9 +
 target/linux/arc770/Makefile   |  26 +++
 target/linux/arc770/base-files.mk  |   3 +
 target/linux/arc770/base-files/etc/config/network  |  18 ++
 target/linux/arc770/base-files/etc/inittab |   4 +
 .../arc770/base-files/etc/uci-defaults/02_network  |  22 ++
 target/linux/arc770/base-files/lib/arc.sh  |  73 +++
 .../base-files/lib/preinit/01_preinit_arc.sh   |  10 +
 target/linux/arc770/config-4.3 | 142 +
 target/linux/arc770/dts/axc001.dtsi| 100 +
 target/linux/arc770/dts/axs101.dts |  21 ++
 target/linux/arc770/dts/axs10x_mb.dtsi | 224 +
 target/linux/arc770/dts/nsim_700.dts   |  70 +++
 target/linux/arc770/dts/skeleton.dtsi  |  37 
 target/linux/arc770/generic/profiles/00-default.mk |  16 ++
 target/linux/arc770/generic/profiles/01-minimal.mk |  15 ++
 target/linux/arc770/generic/profiles/02-axs101.mk  |  17 ++
 .../linux/arc770/generic/profiles/03-nsim_700.mk   |  16 ++
 target/linux/arc770/generic/target.mk  |   8 +
 target/linux/arc770/image/Makefile |  42 
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  91 +
 23 files changed, 1002 insertions(+)
 create mode 100644 target/linux/arc770/Makefile
 create mode 100644 target/linux/arc770/base-files.mk
 create mode 100644 target/linux/arc770/base-files/etc/config/network
 create mode 100644 target/linux/arc770/base-files/etc/inittab
 create mode 100644 target/linux/arc770/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/arc770/base-files/lib/arc.sh
 create mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/dts/axc001.dtsi
 create mode 100644 target/linux/arc770/dts/axs101.dts
 create mode 100644 target/linux/arc770/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/arc770/dts/nsim_700.dts
 create mode 100644 target/linux/arc770/dts/skeleton.dtsi
 create mode 100644 target/linux/arc770/generic/profiles/00-default.mk
 create mode 100644 target/linux/arc770/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/arc770/generic/profiles/02-axs101.mk
 create mode 100644 target/linux/arc770/generic/profiles/03-nsim_700.mk
 create mode 100644 target/linux/arc770/generic/target.mk
 create mode 100644 target/linux/arc770/image/Makefile
 create mode 100644 
target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/arc770/patches-4.3/0002-openwrt-arc-add-OWRTDTB-section.patch

diff --git a/include/kernel.mk b/include/kernel.mk
index 6a613fe..878a366 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -64,6 +64,8 @@ ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
 else ifneq

Re: [OpenWrt-Devel] [PATCH 1/2 v2] toolchain: add support of ARC architecture

2015-11-02 Thread Alexey Brodkin
Hi Felix,

On Mon, 2015-11-02 at 19:15 +0100, Felix Fietkau wrote:
> On 2015-11-02 19:05, Alexey Brodkin wrote:
> > This includes binutils, gcc, gdb and uClibc-ng.
> > 
> > Latest release of ARC gcc (as of today it is "arc-2015.06")
> > is based on upstream gcc 4.8.4.
> > 
> > Sources are available on GitHub, see:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/gcc
> > 
> > Latest release of ARC binutils (as of today it is "arc-2015.06")
> > is based on upstream binutils 2.23.
> > 
> > Sources are available on GitHub, see:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06
> > 
> > Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
> > is based on upstream gdb 7.9.1.
> > 
> > Sources are available on GitHub, see:
> > https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb
> > 
> > Note that for binutils and gdb that come from unified git repository
> > (which is the case for upstream binutils/gdb today) we need to disable
> > building of gdb in binutils and binutils in gdb hence in binutils:
> > -->8--
> > --disable-sim
> > --disable-gdb
> > -->8--
> > 
> > and in gdb:
> > -->8--
> > --disable-binutils
> > --disable-ld
> > --disable-gas
> > -->8--
> > 
> > Also in gdb we disable sim because if the following breakage while
> > building with it:
> > >8
> > /usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
> > -mono -fast -pbb -switch sem5-switch.c \
> > -cpu a5f -infile ./mloop5.in \
> > -outfile-suffix 5
> > unknown option: bash
> > Makefile:699: recipe for target 'stamp-5mloop' failed
> > make[7]: *** [stamp-5mloop] Error 1
> > -------->8
> > 
> > Prerequisites are:
> >  [1] http://patchwork.ozlabs.org/patch/539068/ which bumps uClibc-ng version
> >  from 1.0.6 to 1.0.8
> >  [2] http://patchwork.ozlabs.org/patch/502022 which updates config.guess
> >  and config.sub
> > 
> > Cc: Felix Fietkau 
> > Cc: John Crispin 
> > Signed-off-by: Alexey Brodkin 
> This patch will have to be rebased, since I just made some changes to
> get rid of the old uClibc version. I also removed version configuration,
> and the version suffix of the config directory.

Thanks for letting me know.
I'll do this shortly.

In the meantime would be good if people comments on this v2 series so I may do 
required
changes in v3 as well.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2 v3] OpenWRT port for Designware ARC cores

2015-11-02 Thread Alexey Brodkin
This series introduces support of DesignWare ARC cores in OpenWRT.
In particular it adds support of 2 boards (nSIM and ARc SDP) based on
ARC770D SoC.

This is the same as v2 but rebased on top of the current master.
In particular that commit touches uClibc files:
http://git.openwrt.org/?p=openwrt.git;a=commit;h=b70a36d1d969f5aa9ad081c9a395633793582a5a

Alexey Brodkin (2):
  toolchain: add support of ARC architecture
  linux: add support of Synopsys ARC770-based boards

 include/kernel.mk  |   2 +
 include/site/arc   |  30 +++
 include/target.mk  |   4 +
 target/Config.in   |   9 +
 target/linux/arc770/Makefile   |  26 +++
 target/linux/arc770/base-files/etc/inittab |   4 +
 .../arc770/base-files/etc/uci-defaults/02_network  |  23 ++
 target/linux/arc770/base-files/lib/arc.sh  |  76 +++
 .../base-files/lib/preinit/01_preinit_arc.sh   |  10 +
 target/linux/arc770/config-4.3 | 142 
 target/linux/arc770/dts/axc001.dtsi| 100 
 target/linux/arc770/dts/axs101.dts |  21 ++
 target/linux/arc770/dts/axs10x_mb.dtsi | 224 ++
 target/linux/arc770/dts/nsim_700.dts   |  70 ++
 target/linux/arc770/dts/skeleton.dtsi  |  37 +++
 target/linux/arc770/generic/profiles/00-default.mk |  16 ++
 target/linux/arc770/generic/profiles/01-minimal.mk |  15 ++
 target/linux/arc770/generic/profiles/02-axs101.mk  |  17 ++
 .../linux/arc770/generic/profiles/03-nsim_700.mk   |  16 ++
 target/linux/arc770/generic/target.mk  |   8 +
 target/linux/arc770/image/Makefile |  42 
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 +++
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  91 
 toolchain/Config.in|   9 +-
 toolchain/binutils/Config.in   |  23 +-
 toolchain/binutils/Config.version  |  17 ++
 toolchain/binutils/Makefile|  29 ++-
 toolchain/gcc/Config.in|   9 +
 toolchain/gcc/Config.version   |   9 +-
 toolchain/gcc/common.mk|  31 ++-
 .../001-revert_register_mode_search.patch  |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch|  42 
 .../arc-2015.06/003-universal_initializer.patch|  94 
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
 .../patches/arc-2015.06/010-documentation.patch|  23 ++
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
 .../210-disable_libsanitizer_off_t_check.patch |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch   |  18 ++
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
 .../arc-2015.06/850-use_shared_libgcc.patch|  47 
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +
 .../arc-2015.06/920-specs_nonfatal_getenv.patch|  14 ++
 .../arc-2015.06/940-no-clobber-stamp-bits.patch|  11 +
 toolchain/gdb/Makefile |  19 +-
 toolchain/uClibc/Config.version|   1 +
 toolchain/uClibc/common.mk |   1 +
 toolchain/uClibc/config/arc|  11 +
 52 files changed, 1912 insertions(+), 31 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 target/linux/arc770/Makefile
 create mode 100644 target/linux/arc770/base-files/etc/inittab
 create mode 100644 target/linux/arc770/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/arc770/base-files/lib/arc.sh
 create mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/dts/axc001.dtsi
 create mode 100644 target/linux/arc770/dts/axs101.dts
 create mode 100644 target/linux/arc770/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/arc770/dts/nsim_700.dts
 create mode 100644 target/linux/arc770/dts/skeleton.dtsi
 create mode 100644 target/linux/arc770/generic/profiles/00-default.mk
 create mode 100644 target/linux/arc770/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/arc770/generic/profiles/02-axs101.mk
 create mode 100644 target/linux/arc770/generic/profiles/03-nsim_700.mk
 create mode 100644 target/linux/arc770/generic/target.mk
 create mode 100644 target/linux/arc770/image/Makefile
 create mode 100644 
target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create

[OpenWrt-Devel] [PATCH 1/2 v3] toolchain: add support of ARC architecture

2015-11-02 Thread Alexey Brodkin
This includes binutils, gcc, gdb and uClibc-ng.

Latest release of ARC gcc (as of today it is "arc-2015.06")
is based on upstream gcc 4.8.4.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc

Latest release of ARC binutils (as of today it is "arc-2015.06")
is based on upstream binutils 2.23.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06

Latest release of ARC GDB (as of today this is "arc-2015.06-gdb")
is based on upstream gdb 7.9.1.

Sources are available on GitHub, see:
https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/releases/tag/arc-2015.06-gdb

Note that for binutils and gdb that come from unified git repository
(which is the case for upstream binutils/gdb today) we need to disable
building of gdb in binutils and binutils in gdb hence in binutils:
-->8--
--disable-sim
--disable-gdb
-->8--

and in gdb:
-->8--
--disable-binutils
--disable-ld
--disable-gas
-->8--

Also in gdb we disable sim because if the following breakage while
building with it:
>8
/usr/bin/env bash ./../common/genmloop.sh -shell /usr/bin/env bash \
-mono -fast -pbb -switch sem5-switch.c \
-cpu a5f -infile ./mloop5.in \
-outfile-suffix 5
unknown option: bash
Makefile:699: recipe for target 'stamp-5mloop' failed
make[7]: *** [stamp-5mloop] Error 1
>8

Cc: Felix Fietkau 
Cc: John Crispin 
Signed-off-by: Alexey Brodkin 
---

Changes compared to v2:
 * Rebased on top of the current master.
   In particular that commit touches uClibc files:
   
http://git.openwrt.org/?p=openwrt.git;a=commit;h=b70a36d1d969f5aa9ad081c9a395633793582a5a

Changes compared to v1:
 * Binutils Kconfig description is now similar to Gcc and uClibc.
   This allows selection of different versions of binutils.

 * CONFIG_BINUTILS_VERSION_2_23_ARC is used for deciding if we need to
   obtain ARC's binutils.

 * Rebased on current master

 include/site/arc   |  30 +++
 include/target.mk  |   4 +
 toolchain/Config.in|   9 +-
 toolchain/binutils/Config.in   |  23 +-
 toolchain/binutils/Config.version  |  17 ++
 toolchain/binutils/Makefile|  29 ++-
 toolchain/gcc/Config.in|   9 +
 toolchain/gcc/Config.version   |   9 +-
 toolchain/gcc/common.mk|  31 ++-
 .../001-revert_register_mode_search.patch  |  65 ++
 .../patches/arc-2015.06/002-weak_data_fix.patch|  42 
 .../arc-2015.06/003-universal_initializer.patch|  94 
 .../patches/arc-2015.06/004-case_insensitive.patch |  14 ++
 .../patches/arc-2015.06/010-documentation.patch|  23 ++
 .../patches/arc-2015.06/020-no-plt-backport.patch  |  28 +++
 .../gcc/patches/arc-2015.06/100-uclibc-conf.patch  |  33 +++
 .../210-disable_libsanitizer_off_t_check.patch |  11 +
 .../arc-2015.06/800-arc-disablelibgmon.patch   |  18 ++
 .../gcc/patches/arc-2015.06/820-libgcc_pic.patch   |  36 +++
 .../arc-2015.06/850-use_shared_libgcc.patch|  47 
 .../patches/arc-2015.06/851-libgcc_no_compat.patch |  12 +
 .../gcc/patches/arc-2015.06/860-use_eh_frame.patch |  42 
 .../patches/arc-2015.06/870-ppc_no_crtsavres.patch |  11 +
 .../patches/arc-2015.06/880-no_java_section.patch  |  11 +
 .../gcc/patches/arc-2015.06/910-mbsd_multi.patch   | 253 +
 .../arc-2015.06/920-specs_nonfatal_getenv.patch|  14 ++
 .../arc-2015.06/940-no-clobber-stamp-bits.patch|  11 +
 toolchain/gdb/Makefile |  19 +-
 toolchain/uClibc/Config.version|   1 +
 toolchain/uClibc/common.mk |   1 +
 toolchain/uClibc/config/arc|  11 +
 31 files changed, 927 insertions(+), 31 deletions(-)
 create mode 100644 include/site/arc
 create mode 100644 toolchain/binutils/Config.version
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/001-revert_register_mode_search.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/002-weak_data_fix.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/003-universal_initializer.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/004-case_insensitive.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/010-documentation.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/020-no-plt-backport.patch
 create mode 100644 toolchain/gcc/patches/arc-2015.06/100-uclibc-conf.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/210-disable_libsanitizer_off_t_check.patch
 create mode 100644 
toolchain/gcc/patches/arc-2015.06/800-arc-disablelibgmon.patch
 create mode 100644 toolchain/gcc/patches/arc-

[OpenWrt-Devel] [PATCH 2/2 v3] linux: add support of Synopsys ARC770-based boards

2015-11-02 Thread Alexey Brodkin
This patch introduces support of new boards with ARC cores.

 [1] Synopsys SDP board
 This is a new-generation development board from Synopsys that
 consists of base-board and CPU tile-board (which might have a real
 ASIC or FPGA with CPU image).
 It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
 etc and is intended to be used for early development of ARC-based
 products.

 [2] nSIM
 This is a virtual board implemented in Synopsys proprietary
 software simulator (even though available for free for open source
 community). This board has only serial port as a peripheral and so
 it is meant to be used for runtime testing which is especially
 useful during bring-up of new tools and platforms.
 What's also important ARC cores are very configurable so there're
 many variations of options like cache sizes, their line lengths,
 additional hardware blocks like multipliers, dividers etc. And this
 board could be used to make sure built software still runs on
 different HW configurations.

Cc: Felix Fietkau 
Cc: Jo-Philipp Wich 
Signed-off-by: Alexey Brodkin 
---

Changes compared to v2:
 * Fixed copyright dates
 * Cleaned-up init scripts

Changes compared to v1:
 * Switched to SoC-centered design. Now instead of common ARC700
   support we claim support of boards based on ARC770D.
   This allows to use the same one build of kernel binary for both
   boards.

 * Implemented run-time scripts that parse Device Tree compatible
   tag and according to it do configuration of serial port and network.

 * Implemented ability to patch in built Linux kernel external .dtb

 * Linux kernel switched from 4.1 to 4.3

 * Rebased on current master

 include/kernel.mk  |   2 +
 target/Config.in   |   9 +
 target/linux/arc770/Makefile   |  26 +++
 target/linux/arc770/base-files/etc/inittab |   4 +
 .../arc770/base-files/etc/uci-defaults/02_network  |  23 +++
 target/linux/arc770/base-files/lib/arc.sh  |  76 +++
 .../base-files/lib/preinit/01_preinit_arc.sh   |  10 +
 target/linux/arc770/config-4.3 | 142 +
 target/linux/arc770/dts/axc001.dtsi| 100 +
 target/linux/arc770/dts/axs101.dts |  21 ++
 target/linux/arc770/dts/axs10x_mb.dtsi | 224 +
 target/linux/arc770/dts/nsim_700.dts   |  70 +++
 target/linux/arc770/dts/skeleton.dtsi  |  37 
 target/linux/arc770/generic/profiles/00-default.mk |  16 ++
 target/linux/arc770/generic/profiles/01-minimal.mk |  15 ++
 target/linux/arc770/generic/profiles/02-axs101.mk  |  17 ++
 .../linux/arc770/generic/profiles/03-nsim_700.mk   |  16 ++
 target/linux/arc770/generic/target.mk  |   8 +
 target/linux/arc770/image/Makefile |  42 
 ...openwrt-arc-remove-dependency-on-DEVTMPFS.patch |  36 
 .../0002-openwrt-arc-add-OWRTDTB-section.patch |  91 +
 21 files changed, 985 insertions(+)
 create mode 100644 target/linux/arc770/Makefile
 create mode 100644 target/linux/arc770/base-files/etc/inittab
 create mode 100644 target/linux/arc770/base-files/etc/uci-defaults/02_network
 create mode 100644 target/linux/arc770/base-files/lib/arc.sh
 create mode 100644 target/linux/arc770/base-files/lib/preinit/01_preinit_arc.sh
 create mode 100644 target/linux/arc770/config-4.3
 create mode 100644 target/linux/arc770/dts/axc001.dtsi
 create mode 100644 target/linux/arc770/dts/axs101.dts
 create mode 100644 target/linux/arc770/dts/axs10x_mb.dtsi
 create mode 100644 target/linux/arc770/dts/nsim_700.dts
 create mode 100644 target/linux/arc770/dts/skeleton.dtsi
 create mode 100644 target/linux/arc770/generic/profiles/00-default.mk
 create mode 100644 target/linux/arc770/generic/profiles/01-minimal.mk
 create mode 100644 target/linux/arc770/generic/profiles/02-axs101.mk
 create mode 100644 target/linux/arc770/generic/profiles/03-nsim_700.mk
 create mode 100644 target/linux/arc770/generic/target.mk
 create mode 100644 target/linux/arc770/image/Makefile
 create mode 100644 
target/linux/arc770/patches-4.3/0001-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
 create mode 100644 
target/linux/arc770/patches-4.3/0002-openwrt-arc-add-OWRTDTB-section.patch

diff --git a/include/kernel.mk b/include/kernel.mk
index 6a613fe..878a366 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -64,6 +64,8 @@ ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
 else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be ))
   LINUX_KARCH := arm64
+else ifneq (,$(findstring $(ARCH) , arceb ))
+  LINUX_KARCH := arc
 else ifneq (,$(findstring $(ARCH) , armeb ))
   LINUX_KARCH := arm
 else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
diff --git a/target/Config.in b/target/Config.in
index baae8d6..571b06e 100644
--- a/target/Config.in
+++ b/target/Config.in

Re: [OpenWrt-Devel] [PATCH 2/2 v3] linux: add support of Synopsys ARC770-based boards

2015-11-03 Thread Alexey Brodkin
Hi Felix,

On Tue, 2015-11-03 at 08:43 +0100, Felix Fietkau wrote:
> On 2015-11-03 00:27, Alexey Brodkin wrote:
> > This patch introduces support of new boards with ARC cores.

[snip]

> > diff --git a/include/kernel.mk b/include/kernel.mk
> > index 6a613fe..878a366 100644
> > --- a/include/kernel.mk
> > +++ b/include/kernel.mk
> > @@ -64,6 +64,8 @@ ifneq (,$(findstring uml,$(BOARD)))
> >LINUX_KARCH=um
> >  else ifneq (,$(findstring $(ARCH) , aarch64 aarch64_be ))
> >LINUX_KARCH := arm64
> > +else ifneq (,$(findstring $(ARCH) , arceb ))
> > +  LINUX_KARCH := arc
> >  else ifneq (,$(findstring $(ARCH) , armeb ))
> >LINUX_KARCH := arm
> >  else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
> > diff --git a/target/Config.in b/target/Config.in
> > index baae8d6..571b06e 100644
> > --- a/target/Config.in
> > +++ b/target/Config.in
> > @@ -100,6 +100,13 @@ config aarch64_be
> > select BIG_ENDIAN
> > bool
> >  
> > +config arc
> > +   bool
> > +
> > +config arceb
> > +   select BIG_ENDIAN
> > +   bool
> > +
> >  config arm
> > bool
> >  
> > @@ -179,6 +186,8 @@ config ARCH
> > string
> > default "aarch64"   if aarch64
> > default "aarch64_be" if aarch64_be
> > +   default "arc"   if arc
> > +   default "arceb" if arceb
> > default "arm"   if arm
> > default "armeb" if armeb
> > default "i386"  if i386
> Minor nitpick: The above parts should be folded into the previous patch.

Ok, will move it in toolchain patch.

> > diff --git a/target/linux/arc770/config-4.3 b/target/linux/arc770/config-4.3
> > new file mode 100644
> > index 000..aba6908
> > --- /dev/null
> > +++ b/target/linux/arc770/config-4.3
> > @@ -0,0 +1,142 @@
> > +#
> > +# ARC Architecture Configuration
> > +#
> > +CONFIG_ARC=y
> > +
> [...]
> Please run make kernel_oldconfig to refresh the target kernel config.
> This file is not meant to be hand-written. If you want to make changes
> to it, you can use make kernel_menuconfig.

Ok will do that too.

> > diff --git a/target/linux/arc770/image/Makefile 
> > b/target/linux/arc770/image/Makefile
> > --- /dev/null
> > +++ b/target/linux/arc770/image/Makefile
> > @@ -0,0 +1,42 @@
> > +#
> > +# Copyright (C) 2015 OpenWrt.org
> > +#
> > +# This is free software, licensed under the GNU General Public License v2.
> > +# See /LICENSE for more information.
> > +#
> > +include $(TOPDIR)/rules.mk
> > +include $(INCLUDE_DIR)/image.mk
> > +
> > +Image/Build/Initramfs=$(call Image/Build/Profile/$(PROFILE),initramfs)
> > +
> > +# $(1), lowercase board name like "axs101"
> > +# $(2), DTS filename without .dts extension
> > +# $(3), optional filename suffix, e.g. "-initramfs"
> > +define PatchKernelDtb
> > +   cp $(KDIR)/vmlinux$(3).elf $(KDIR)/vmlinux-$(1)$(3).elf
> > +   $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(2).dtb ../dts/$(2).dts
> > +   $(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1)$(3).elf 
> > $(KDIR)/$(2).dtb
> > +endef
> > +
> > +# $(1), lowercase board name
> > +# $(2), DTS filename without .dts extension
> > +# $(3), optional filename suffix, e.g. "-initramfs"
> > +MkImageDtb=$(call PatchKernelDtb,$(1),$(2),$(3))
> > +
> > +# $(1), squashfs/initramfs
> > +# $(2), lowercase board name
> > +# $(3), DTS filename without .dts extension
> > +BuildFirmware/OF/initramfs=$(call MkImageDtb,$(2),$(3),-initramfs)
> > +
> > +BuildFirmware/axs101/initramfs=$(call 
> > BuildFirmware/OF/initramfs,$(1),axs101,axs101)
> > +BuildFirmware/nsim_700/initramfs=$(call 
> > BuildFirmware/OF/initramfs,$(1),nsim_700,nsim_700)
> > +
> > +Image/Build/Profile/axs101=$(call BuildFirmware/axs101/$(1),$(1))
> > +Image/Build/Profile/nsim_700=$(call BuildFirmware/nsim_700/$(1),$(1))
> > +
> > +define Image/Build/Profile/Default
> > +   $(call Image/Build/Profile/axs101,$(1))
> > +   $(call Image/Build/Profile/nsim_700,$(1))
> > +endef
> > +
> > +$(eval $(call BuildImage))
> Please use the new image building code instead. You can find examples in
> the bcm53xx image Makefile.

Could you please elaborate a little bit why this is necessary?
IMHO my current implementation is quite clean and understandable.
What is also important it allows for more flexibility.

For example I may deal with vmlinux.elf instead of objcopied vmlinux
(which doesn't include elf header any longer) etc.

Moreover bcm53xx has no profiles so it's hard for me to figure out how to deal 
with
profiles properly with this new build code.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2 v3] linux: add support of Synopsys ARC770-based boards

2015-11-04 Thread Alexey Brodkin
Hi Jonas,

On Wed, 2015-11-04 at 13:06 +0100, Jonas Gorski wrote:
> Hi,
> 
> On Tue, Nov 3, 2015 at 12:27 AM, Alexey Brodkin
>  wrote:

> > This patch introduces support of new boards with ARC cores.
> > 
> >  [1] Synopsys SDP board
> >  This is a new-generation development board from Synopsys that
> >  consists of base-board and CPU tile-board (which might have a real
> >  ASIC or FPGA with CPU image).
> >  It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C
> >  etc and is intended to be used for early development of ARC-based
> >  products.
> > 
> >  [2] nSIM
> >  This is a virtual board implemented in Synopsys proprietary
> >  software simulator (even though available for free for open source
> >  community). This board has only serial port as a peripheral and so
> >  it is meant to be used for runtime testing which is especially
> >  useful during bring-up of new tools and platforms.
> >  What's also important ARC cores are very configurable so there're
> >  many variations of options like cache sizes, their line lengths,
> >  additional hardware blocks like multipliers, dividers etc. And this
> >  board could be used to make sure built software still runs on
> >  different HW configurations.
> > 
> > Cc: Felix Fietkau 
> > Cc: Jo-Philipp Wich 
> > Signed-off-by: Alexey Brodkin 
> > ---
> > diff --git a/target/linux/arc770/base-files/etc/uci-defaults/02_network 
> > b/target/linux/arc770/base-files/etc/uci
> > -defaults/02_network
> > new file mode 100644
> > index 000..7db8451
> > --- /dev/null
> > +++ b/target/linux/arc770/base-files/etc/uci-defaults/02_network
> > @@ -0,0 +1,23 @@
> > +#!/bin/sh
> > +#
> > +# Copyright (C) 2015 OpenWrt.org
> > +#
> > +
> > +[ -e /etc/config/network ] && exit 0
> > +
> > +touch /etc/config/network
> > +
> > +. /lib/arc.sh
> > +. /lib/functions/uci-defaults.sh
> > +
> > +ucidef_set_interface_loopback
> > +
> > +case "$( arc_board_name )" in
> > +"arc-sdp"*)
> > +   ucidef_set_interface_wan "eth0"
> 
> If you only have one interface at all, it is usually better to make it
> lan/dhcp, else default firewall rules will prevent you from logging in
> through http/ssh. You can either borrow kirkwoods set_lan_dhcp (and
> maybe move that with a better name to base-files), or use
> ucidef_set_interface_raw to configure it appropriately.

Corrrect. I used ucidef_set_interface_wan as a "hack" to get its
settings automatically via DHCP.

So thanks a lot for pointing to better options.
For me ucidef_set_interface_raw looks simpler and cleaner
so I'll go with:
>8--
ucidef_set_interface_raw "lan" "eth0" "dhcp"
>8--
as it is done in realview.

> > +   ;;
> > +esac
> > +
> > +uci commit network
> > +
> > +exit 0
> > diff --git a/target/linux/arc770/base-files/lib/arc.sh 
> > b/target/linux/arc770/base-files/lib/arc.sh
> > new file mode 100644
> > index 000..b15e94b
> > --- /dev/null
> > +++ b/target/linux/arc770/base-files/lib/arc.sh
> > @@ -0,0 +1,76 @@
> > +#!/bin/sh
> > +#
> > +# Copyright (C) 2015 OpenWrt.org
> > +#
> > +
> > +# defaults
> > +ARC_BOARD_NAME="generic"
> > +ARC_BOARD_MODEL="Generic arc board"
> > +
> > +arc_board_detect() {
> > +   local board
> > +   local model
> > +
> > +   [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
> > +
> > +   model="$( cat /proc/device-tree/compatible )"
> > +
> > +   # We cannot just use "model" as it is because in case of SDP board
> 
> ePAPR says your dts root nodes must have a "model" property that
> uniquely identifies the board. I see that is currently missing even in
> upstream, so please fix your dts files. Then you won't need to grep in
> the compatible. On a side node, ePAPR also says that the recommended
> format is the same as compatible but .. *looks at arm* .. apparently
> nobody does that.

Indeed "model" is a required property.
So thanks for that suggestion.

Then we'll have:
>8--
compatible = "snps,arc-sdp";
model = "snps,axs101";
>8--
which looks for sure much better!

Will do this for starters here in OpenWRT and will submit a pat

[OpenWrt-Devel] [PATCH] include/image.mk: use KERNEL_SUFFIX in Device/Build/initramfs

2015-11-05 Thread Alexey Brodkin
In case if we're interested in generation of non-binary images
(for example if we want images to be valid .elfs - and that's what we
want for ARC now) we have to instruct Device/Build/initramfs target to
use input file with some extension (in case of ARC it will be
essentially .elf).

Otherwise default binary vmlinux (without extension) is used and
resulting images then are binaries instead of elfs.

Signed-off-by: Alexey Brodkin 
Cc: Felix Fietkau 
Cc: John Crispin 
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index 43980bc..ea7cf34 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -462,7 +462,7 @@ define Device/Build/initramfs
   $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
cp $$^ $$@
 
-  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_NAME)-initramfs
+  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): 
$(KDIR)/$$(KERNEL_NAME)-initramfs$$(KERNEL_SUFFIX)
@rm -f $$@
$$(call concat_cmd,$$(KERNEL_INITRAMFS))
 endef
-- 
2.4.3
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2 v3] linux: add support of Synopsys ARC770-based boards

2015-11-05 Thread Alexey Brodkin
Hi Jonas,

On Wed, 2015-11-04 at 20:22 +0300, Alexey Brodkin wrote:
> Hi Jonas,
> 
> On Wed, 2015-11-04 at 13:06 +0100, Jonas Gorski wrote:
> > Hi,
> > 
> > On Tue, Nov 3, 2015 at 12:27 AM, Alexey Brodkin
> >  wrote:
> > > +   ;;
> > > +esac
> > > +
> > > +uci commit network
> > > +
> > > +exit 0
> > > diff --git a/target/linux/arc770/base-files/lib/arc.sh 
> > > b/target/linux/arc770/base-files/lib/arc.sh
> > > new file mode 100644
> > > index 000..b15e94b
> > > --- /dev/null
> > > +++ b/target/linux/arc770/base-files/lib/arc.sh
> > > @@ -0,0 +1,76 @@
> > > +#!/bin/sh
> > > +#
> > > +# Copyright (C) 2015 OpenWrt.org
> > > +#
> > > +
> > > +# defaults
> > > +ARC_BOARD_NAME="generic"
> > > +ARC_BOARD_MODEL="Generic arc board"
> > > +
> > > +arc_board_detect() {
> > > +   local board
> > > +   local model
> > > +
> > > +   [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
> > > +
> > > +   model="$( cat /proc/device-tree/compatible )"
> > > +
> > > +   # We cannot just use "model" as it is because in case of SDP board
> > 
> > ePAPR says your dts root nodes must have a "model" property that
> > uniquely identifies the board. I see that is currently missing even in
> > upstream, so please fix your dts files. Then you won't need to grep in
> > the compatible. On a side node, ePAPR also says that the recommended
> > format is the same as compatible but .. *looks at arm* .. apparently
> > nobody does that.
> 
> Indeed "model" is a required property.
> So thanks for that suggestion.
> 
> Then we'll have:
> >8--
> compatible = "snps,arc-sdp";
> model = "snps,axs101";
> >8--
> which looks for sure much better!
> 
> Will do this for starters here in OpenWRT and will submit a patch upstream
> in Linux kernel.

I started to think about it and now I understand why we use complicated
"compatible" value.

This allows us to use multiple platform-specific parts at once.
We use "snps,arc-sdp" here:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/kernel/devtree.c#n35
and "snps,axs101" here:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/plat-axs10x/axs10x.c#n464

In the first case it's not really necessary to use "compatible" node but
it's usage is quite convenient, see we only need to execute this oneliner:
>8--
of_flat_dt_is_compatible(dt_root, "snps,arc-sdp")
>8--

But if we use "model" node instead we'll need to do:
1) of_get_property
2) strcmp

This is a bit longer, still possible solution.

So even though your proposal is very useful and I'm going to discuss it
with Vineet Gupta (ARC Linux maintainer) but if you don't mind I'd go
without that change for this submission. Then if your proposal is implemented
I'll need to rework OpenWRT scripts anyways because newer upstream kernel
will require that.

Are you OK with that?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2 v3] linux: add support of Synopsys ARC770-based boards

2015-11-05 Thread Alexey Brodkin
Hi Jonas,

On Thu, 2015-11-05 at 20:04 +0100, Jonas Gorski wrote:
> Hi Alexey,
> 
> On Thu, Nov 5, 2015 at 7:14 PM, Alexey Brodkin
>  wrote:
> > Hi Jonas,
> > 
> > On Wed, 2015-11-04 at 20:22 +0300, Alexey Brodkin wrote:
> > > Hi Jonas,
> > > 
> > > On Wed, 2015-11-04 at 13:06 +0100, Jonas Gorski wrote:
> > > > Hi,
> > > > 
> > > > On Tue, Nov 3, 2015 at 12:27 AM, Alexey Brodkin
> > > >  wrote:
> > > > > +   ;;
> > > > > +esac
> > > > > +
> > > > > +uci commit network
> > > > > +
> > > > > +exit 0
> > > > > diff --git a/target/linux/arc770/base-files/lib/arc.sh 
> > > > > b/target/linux/arc770/base-files/lib/arc.sh
> > > > > new file mode 100644
> > > > > index 000..b15e94b
> > > > > --- /dev/null
> > > > > +++ b/target/linux/arc770/base-files/lib/arc.sh
> > > > > @@ -0,0 +1,76 @@
> > > > > +#!/bin/sh
> > > > > +#
> > > > > +# Copyright (C) 2015 OpenWrt.org
> > > > > +#
> > > > > +
> > > > > +# defaults
> > > > > +ARC_BOARD_NAME="generic"
> > > > > +ARC_BOARD_MODEL="Generic arc board"
> > > > > +
> > > > > +arc_board_detect() {
> > > > > +   local board
> > > > > +   local model
> > > > > +
> > > > > +   [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
> > > > > +
> > > > > +   model="$( cat /proc/device-tree/compatible )"
> > > > > +
> > > > > +   # We cannot just use "model" as it is because in case of SDP 
> > > > > board
> > > > 
> > > > ePAPR says your dts root nodes must have a "model" property that
> > > > uniquely identifies the board. I see that is currently missing even in
> > > > upstream, so please fix your dts files. Then you won't need to grep in
> > > > the compatible. On a side node, ePAPR also says that the recommended
> > > > format is the same as compatible but .. *looks at arm* .. apparently
> > > > nobody does that.
> > > 
> > > Indeed "model" is a required property.
> > > So thanks for that suggestion.
> > > 
> > > Then we'll have:
> > > >8--
> > > compatible = "snps,arc-sdp";
> > > model = "snps,axs101";
> 
> Grepping through the different arch's dts directories, some arches use
> compatible like model values (e.g. powerpc), some use free text values
> (e.g. arm). Might be something discuss worthy for devicetree ML how
> this spec "violation" should be handled. Especially since the example
> in Documentation/devicetree/usage-model.txt doesn't have one.
> 
> > > >8--
> > > which looks for sure much better!
> > > 
> > > Will do this for starters here in OpenWRT and will submit a patch upstream
> > > in Linux kernel.
> > 
> > I started to think about it and now I understand why we use complicated
> > "compatible" value.
> > 
> > This allows us to use multiple platform-specific parts at once.
> > We use "snps,arc-sdp" here:
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/kernel/devtree.c#n35
> > and "snps,axs101" here:
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arc/plat-axs10x/axs10x.c#n464
> > 
> > In the first case it's not really necessary to use "compatible" node but
> > it's usage is quite convenient, see we only need to execute this oneliner:
> > >8--
> > of_flat_dt_is_compatible(dt_root, "snps,arc-sdp")
> > >8--
> > 
> > But if we use "model" node instead we'll need to do:
> > 1) of_get_property
> > 2) strcmp
> > 
> > This is a bit longer, still possible solution.
> > 
> > So even though your proposal is very useful and I'm going to discuss it
> > with Vineet Gupta (ARC Linux maintainer) but if you don't mind I'd go
> > without that change for this submission. Then if your proposal is 
> > implemented
> > I'll need to rework OpenWRT scripts anyways because newer upstream kernel
> > will require that.
> > 
> > Are you OK with that?
> 
> My suggestion was only for the model detection script part, not to
> modify anything in the kernel (apart from adding a model property to
> the dts files). The kernel should just keep using the compatible
> property as it properly handles multiple compatible names etc, and it
> doesn't need to be unique.

So should I just add "model" property in .dts files in OpenWRT and correct
init scripts? This all without patching kernel itself essentially.

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


  1   2   >