diff mbox

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

Message ID 1440673433-25446-4-git-send-email-abrodkin@synopsys.com
State Changes Requested
Headers show

Commit Message

Alexey Brodkin Aug. 27, 2015, 11:03 a.m. UTC
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 <nbd@openwrt.org>
Cc: Jo-Philipp Wich <jow@openwrt.org>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 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

Comments

John Crispin Aug. 27, 2015, 12:06 p.m. UTC | #1
Hi,

i just skimmed over the patch quickly and ...

On 27/08/2015 13:03, Alexey Brodkin wrote:
> diff --git a/target/linux/arc/axs10x/base-files/etc/config/network b/target/linux/arc/axs10x/base-files/etc/config/network
> new file mode 100644
> index 0000000..1d46510
> --- /dev/null
> +++ b/target/linux/arc/axs10x/base-files/etc/config/network
> @@ -0,0 +1,18 @@
> +config interface 'loopback'
> +        option ifname 'lo'
> +        option proto 'static'
> +        option ipaddr '127.0.0.1'
> +        option netmask '255.0.0.0'
> +
> +config interface 'lan'
> +        option ifname 'eth0'
> +        option type 'bridge'
> +        option proto 'dhcp'
> +
> +config interface 'wan6'
> +        option ifname '@wan'
> +        option proto 'dhcpv6'
> +
> +config globals 'globals'
> +        option ula_prefix 'fdd3:b396:94ac::/48'
> +


adding a network uci file that is custom requires you to also delete the
default one.

please duplicate this file into your target folder
-> target/linux/ramips/base-files.mk

it looks like at least 1 of the patches should also go upstream if not
more than one.

before sending a new series wait for further feedback please.

	John
Jonas Gorski Sept. 2, 2015, 8:32 a.m. UTC | #2
On Thu, Aug 27, 2015 at 1:03 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> 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/
>
> Cc: Felix Fietkau <nbd@openwrt.org>
> Cc: Jo-Philipp Wich <jow@openwrt.org>
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> ---
>  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 0000000..ad252cb
> --- /dev/null
> +++ b/target/linux/arc/Makefile
> @@ -0,0 +1,28 @@
> +#
> +# 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
> +
> +ARCH:=arc
> +BOARD:=arc
> +BOARDNAME:=Synopsys DesignWare
> +CFLAGS:=-Os -pipe -fno-caller-saves -matomic
> +MAINTAINER:=Alexey Brodkin <abrodkin@synopsys.com>
> +SUBTARGETS:=axs10x nsim
> +
> +KERNEL_PATCHVER:=4.1
> +
> +KERNELNAME:=vmlinux
> +
> +DEVICE_TYPE:=developerboard
> +
> +include $(INCLUDE_DIR)/target.mk
> +
> +define Target/Description
> +       Synopsys DesignWare boards
> +endef
> +
> +$(eval $(call BuildTarget))
> diff --git a/target/linux/arc/axs10x/README b/target/linux/arc/axs10x/README
> new file mode 100644
> index 0000000..fcefeeb
> --- /dev/null
> +++ b/target/linux/arc/axs10x/README
> @@ -0,0 +1,19 @@
> +The AXS10x Platform consists of a DesignWare AXC001 CPU
> +Card (with ARC 770D core) in case of AXS101 or AXC003 CPU Card
> +(typically with ARC HS38 core) in case of AXS103 mounted on an
> +ARC Software Development Platform Mainboard with DesignWare peripherals:
> + * SD/MMC contoller
> + * Gigabit network contoller
> + * Serial ports (8250-compatible)
> + * USB 2.0
> + * SPI
> + * I2C
> +
> +As of today we build vmlinux image for that board and that image
> +could be loaded in board's memory via JTAG.
> +
> +If Digilent USB JTAG probe is used following command line could be used:
> +-------->8-------
> +mdb -digilent vmlinux
> +-------->8-------
> +
> diff --git a/target/linux/arc/axs10x/base-files/etc/config/network b/target/linux/arc/axs10x/base-files/etc/config/network
> new file mode 100644
> index 0000000..1d46510
> --- /dev/null
> +++ b/target/linux/arc/axs10x/base-files/etc/config/network
> @@ -0,0 +1,18 @@
> +config interface 'loopback'
> +        option ifname 'lo'
> +        option proto 'static'
> +        option ipaddr '127.0.0.1'
> +        option netmask '255.0.0.0'
> +
> +config interface 'lan'
> +        option ifname 'eth0'
> +        option type 'bridge'
> +        option proto 'dhcp'
> +
> +config interface 'wan6'
> +        option ifname '@wan'
> +        option proto 'dhcpv6'
> +
> +config globals 'globals'
> +        option ula_prefix 'fdd3:b396:94ac::/48'
> +
> diff --git a/target/linux/arc/axs10x/base-files/etc/inittab b/target/linux/arc/axs10x/base-files/etc/inittab
> new file mode 100644
> index 0000000..672cbba
> --- /dev/null
> +++ b/target/linux/arc/axs10x/base-files/etc/inittab
> @@ -0,0 +1,5 @@
> +::sysinit:/etc/init.d/rcS S boot
> +::shutdown:/etc/init.d/rcS K shutdown
> +tts/0::askfirst:/bin/ash --login
> +ttyS3::askfirst:/bin/ash --login
> +tty1::askfirst:/bin/ash --login
> diff --git a/target/linux/arc/axs10x/config-4.1 b/target/linux/arc/axs10x/config-4.1
> new file mode 100644
> index 0000000..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. Also please move
all common options from both subtargets into a
target/linux/arc/config-4.1.

Also apart from the select ARC_HAS_COH_CACHES if SMP, is there any
reason to nsim needs to be a subtarget? If subtargets, I would expect
750D/770/HS subtargets.

(snip the rest)

> diff --git a/target/linux/arc/axs10x/target.mk b/target/linux/arc/axs10x/target.mk
> new file mode 100644
> index 0000000..69c5c47
> --- /dev/null
> +++ b/target/linux/arc/axs10x/target.mk
> @@ -0,0 +1,8 @@
> +BOARDNAME:=AXS10x
> +
> +define Target/Description
> +       Synopsys Designware SDP board.
> +endef
> +
> +FEATURES += ramdisk usb
> +DEFAULT_PACKAGES += kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci
> diff --git a/target/linux/arc/image/Makefile b/target/linux/arc/image/Makefile
> new file mode 100644
> index 0000000..df19461
> --- /dev/null
> +++ b/target/linux/arc/image/Makefile
> @@ -0,0 +1,12 @@
> +#
> +# 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
> +
> +# use default targets for everything
> +
> +$(eval $(call BuildImage))
> diff --git a/target/linux/arc/nsim/README b/target/linux/arc/nsim/README
> new file mode 100644
> index 0000000..2ab98b0
> --- /dev/null
> +++ b/target/linux/arc/nsim/README
> @@ -0,0 +1,19 @@
> +This is a simulator of pretty simple board with ARC770 CPU and
> +serial port as the only peripheral.
> +
> +Still this is useful for runtime smoke testing.
> +
> +Free instance of the simulator is available here after simple registration
> +and approval from Synopsys staff:
> +    http://www.synopsys.com/cgi-bin/dwarcnsim/req1.cgi
> +
> +Once downloaded and extracted it might be executed like that:
> +
> +nsimdrv -prop=nsim_isa_family=a700 -prop=nsim_isa_atomic_option=1 \
> +        -prop=nsim_mmu=3 -prop=icache=32768,64,2,0 -prop=dcache=32768,64,4,0 \
> +        -prop=nsim_isa_dpfp=none -prop=nsim_isa_shift_option=2 \
> +        -prop=nsim_isa_swap_option=1 -prop=nsim_isa_bitscan_option=1 \
> +        -prop=nsim_isa_sat=1 -prop=nsim_isa_mpy32=1 \
> +        -prop=nsim_isa_enable_timer_0=1 -prop=nsim_isa_enable_timer_1=1 \
> +        -prop=nsim_mem-dev=uart0 vmlinux
> +
> diff --git a/target/linux/arc/nsim/base-files/etc/inittab b/target/linux/arc/nsim/base-files/etc/inittab
> new file mode 100644
> index 0000000..a855c34
> --- /dev/null
> +++ b/target/linux/arc/nsim/base-files/etc/inittab
> @@ -0,0 +1,5 @@
> +::sysinit:/etc/init.d/rcS S boot
> +::shutdown:/etc/init.d/rcS K shutdown
> +tts/0::askfirst:/bin/ash --login
> +ttyARC0::askfirst:/bin/ash --login
> +tty1::askfirst:/bin/ash --login
> diff --git a/target/linux/arc/nsim/config-4.1 b/target/linux/arc/nsim/config-4.1
> new file mode 100644
> index 0000000..f53c763
> --- /dev/null
> +++ b/target/linux/arc/nsim/config-4.1
> @@ -0,0 +1,88 @@
> +#
> +# ARC Architecture Configuration
> +#
> +CONFIG_ARC=y

Same comment here.

> diff --git a/target/linux/arc/nsim/target.mk b/target/linux/arc/nsim/target.mk
> new file mode 100644
> index 0000000..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 ^ ;)

Jonas
Alexey Brodkin Sept. 2, 2015, 8:40 p.m. UTC | #3
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
> <Alexey.Brodkin@synopsys.com> 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 0000000..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 0000000..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
Jonas Gorski Sept. 3, 2015, 1:33 p.m. UTC | #4
Hi,

On Wed, Sep 2, 2015 at 10:40 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> 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
>> <Alexey.Brodkin@synopsys.com> 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 0000000..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).

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

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


Jonas
Alexey Brodkin Sept. 3, 2015, 4:11 p.m. UTC | #5
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
> <Alexey.Brodkin@synopsys.com> 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
> > > <Alexey.Brodkin@synopsys.com> 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 0000000..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/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):
 * 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.

-Alexey
Jonas Gorski Sept. 4, 2015, 10:25 a.m. UTC | #6
Hi,

On Thu, Sep 3, 2015 at 6:11 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> 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
>> <Alexey.Brodkin@synopsys.com> 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
appending a dtb like on ARM would be an option; or reserving  space in
the kernel to patch in a dtb (we have a patch for MIPS for that, but
that would likely work similar for other targets).

Having a subtarget for each board will create a huge burden for
release builds, es effectively we will then need to build a new
toolchain for each board, and they cannot share their packages feeds,
so we would also need to rebuild all packages for all boards.

So please rework your target to not use/require per-board subtargets.


Jonas
Alexey Brodkin Sept. 4, 2015, 10:35 a.m. UTC | #7
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
> <Alexey.Brodkin@synopsys.com> 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
> > > <Alexey.Brodkin@synopsys.com> 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
> appending a dtb like on ARM would be an option; or reserving  space in
> the kernel to patch in a dtb (we have a patch for MIPS for that, but
> that would likely work similar for other targets).
> 
> Having a subtarget for each board will create a huge burden for
> release builds, es effectively we will then need to build a new
> toolchain for each board, and they cannot share their packages feeds,
> so we would also need to rebuild all packages for all boards.
> 
> So please rework your target to not use/require per-board subtargets.

Sorry for another round of questions but from your answer I still 
don't understand what my source tree should look like?

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.

-Alexey
Jonas Gorski Sept. 4, 2015, 10:40 a.m. UTC | #8
Hi,

On Fri, Sep 4, 2015 at 12:35 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> 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
>> <Alexey.Brodkin@synopsys.com> 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
>> > > <Alexey.Brodkin@synopsys.com> 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
>> appending a dtb like on ARM would be an option; or reserving  space in
>> the kernel to patch in a dtb (we have a patch for MIPS for that, but
>> that would likely work similar for other targets).
>>
>> Having a subtarget for each board will create a huge burden for
>> release builds, es effectively we will then need to build a new
>> toolchain for each board, and they cannot share their packages feeds,
>> so we would also need to rebuild all packages for all boards.
>>
>> So please rework your target to not use/require per-board subtargets.
>
> Sorry for another round of questions but from your answer I still
> don't understand what my source tree should look like?
>
> 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.


Jonas
Alexey Brodkin Sept. 4, 2015, 10:45 a.m. UTC | #9
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
> <Alexey.Brodkin@synopsys.com> 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
> > > <Alexey.Brodkin@synopsys.com> 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
> > > > > <Alexey.Brodkin@synopsys.com> 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
> > > appending a dtb like on ARM would be an option; or reserving  space in
> > > the kernel to patch in a dtb (we have a patch for MIPS for that, but
> > > that would likely work similar for other targets).
> > > 
> > > Having a subtarget for each board will create a huge burden for
> > > release builds, es effectively we will then need to build a new
> > > toolchain for each board, and they cannot share their packages feeds,
> > > so we would also need to rebuild all packages for all boards.
> > > 
> > > So please rework your target to not use/require per-board subtargets.
> > 
> > Sorry for another round of questions but from your answer I still
> > don't understand what my source tree should look like?
> > 
> > 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")

-Alexey
Jonas Gorski Sept. 4, 2015, 11:01 a.m. UTC | #10
On Fri, Sep 4, 2015 at 12:45 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> 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/<subtarget>/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.


Jonas
Alexey Brodkin Sept. 4, 2015, 11:24 a.m. UTC | #11
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
> <Alexey.Brodkin@synopsys.com> 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/<subtarget>/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? :)
Jonas Gorski Sept. 4, 2015, 1:44 p.m. UTC | #12
Hi,

On Fri, Sep 4, 2015 at 1:24 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> 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
>> <Alexey.Brodkin@synopsys.com> 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/<subtarget>/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.

Regarding the cache line sizes, this looks like a problem that should
have already been solved for ARM, as they have a multiplat target,
which I guess should be able to deal with varying cache line sizes.

I don't think the OpenWrt images build with defaults must be optimized
for all SoCs, just "run resonably well". If you need optimized for one
you would then build and tweak yourself. But we do want to be able to
build for as many boards as possible at the same time, to be able to
at least compile test and allow easy runtime testing.

And a final, not directly related question: where can one reasonably
expect to enounter these SoCs? Are there or will there be any
off-the-shelf devices where I can then flash OpenWrt onto?


Jonas
Alexey Brodkin Sept. 4, 2015, 2:12 p.m. UTC | #13
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
> <Alexey.Brodkin@synopsys.com> 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
> > > <Alexey.Brodkin@synopsys.com> 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/<subtarget>/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 page size was set to 8k there's no way to either change
this value in runtime or somehow run kernel built for 4k or 16k pages.
Kernel will panic on early boot.

> Regarding the cache line sizes, this looks like a problem that should
> have already been solved for ARM, as they have a multiplat target,
> which I guess should be able to deal with varying cache line sizes.

Hm, interesting. May I have a pointer to it? 

> I don't think the OpenWrt images build with defaults must be optimized
> for all SoCs, just "run resonably well". If you need optimized for one
> you would then build and tweak yourself. But we do want to be able to
> build for as many boards as possible at the same time, to be able to
> at least compile test and allow easy runtime testing.

The thing is I'm not talking about optimization here.
As I explained above there're ARC core config options that require
Linux kernel to match them.

These are at least MMU page size and cache line length. If HW config
doesn't match kernel - kernel won't boot. And there's no solution for
that except proper kernel config.

Indeed there're other options like hardware multipliers of different
types, other additional HW blocks that might be used for getting
better performance. Those could be used but could be not used as well.
I.e. it's possible to build Linux kernel so it uses SW multiplication
instread of HW. That image will run on both ASICs with and without HW
multiplier.

But kernel built for 4k MMU page will only run on HW with the same
page size. The same is true for cache line size.

> And a final, not directly related question: where can one reasonably
> expect to enounter these SoCs? Are there or will there be any
> off-the-shelf devices where I can then flash OpenWrt onto?

Well I remember once we got a request from one hobbyist who
got WiFi router from AT&T and there was ARC700-based SoC. But
I cannot point you to that device now unfortunately.

Also we do know that ARC cores are used in networking equipment.
Good example is Abilis with their Abilis TB10x SoC, see
http://www.alitech.com/index.php/products/product/49/75.html

I'm not really sure where their SoC is used but it is very good
candidate for OpenWRT. And what's also good it is supported in
upstream Linux kernel.

So once we have basic OpenWRT port for ARC - for now with support
of our devboards - I'm pretty sure people will start putting it on their
devices.

-Alexey
Jonas Gorski Sept. 8, 2015, 12:52 p.m. UTC | #14
Hi Alexey,

On Fri, Sep 4, 2015 at 4:12 PM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
> 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
>> <Alexey.Brodkin@synopsys.com> 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
>> > > <Alexey.Brodkin@synopsys.com> 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/<subtarget>/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 page size was set to 8k there's no way to either change
> this value in runtime or somehow run kernel built for 4k or 16k pages.
> Kernel will panic on early boot.

After thinking about this a bit more, I don't think we want an "arc"
target at all, as we neither have a "mips" or a "arm" target.

So I guess having axs10x nsim targets is the way to go (each with
arc700 and hs3x subtargets), as we usually model our targets after SoC
(families), not CPUs.

But I wonder, would it be possible to create a kernel that boots on
both nsim and axs10x, assuming one includes all required drivers and
both use the same cpu? I don't see anything preventing that in linux
4.2, apart from the ARC_HAS_COH_CACHES for SMP, which is true for HS3x
but isn't true for ARC700, but OTOH at least from a description ARC700
doesn't support SMP anyway. Differentiating both should be easy due to
devicetree, and reducing the required build targets to half would be
really nice.

>> Regarding the cache line sizes, this looks like a problem that should
>> have already been solved for ARM, as they have a multiplat target,
>> which I guess should be able to deal with varying cache line sizes.
>
> Hm, interesting. May I have a pointer to it?

I don't have one, unless you mean the multiplat target of arm. Also
note my usage of "guess" and "should" ;-p

>> And a final, not directly related question: where can one reasonably
>> expect to enounter these SoCs? Are there or will there be any
>> off-the-shelf devices where I can then flash OpenWrt onto?
>
> Well I remember once we got a request from one hobbyist who
> got WiFi router from AT&T and there was ARC700-based SoC. But
> I cannot point you to that device now unfortunately.
>
> Also we do know that ARC cores are used in networking equipment.
> Good example is Abilis with their Abilis TB10x SoC, see
> http://www.alitech.com/index.php/products/product/49/75.html
>
> I'm not really sure where their SoC is used but it is very good
> candidate for OpenWRT. And what's also good it is supported in
> upstream Linux kernel.
>
> So once we have basic OpenWRT port for ARC - for now with support
> of our devboards - I'm pretty sure people will start putting it on their
> devices.

So likely the ARC700 based SoC from AT&T and the tb10x SoCs would
become "toplevel" targets in the normal OpenWrt philosophy (unless
they are very similar), this would prevent any issues regarding
different MMU page sizes.


Jonas
diff mbox

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 0000000..ad252cb
--- /dev/null
+++ b/target/linux/arc/Makefile
@@ -0,0 +1,28 @@ 
+#
+# 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
+
+ARCH:=arc
+BOARD:=arc
+BOARDNAME:=Synopsys DesignWare
+CFLAGS:=-Os -pipe -fno-caller-saves -matomic
+MAINTAINER:=Alexey Brodkin <abrodkin@synopsys.com>
+SUBTARGETS:=axs10x nsim
+
+KERNEL_PATCHVER:=4.1
+
+KERNELNAME:=vmlinux
+
+DEVICE_TYPE:=developerboard
+
+include $(INCLUDE_DIR)/target.mk
+
+define Target/Description
+	Synopsys DesignWare boards
+endef
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/arc/axs10x/README b/target/linux/arc/axs10x/README
new file mode 100644
index 0000000..fcefeeb
--- /dev/null
+++ b/target/linux/arc/axs10x/README
@@ -0,0 +1,19 @@ 
+The AXS10x Platform consists of a DesignWare AXC001 CPU
+Card (with ARC 770D core) in case of AXS101 or AXC003 CPU Card
+(typically with ARC HS38 core) in case of AXS103 mounted on an
+ARC Software Development Platform Mainboard with DesignWare peripherals:
+ * SD/MMC contoller
+ * Gigabit network contoller
+ * Serial ports (8250-compatible)
+ * USB 2.0
+ * SPI
+ * I2C
+
+As of today we build vmlinux image for that board and that image
+could be loaded in board's memory via JTAG.
+
+If Digilent USB JTAG probe is used following command line could be used:
+-------->8-------
+mdb -digilent vmlinux
+-------->8-------
+
diff --git a/target/linux/arc/axs10x/base-files/etc/config/network b/target/linux/arc/axs10x/base-files/etc/config/network
new file mode 100644
index 0000000..1d46510
--- /dev/null
+++ b/target/linux/arc/axs10x/base-files/etc/config/network
@@ -0,0 +1,18 @@ 
+config interface 'loopback'
+        option ifname 'lo'
+        option proto 'static'
+        option ipaddr '127.0.0.1'
+        option netmask '255.0.0.0'
+
+config interface 'lan'
+        option ifname 'eth0'
+        option type 'bridge'
+        option proto 'dhcp'
+
+config interface 'wan6'
+        option ifname '@wan'
+        option proto 'dhcpv6'
+
+config globals 'globals'
+        option ula_prefix 'fdd3:b396:94ac::/48'
+
diff --git a/target/linux/arc/axs10x/base-files/etc/inittab b/target/linux/arc/axs10x/base-files/etc/inittab
new file mode 100644
index 0000000..672cbba
--- /dev/null
+++ b/target/linux/arc/axs10x/base-files/etc/inittab
@@ -0,0 +1,5 @@ 
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+tts/0::askfirst:/bin/ash --login
+ttyS3::askfirst:/bin/ash --login
+tty1::askfirst:/bin/ash --login
diff --git a/target/linux/arc/axs10x/config-4.1 b/target/linux/arc/axs10x/config-4.1
new file mode 100644
index 0000000..2cd3471
--- /dev/null
+++ b/target/linux/arc/axs10x/config-4.1
@@ -0,0 +1,127 @@ 
+#
+# ARC Architecture Configuration
+#
+CONFIG_ARC=y
+
+#
+# ARC Platform/SoC/Board
+#
+# CONFIG_ARC_PLAT_FPGA_LEGACY is not set
+# CONFIG_ARC_PLAT_TB10X is not set
+CONFIG_ARC_PLAT_AXS10X=y
+CONFIG_AXS101=y
+
+#
+# ARC CPU Configuration
+#
+# CONFIG_ARC_CPU_750D is not set
+CONFIG_ARC_CPU_770=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_SMP is not set
+CONFIG_ARC_CACHE=y
+CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_ARC_HAS_ICACHE=y
+CONFIG_ARC_HAS_DCACHE=y
+CONFIG_ARC_CACHE_PAGES=y
+# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
+# CONFIG_ARC_HAS_ICCM is not set
+# CONFIG_ARC_HAS_DCCM is not set
+CONFIG_ARC_HAS_HW_MPY=y
+# CONFIG_ARC_MMU_V1 is not set
+# CONFIG_ARC_MMU_V2 is not set
+CONFIG_ARC_MMU_V3=y
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
+# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
+# CONFIG_ARC_FPU_SAVE_RESTORE is not set
+# CONFIG_ARC_CANT_LLSC is not set
+CONFIG_ARC_CPU_REL_4_10=y
+CONFIG_ARC_HAS_LLSC=y
+CONFIG_ARC_HAS_SWAPE=y
+CONFIG_LINUX_LINK_BASE=0x80000000
+CONFIG_ARC_CURR_IN_REG=y
+# CONFIG_ARC_EMUL_UNALIGNED is not set
+CONFIG_HZ=100
+# CONFIG_ARC_METAWARE_HLINK is not set
+CONFIG_ARC_DBG=y
+CONFIG_ARC_DW2_UNWIND=y
+# CONFIG_ARC_DBG_TLB_PARANOIA is not set
+# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
+CONFIG_ARC_BUILTIN_DTB_NAME="axs101"
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_COUNT=y
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+
+#
+# MII PHY device drivers
+#
+CONFIG_PHYLIB=y
+CONFIG_NATIONAL_PHY=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_EARLYCON=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_8250_DW=y
+
+#
+# Character devices
+#
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_SUPPORT=y
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_IDMAC=y
+CONFIG_MMC_DW_PLTFM=y
+# CONFIG_MMC_DW_EXYNOS is not set
+# CONFIG_MMC_DW_K3 is not set
+
+#
+# Misc options to make OpenWRT buildsystem happy
+#
+# CONFIG_RCU_BOOST is not set
+# CONFIG_FS_DAX is not set
+# CONFIG_16KSTACKS is not set
diff --git a/target/linux/arc/axs10x/target.mk b/target/linux/arc/axs10x/target.mk
new file mode 100644
index 0000000..69c5c47
--- /dev/null
+++ b/target/linux/arc/axs10x/target.mk
@@ -0,0 +1,8 @@ 
+BOARDNAME:=AXS10x
+
+define Target/Description
+	Synopsys Designware SDP board.
+endef
+
+FEATURES += ramdisk usb
+DEFAULT_PACKAGES += kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-mmc kmod-sdhci
diff --git a/target/linux/arc/image/Makefile b/target/linux/arc/image/Makefile
new file mode 100644
index 0000000..df19461
--- /dev/null
+++ b/target/linux/arc/image/Makefile
@@ -0,0 +1,12 @@ 
+#
+# 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
+
+# use default targets for everything
+
+$(eval $(call BuildImage))
diff --git a/target/linux/arc/nsim/README b/target/linux/arc/nsim/README
new file mode 100644
index 0000000..2ab98b0
--- /dev/null
+++ b/target/linux/arc/nsim/README
@@ -0,0 +1,19 @@ 
+This is a simulator of pretty simple board with ARC770 CPU and
+serial port as the only peripheral.
+
+Still this is useful for runtime smoke testing.
+
+Free instance of the simulator is available here after simple registration
+and approval from Synopsys staff:
+    http://www.synopsys.com/cgi-bin/dwarcnsim/req1.cgi
+
+Once downloaded and extracted it might be executed like that:
+
+nsimdrv -prop=nsim_isa_family=a700 -prop=nsim_isa_atomic_option=1 \
+        -prop=nsim_mmu=3 -prop=icache=32768,64,2,0 -prop=dcache=32768,64,4,0 \
+        -prop=nsim_isa_dpfp=none -prop=nsim_isa_shift_option=2 \
+        -prop=nsim_isa_swap_option=1 -prop=nsim_isa_bitscan_option=1 \
+        -prop=nsim_isa_sat=1 -prop=nsim_isa_mpy32=1 \
+        -prop=nsim_isa_enable_timer_0=1 -prop=nsim_isa_enable_timer_1=1 \
+        -prop=nsim_mem-dev=uart0 vmlinux
+
diff --git a/target/linux/arc/nsim/base-files/etc/inittab b/target/linux/arc/nsim/base-files/etc/inittab
new file mode 100644
index 0000000..a855c34
--- /dev/null
+++ b/target/linux/arc/nsim/base-files/etc/inittab
@@ -0,0 +1,5 @@ 
+::sysinit:/etc/init.d/rcS S boot
+::shutdown:/etc/init.d/rcS K shutdown
+tts/0::askfirst:/bin/ash --login
+ttyARC0::askfirst:/bin/ash --login
+tty1::askfirst:/bin/ash --login
diff --git a/target/linux/arc/nsim/config-4.1 b/target/linux/arc/nsim/config-4.1
new file mode 100644
index 0000000..f53c763
--- /dev/null
+++ b/target/linux/arc/nsim/config-4.1
@@ -0,0 +1,88 @@ 
+#
+# ARC Architecture Configuration
+#
+CONFIG_ARC=y
+
+#
+# ARC Platform/SoC/Board
+#
+CONFIG_ARC_PLAT_FPGA_LEGACY=y
+# CONFIG_ARC_PLAT_TB10X is not set
+# CONFIG_ARC_PLAT_AXS10X is not set
+
+#
+# ARC CPU Configuration
+#
+# CONFIG_ARC_CPU_750D is not set
+CONFIG_ARC_CPU_770=y
+# CONFIG_CPU_BIG_ENDIAN is not set
+# CONFIG_SMP is not set
+CONFIG_ARC_CACHE=y
+CONFIG_ARC_CACHE_LINE_SHIFT=6
+CONFIG_ARC_HAS_ICACHE=y
+CONFIG_ARC_HAS_DCACHE=y
+CONFIG_ARC_CACHE_PAGES=y
+# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
+# CONFIG_ARC_HAS_ICCM is not set
+# CONFIG_ARC_HAS_DCCM is not set
+CONFIG_ARC_HAS_HW_MPY=y
+# CONFIG_ARC_MMU_V1 is not set
+# CONFIG_ARC_MMU_V2 is not set
+CONFIG_ARC_MMU_V3=y
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
+# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
+# CONFIG_ARC_FPU_SAVE_RESTORE is not set
+# CONFIG_ARC_CANT_LLSC is not set
+CONFIG_ARC_CPU_REL_4_10=y
+CONFIG_ARC_HAS_LLSC=y
+CONFIG_ARC_HAS_SWAPE=y
+CONFIG_LINUX_LINK_BASE=0x80000000
+CONFIG_ARC_CURR_IN_REG=y
+# CONFIG_ARC_EMUL_UNALIGNED is not set
+CONFIG_HZ=100
+# CONFIG_ARC_METAWARE_HLINK is not set
+CONFIG_ARC_DBG=y
+CONFIG_ARC_DW2_UNWIND=y
+# CONFIG_ARC_DBG_TLB_PARANOIA is not set
+# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
+CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_COUNT=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+CONFIG_SERIAL_ARC=y
+CONFIG_SERIAL_ARC_CONSOLE=y
+CONFIG_SERIAL_ARC_NR_PORTS=1
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_TTY_PRINTK is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+
+#
+# Misc options to make OpenWRT buildsystem happy
+#
+# CONFIG_RCU_BOOST is not set
+# CONFIG_FS_DAX is not set
+# CONFIG_16KSTACKS is not set
diff --git a/target/linux/arc/nsim/target.mk b/target/linux/arc/nsim/target.mk
new file mode 100644
index 0000000..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
diff --git a/target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch b/target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
new file mode 100644
index 0000000..ce1bc21
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0001-ARC-axs101-Add-support-for-AXS101-SDP-software-devel.patch
@@ -0,0 +1,911 @@ 
+From 0c5983abe8ead78d8f5adde75660cc05ec4b74bc Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin <abrodkin@synopsys.com>
+Date: Mon, 27 Jan 2014 14:51:34 +0100
+Subject: [PATCH 1/4] ARC: [axs101] Add support for AXS101 SDP (software
+ development platform)
+
+The AXS10x platforms consist of a mainboard with peripherals,
+on which several daughter cards can be placed. The daughter cards
+typically contain a CPU and memory.
+
+Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
+Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+---
+ Documentation/devicetree/bindings/arc/axs101.txt |   7 +
+ MAINTAINERS                                      |   7 +
+ arch/arc/Kconfig                                 |   1 +
+ arch/arc/Makefile                                |   1 +
+ arch/arc/boot/dts/axc001.dtsi                    |  79 ++++++
+ arch/arc/boot/dts/axs101.dts                     |  21 ++
+ arch/arc/boot/dts/axs10x_mb.dtsi                 | 223 +++++++++++++++++
+ arch/arc/configs/axs101_defconfig                | 111 +++++++++
+ arch/arc/plat-axs10x/Kconfig                     |  35 +++
+ arch/arc/plat-axs10x/Makefile                    |   9 +
+ arch/arc/plat-axs10x/axs10x.c                    | 298 +++++++++++++++++++++++
+ 11 files changed, 792 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/arc/axs101.txt
+ create mode 100644 arch/arc/boot/dts/axc001.dtsi
+ create mode 100644 arch/arc/boot/dts/axs101.dts
+ create mode 100644 arch/arc/boot/dts/axs10x_mb.dtsi
+ create mode 100644 arch/arc/configs/axs101_defconfig
+ create mode 100644 arch/arc/plat-axs10x/Kconfig
+ create mode 100644 arch/arc/plat-axs10x/Makefile
+ create mode 100644 arch/arc/plat-axs10x/axs10x.c
+
+diff --git a/Documentation/devicetree/bindings/arc/axs101.txt b/Documentation/devicetree/bindings/arc/axs101.txt
+new file mode 100644
+index 0000000..568aa5f
+--- /dev/null
++++ b/Documentation/devicetree/bindings/arc/axs101.txt
+@@ -0,0 +1,7 @@
++Synopsys DesignWare ARC Software Development Platforms Device Tree Bindings
++---------------------------------------------------------------------------
++
++SDP Main Board with an AXC001 CPU Card hoisting ARC700 core in silicon
++
++Required root node properties:
++    - compatible = "snps,axs101";
+diff --git a/MAINTAINERS b/MAINTAINERS
+index d8afd29..c9381f7 100644
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -9583,6 +9583,13 @@ F:	arch/arc/
+ F:	Documentation/devicetree/bindings/arc/
+ F:	drivers/tty/serial/arc_uart.c
+ 
++SYNOPSYS ARC SDP platform support
++M:	Alexey Brodkin <abrodkin@synopsys.com>
++S:	Supported
++F:	arch/arc/plat-axs10x
++F:	arch/arc/boot/dts/ax*
++F:	Documentation/devicetree/bindings/arc/axs10*
++
+ SYSV FILESYSTEM
+ M:	Christoph Hellwig <hch@infradead.org>
+ S:	Maintained
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index df94ac1..13d4c26 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -83,6 +83,7 @@ menu "ARC Platform/SoC/Board"
+ 
+ source "arch/arc/plat-arcfpga/Kconfig"
+ source "arch/arc/plat-tb10x/Kconfig"
++source "arch/arc/plat-axs10x/Kconfig"
+ #New platform adds here
+ 
+ endmenu
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index db72fec..562ac7d 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -83,6 +83,7 @@ core-y		+= arch/arc/boot/dts/
+ 
+ core-$(CONFIG_ARC_PLAT_FPGA_LEGACY)	+= arch/arc/plat-arcfpga/
+ core-$(CONFIG_ARC_PLAT_TB10X)		+= arch/arc/plat-tb10x/
++core-$(CONFIG_ARC_PLAT_AXS10X)		+= arch/arc/plat-axs10x/
+ 
+ drivers-$(CONFIG_OPROFILE)	+= arch/arc/oprofile/
+ 
+diff --git a/arch/arc/boot/dts/axc001.dtsi b/arch/arc/boot/dts/axc001.dtsi
+new file mode 100644
+index 0000000..6990ca4
+--- /dev/null
++++ b/arch/arc/boot/dts/axc001.dtsi
+@@ -0,0 +1,79 @@
++/*
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++/*
++ * Device tree for AXC001 770D/EM6/AS221 CPU card
++ * Note that this file only supports the 770D CPU
++ */
++
++/ {
++	compatible = "snps,arc";
++	clock-frequency = <750000000>;	/* 750 MHZ */
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	cpu_card {
++		compatible = "simple-bus";
++		#address-cells = <1>;
++		#size-cells = <1>;
++
++		ranges = <0x00000000 0xf0000000 0x10000000>;
++
++		cpu_intc: arc700-intc@cpu {
++			compatible = "snps,arc700-intc";
++			interrupt-controller;
++			#interrupt-cells = <1>;
++		};
++
++		/*
++		 * this GPIO block ORs all interrupts on CPU card (creg,..)
++		 * to uplink only 1 IRQ to ARC core intc
++		 */
++		dw-apb-gpio@0x2000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = < 0x2000 0x80 >;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			ictl_intc: gpio-controller@0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <30>;
++				reg = <0>;
++				interrupt-controller;
++				#interrupt-cells = <2>;
++				interrupt-parent = <&cpu_intc>;
++				interrupts = <15>;
++			};
++		};
++
++		debug_uart: dw-apb-uart@0x5000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x5000 0x100>;
++			clock-frequency = <33333000>;
++			interrupt-parent = <&ictl_intc>;
++			interrupts = <19 4>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		arcpmu0: pmu {
++			compatible = "snps,arc700-pct";
++		};
++	};
++
++	memory {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges = <0x00000000 0x80000000 0x40000000>;
++		device_type = "memory";
++		reg = <0x00000000 0x20000000>;	/* 512MiB */
++	};
++};
+diff --git a/arch/arc/boot/dts/axs101.dts b/arch/arc/boot/dts/axs101.dts
+new file mode 100644
+index 0000000..6c3391d
+--- /dev/null
++++ b/arch/arc/boot/dts/axs101.dts
+@@ -0,0 +1,21 @@
++/*
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * ARC AXS101 S/W development platform
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++/dts-v1/;
++
++/include/ "axc001.dtsi"
++/include/ "axs10x_mb.dtsi"
++
++/ {
++	compatible = "snps,axs101";
++
++	chosen {
++		bootargs = "console=tty0 console=ttyS3,115200n8 consoleblank=0";
++	};
++};
+diff --git a/arch/arc/boot/dts/axs10x_mb.dtsi b/arch/arc/boot/dts/axs10x_mb.dtsi
+new file mode 100644
+index 0000000..255c712
+--- /dev/null
++++ b/arch/arc/boot/dts/axs10x_mb.dtsi
+@@ -0,0 +1,223 @@
++/*
++ * Support for peripherals on the AXS10x mainboard
++ *
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ */
++
++/ {
++	axs10x_mb {
++		compatible = "simple-bus";
++		#address-cells = <1>;
++		#size-cells = <1>;
++		ranges = <0x00000000 0xe0000000 0x10000000>;
++		interrupt-parent = <&mb_intc>;
++
++		clocks {
++			i2cclk: i2cclk {
++				compatible = "fixed-clock";
++				clock-frequency = <50000000>;
++				#clock-cells = <0>;
++			};
++
++			apbclk: apbclk {
++				compatible = "fixed-clock";
++				clock-frequency = <50000000>;
++				#clock-cells = <0>;
++			};
++
++			mmcclk: mmcclk {
++				compatible = "fixed-clock";
++				clock-frequency = <50000000>;
++				#clock-cells = <0>;
++			};
++		};
++
++		/*
++		 * This INTC is actually connected to DW APB GPIO
++		 * which acts as a wire between MB INTC and CPU INTC.
++		 * GPIO INTC is configured in platform init code
++		 * and here we mimic direct connection from MB INTC to
++		 * CPU INTC, thus we set "interrupts = <7>" instead of
++		 * "interrupts = <12>"
++		 */
++		mb_intc: dw-apb-ictl@0x12000 {
++			#interrupt-cells = <1>;
++			compatible = "snps,dw-apb-ictl";
++			reg = < 0x12000 0x200 >;
++			interrupt-controller;
++			interrupt-parent = <&cpu_intc>;
++			interrupts = < 7 >;
++		};
++
++		ethernet@0x18000 {
++			#interrupt-cells = <1>;
++			compatible = "snps,dwmac";
++			reg = < 0x18000 0x2000 >;
++			interrupts = < 4 >;
++			interrupt-names = "macirq";
++			phy-mode = "rgmii";
++			snps,pbl = < 32 >;
++			clocks = <&apbclk>;
++			clock-names = "stmmaceth";
++		};
++
++		ehci@0x40000 {
++			compatible = "generic-ehci";
++			reg = < 0x40000 0x100 >;
++			interrupts = < 8 >;
++		};
++
++		ohci@0x60000 {
++			compatible = "generic-ohci";
++			reg = < 0x60000 0x100 >;
++			interrupts = < 8 >;
++		};
++
++		mmc@0x15000 {
++			compatible = "snps,dw-mshc";
++			reg = < 0x15000 0x400 >;
++			num-slots = < 1 >;
++			fifo-depth = < 16 >;
++			card-detect-delay = < 200 >;
++			clocks = <&apbclk>, <&mmcclk>;
++			clock-names = "biu", "ciu";
++			interrupts = < 7 >;
++			bus-width = < 4 >;
++		};
++
++		uart@0x20000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x20000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <17>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		uart@0x21000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x21000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <18>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		/* UART muxed with USB data port (ttyS3) */
++		uart@0x22000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x22000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <19>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		i2c@0x1d000 {
++			compatible = "snps,designware-i2c";
++			reg = <0x1d000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <14>;
++		};
++
++		i2c@0x1e000 {
++			compatible = "snps,designware-i2c";
++			reg = <0x1e000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <15>;
++		};
++
++		i2c@0x1f000 {
++			compatible = "snps,designware-i2c";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			reg = <0x1f000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <16>;
++
++			eeprom@0x54{
++				compatible = "24c01";
++				reg = <0x54>;
++				pagesize = <0x8>;
++			};
++
++			eeprom@0x57{
++				compatible = "24c04";
++				reg = <0x57>;
++				pagesize = <0x8>;
++			};
++		};
++
++		gpio0:gpio@13000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = <0x13000 0x1000>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			gpio0_banka: gpio-controller@0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <32>;
++				reg = <0>;
++			};
++
++			gpio0_bankb: gpio-controller@1 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <1>;
++			};
++
++			gpio0_bankc: gpio-controller@2 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <2>;
++			};
++		};
++
++		gpio1:gpio@14000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = <0x14000 0x1000>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			gpio1_banka: gpio-controller@0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <30>;
++				reg = <0>;
++			};
++
++			gpio1_bankb: gpio-controller@1 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <10>;
++				reg = <1>;
++			};
++
++			gpio1_bankc: gpio-controller@2 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <2>;
++			};
++		};
++	};
++};
+diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig
+new file mode 100644
+index 0000000..562dac6
+--- /dev/null
++++ b/arch/arc/configs/axs101_defconfig
+@@ -0,0 +1,111 @@
++CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
++CONFIG_DEFAULT_HOSTNAME="ARCLinux"
++# CONFIG_SWAP is not set
++CONFIG_SYSVIPC=y
++CONFIG_POSIX_MQUEUE=y
++# CONFIG_CROSS_MEMORY_ATTACH is not set
++CONFIG_NO_HZ_IDLE=y
++CONFIG_HIGH_RES_TIMERS=y
++CONFIG_IKCONFIG=y
++CONFIG_IKCONFIG_PROC=y
++CONFIG_NAMESPACES=y
++# CONFIG_UTS_NS is not set
++# CONFIG_PID_NS is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
++CONFIG_EMBEDDED=y
++CONFIG_PERF_EVENTS=y
++# CONFIG_VM_EVENT_COUNTERS is not set
++# CONFIG_SLUB_DEBUG is not set
++# CONFIG_COMPAT_BRK is not set
++CONFIG_MODULES=y
++CONFIG_PARTITION_ADVANCED=y
++CONFIG_ARC_PLAT_AXS10X=y
++CONFIG_AXS101=y
++CONFIG_ARC_CACHE_LINE_SHIFT=5
++CONFIG_ARC_BUILTIN_DTB_NAME="axs101"
++CONFIG_PREEMPT=y
++# CONFIG_COMPACTION is not set
++CONFIG_NET=y
++CONFIG_PACKET=y
++CONFIG_UNIX=y
++CONFIG_NET_KEY=y
++CONFIG_INET=y
++CONFIG_IP_PNP=y
++CONFIG_IP_PNP_DHCP=y
++CONFIG_IP_PNP_BOOTP=y
++CONFIG_IP_PNP_RARP=y
++# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
++# CONFIG_INET_XFRM_MODE_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
++# CONFIG_IPV6 is not set
++# CONFIG_STANDALONE is not set
++# CONFIG_PREVENT_FIRMWARE_BUILD is not set
++# CONFIG_FIRMWARE_IN_KERNEL is not set
++CONFIG_SCSI=y
++CONFIG_BLK_DEV_SD=y
++CONFIG_NETDEVICES=y
++# CONFIG_NET_VENDOR_ARC is not set
++# CONFIG_NET_VENDOR_BROADCOM is not set
++# CONFIG_NET_VENDOR_INTEL is not set
++# CONFIG_NET_VENDOR_MARVELL is not set
++# CONFIG_NET_VENDOR_MICREL is not set
++# CONFIG_NET_VENDOR_NATSEMI is not set
++# CONFIG_NET_VENDOR_SEEQ is not set
++CONFIG_STMMAC_ETH=y
++# CONFIG_NET_VENDOR_VIA is not set
++# CONFIG_NET_VENDOR_WIZNET is not set
++CONFIG_NATIONAL_PHY=y
++# CONFIG_USB_NET_DRIVERS is not set
++CONFIG_INPUT_EVDEV=y
++CONFIG_MOUSE_PS2_TOUCHKIT=y
++CONFIG_MOUSE_SERIAL=y
++CONFIG_MOUSE_SYNAPTICS_USB=y
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_DEVKMEM is not set
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_DW=y
++CONFIG_SERIAL_OF_PLATFORM=y
++# CONFIG_HW_RANDOM is not set
++CONFIG_I2C=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_DESIGNWARE_PLATFORM=y
++# CONFIG_HWMON is not set
++CONFIG_FB=y
++# CONFIG_VGA_CONSOLE is not set
++CONFIG_FRAMEBUFFER_CONSOLE=y
++CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
++CONFIG_LOGO=y
++# CONFIG_LOGO_LINUX_MONO is not set
++# CONFIG_LOGO_LINUX_VGA16 is not set
++# CONFIG_LOGO_LINUX_CLUT224 is not set
++CONFIG_USB_EHCI_HCD=y
++CONFIG_USB_EHCI_HCD_PLATFORM=y
++CONFIG_USB_OHCI_HCD=y
++CONFIG_USB_OHCI_HCD_PLATFORM=y
++CONFIG_USB_STORAGE=y
++CONFIG_MMC=y
++CONFIG_MMC_SDHCI=y
++CONFIG_MMC_SDHCI_PLTFM=y
++CONFIG_MMC_DW=y
++CONFIG_MMC_DW_IDMAC=y
++# CONFIG_IOMMU_SUPPORT is not set
++CONFIG_EXT3_FS=y
++CONFIG_EXT4_FS=y
++CONFIG_MSDOS_FS=y
++CONFIG_VFAT_FS=y
++CONFIG_NTFS_FS=y
++CONFIG_TMPFS=y
++CONFIG_JFFS2_FS=y
++CONFIG_NFS_FS=y
++CONFIG_NLS_CODEPAGE_437=y
++CONFIG_NLS_ISO8859_1=y
++# CONFIG_ENABLE_WARN_DEPRECATED is not set
++# CONFIG_ENABLE_MUST_CHECK is not set
++CONFIG_STRIP_ASM_SYMS=y
++CONFIG_LOCKUP_DETECTOR=y
++CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=10
++# CONFIG_SCHED_DEBUG is not set
++# CONFIG_DEBUG_PREEMPT is not set
++# CONFIG_FTRACE is not set
+diff --git a/arch/arc/plat-axs10x/Kconfig b/arch/arc/plat-axs10x/Kconfig
+new file mode 100644
+index 0000000..45641ca
+--- /dev/null
++++ b/arch/arc/plat-axs10x/Kconfig
+@@ -0,0 +1,35 @@
++#
++# Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License version 2 as
++# published by the Free Software Foundation.
++#
++
++config ARC_PLAT_AXS10X
++	bool "Synopsys ARC AXS10x Software Development Platforms"
++	select DW_APB_ICTL
++	select GPIO_DWAPB
++	select OF_GPIO
++	select GENERIC_IRQ_CHIP
++	select ARCH_REQUIRE_GPIOLIB
++	help
++	  Support for the ARC AXS10x Software Development Platforms.
++
++	  The AXS10x Platforms consist of a mainboard with peripherals,
++	  on which several daughter cards can be placed. The daughter cards
++	  typically contain a CPU and memory.
++
++if ARC_PLAT_AXS10X
++
++config AXS101
++	bool "AXS101 with AXC001 CPU Card (ARC 770D/EM6/AS221)"
++	help
++	  This adds support for the 770D/EM6/AS221 CPU Card. Only the ARC
++	  770D is supported in Linux.
++
++	  The AXS101 Platform consists of an AXS10x mainboard with
++	  this daughtercard. Please use the axs101.dts device tree
++	  with this configuration.
++
++endif
+diff --git a/arch/arc/plat-axs10x/Makefile b/arch/arc/plat-axs10x/Makefile
+new file mode 100644
+index 0000000..d4748f2
+--- /dev/null
++++ b/arch/arc/plat-axs10x/Makefile
+@@ -0,0 +1,9 @@
++#
++# Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License version 2 as
++# published by the Free Software Foundation.
++#
++
++obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x.o
+diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c
+new file mode 100644
+index 0000000..2e7686d
+--- /dev/null
++++ b/arch/arc/plat-axs10x/axs10x.c
+@@ -0,0 +1,298 @@
++/*
++ * AXS101 Software Development Platform
++ *
++ * Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com)
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ */
++
++#include <linux/of_platform.h>
++#include <asm/mach_desc.h>
++#include <asm/io.h>
++
++#define AXS_MB_CGU		0xE0010000
++#define AXS_MB_CREG		0xE0011000
++
++#define CREG_MB_IRQ_MUX		(AXS_MB_CREG + 0x214)
++#define CREG_MB_SW_RESET	(AXS_MB_CREG + 0x220)
++#define CREG_MB_VER		(AXS_MB_CREG + 0x230)
++#define CREG_MB_CONFIG		(AXS_MB_CREG + 0x234)
++
++#define AXC001_CREG		0xF0001000
++#define AXC001_GPIO_INTC	0xF0003000
++
++#define CREG_CPU_ADDR_770	(AXC001_CREG + 0x20)
++#define CREG_CPU_ADDR_TUNN	(AXC001_CREG + 0x60)
++#define CREG_CPU_ADDR_770_UPD	(AXC001_CREG + 0x34)
++#define CREG_CPU_ADDR_TUNN_UPD	(AXC001_CREG + 0x74)
++
++#define CREG_CPU_ARC770_IRQ_MUX	(AXC001_CREG + 0x114)
++#define CREG_CPU_GPIO_UART_MUX	(AXC001_CREG + 0x120)
++
++static void enable_gpio_intc_wire(void)
++{
++	/*
++	 * Peripherals on CPU Card and Mother Board are wired to cpu intc via
++	 * intermediate DW APB GPIO blocks (mainly for debouncing)
++	 *
++	 *         ---------------------
++	 *        |  snps,arc700-intc |
++	 *        ---------------------
++	 *          | #7          | #15
++	 * -------------------   -------------------
++	 * | snps,dw-apb-gpio |  | snps,dw-apb-gpio |
++	 * -------------------   -------------------
++	 *        |                         |
++	 *        |                 [ Debug UART on cpu card ]
++	 *        |
++	 * ------------------------
++	 * | snps,dw-apb-intc (MB)|
++	 * ------------------------
++	 *  |      |       |      |
++	 * [eth] [uart]        [... other perip on Main Board]
++	 *
++	 * Current implementation of "irq-dw-apb-ictl" driver doesn't work well
++	 * with stacked INTCs. In particular problem happens if its master INTC
++	 * not yet instantiated. See discussion here -
++	 * https://lkml.org/lkml/2015/3/4/755
++	 *
++	 * So setup the first gpio block as a passive pass thru and hide it from
++	 * DT hardware topology - connect MB intc directly to cpu intc
++	 * The GPIO "wire" needs to be init nevertheless (here)
++	 *
++	 * One side adv is that peripheral interrupt handling avoids one nested
++	 * intc ISR hop
++	 */
++#define GPIO_INTEN		(AXC001_GPIO_INTC + 0x30)
++#define GPIO_INTMASK		(AXC001_GPIO_INTC + 0x34)
++#define GPIO_INTTYPE_LEVEL	(AXC001_GPIO_INTC + 0x38)
++#define GPIO_INT_POLARITY	(AXC001_GPIO_INTC + 0x3c)
++#define MB_TO_GPIO_IRQ		12
++
++	iowrite32(~(1 << MB_TO_GPIO_IRQ), (void __iomem *) GPIO_INTMASK);
++	iowrite32(0, (void __iomem *) GPIO_INTTYPE_LEVEL);
++	iowrite32(~0, (void __iomem *) GPIO_INT_POLARITY);
++	iowrite32(1 << MB_TO_GPIO_IRQ, (void __iomem *) GPIO_INTEN);
++}
++
++static void axs10x_print_board_ver(unsigned int creg, const char *str)
++{
++	union ver {
++		struct {
++#ifdef CONFIG_CPU_BIG_ENDIAN
++			unsigned int pad:11, y:12, m:4, d:5;
++#else
++			unsigned int d:5, m:4, y:12, pad:11;
++#endif
++		};
++		unsigned int val;
++	} board;
++
++	board.val = ioread32((void __iomem *)creg);
++	pr_info("AXS: %s FPGA Date: %u-%u-%u\n", str, board.d, board.m,
++		board.y);
++}
++
++static void axs10x_early_init(void)
++{
++	int mb_rev;
++	char mb[32];
++
++	/* Determine motherboard version */
++	if (ioread32((void __iomem *) CREG_MB_CONFIG) & (1 << 28))
++		mb_rev = 3;	/* HT-3 (rev3.0) */
++	else
++		mb_rev = 2;	/* HT-2 (rev2.0) */
++
++	enable_gpio_intc_wire();
++
++	scnprintf(mb, 32, "MainBoard v%d", mb_rev);
++	axs10x_print_board_ver(CREG_MB_VER, mb);
++}
++
++/*
++ * Set up System Memory Map for ARC cpu / peripherals controllers
++ *
++ * Each AXI master has a 4GB memory map specified as 16 apertures of 256MB, each
++ * of which maps to a corresponding 256MB aperture in Target slave memory map.
++ *
++ * e.g. ARC cpu AXI Master's aperture 8 (0x8000_0000) is mapped to aperture 0
++ * (0x0000_0000) of DDR Port 0 (slave #1)
++ *
++ * Access from cpu to MB controllers such as GMAC is setup using AXI Tunnel:
++ * which has master/slaves on both ends.
++ * e.g. aperture 14 (0xE000_0000) of ARC cpu is mapped to aperture 14
++ * (0xE000_0000) of CPU Card AXI Tunnel slave (slave #3) which is mapped to
++ * MB AXI Tunnel Master, which also has a mem map setup
++ *
++ * In the reverse direction, MB AXI Masters (e.g. GMAC) mem map is setup
++ * to map to MB AXI Tunnel slave which connects to CPU Card AXI Tunnel Master
++ */
++struct aperture {
++	unsigned int slave_sel:4, slave_off:4, pad:24;
++};
++
++/* CPU Card target slaves */
++#define AXC001_SLV_NONE			0
++#define AXC001_SLV_DDR_PORT0		1
++#define AXC001_SLV_SRAM			2
++#define AXC001_SLV_AXI_TUNNEL		3
++#define AXC001_SLV_AXI2APB		6
++#define AXC001_SLV_DDR_PORT1		7
++
++/* MB AXI Target slaves */
++#define AXS_MB_SLV_NONE			0
++#define AXS_MB_SLV_AXI_TUNNEL_CPU	1
++#define AXS_MB_SLV_AXI_TUNNEL_HAPS	2
++#define AXS_MB_SLV_SRAM			3
++#define AXS_MB_SLV_CONTROL		4
++
++/* MB AXI masters */
++#define AXS_MB_MST_TUNNEL_CPU		0
++#define AXS_MB_MST_USB_OHCI		10
++
++/*
++ * memmap for ARC core on CPU Card
++ */
++static const struct aperture axc001_memmap[16] = {
++	{AXC001_SLV_AXI_TUNNEL,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0x1},
++	{AXC001_SLV_SRAM,		0x0}, /* 0x2000_0000: Local SRAM */
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_DDR_PORT0,		0x0}, /* 0x8000_0000: DDR   0..256M */
++	{AXC001_SLV_DDR_PORT0,		0x1}, /* 0x9000_0000: DDR 256..512M */
++	{AXC001_SLV_DDR_PORT1,		0x0},
++	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0xD},
++	{AXC001_SLV_AXI_TUNNEL,		0xE}, /* MB: CREG, CGU... */
++	{AXC001_SLV_AXI2APB,		0x0}, /* CPU Card local CREG, CGU... */
++};
++
++/*
++ * memmap for CPU Card AXI Tunnel Master (for access by MB controllers)
++ * GMAC (MB) -> MB AXI Tunnel slave -> CPU Card AXI Tunnel Master -> DDR
++ */
++static const struct aperture axc001_axi_tunnel_memmap[16] = {
++	{AXC001_SLV_AXI_TUNNEL,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0x1},
++	{AXC001_SLV_SRAM,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_DDR_PORT0,		0x0},
++	{AXC001_SLV_DDR_PORT0,		0x1},
++	{AXC001_SLV_DDR_PORT1,		0x0},
++	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_NONE,		0x0},
++	{AXC001_SLV_AXI_TUNNEL,		0xD},
++	{AXC001_SLV_AXI_TUNNEL,		0xE},
++	{AXC001_SLV_AXI2APB,		0x0},
++};
++
++/*
++ * memmap for MB AXI Masters
++ * Same mem map for all perip controllers as well as MB AXI Tunnel Master
++ */
++static const struct aperture axs_mb_memmap[16] = {
++	{AXS_MB_SLV_SRAM,		0x0},
++	{AXS_MB_SLV_SRAM,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0x8},	/* DDR on CPU Card */
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0x9},	/* DDR on CPU Card */
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xA},
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xB},
++	{AXS_MB_SLV_NONE,		0x0},
++	{AXS_MB_SLV_AXI_TUNNEL_HAPS,	0xD},
++	{AXS_MB_SLV_CONTROL,		0x0},	/* MB Local CREG, CGU... */
++	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xF},
++};
++
++static noinline void
++axs101_set_memmap(void __iomem *base, const struct aperture map[16])
++{
++	unsigned int slave_select, slave_offset;
++	int i;
++
++	slave_select = slave_offset = 0;
++	for (i = 0; i < 8; i++) {
++		slave_select |= map[i].slave_sel << (i << 2);
++		slave_offset |= map[i].slave_off << (i << 2);
++	}
++
++	iowrite32(slave_select, base + 0x0);	/* SLV0 */
++	iowrite32(slave_offset, base + 0x8);	/* OFFSET0 */
++
++	slave_select = slave_offset = 0;
++	for (i = 0; i < 8; i++) {
++		slave_select |= map[i+8].slave_sel << (i << 2);
++		slave_offset |= map[i+8].slave_off << (i << 2);
++	}
++
++	iowrite32(slave_select, base + 0x4);	/* SLV1 */
++	iowrite32(slave_offset, base + 0xC);	/* OFFSET1 */
++}
++
++static void axs101_early_init(void)
++{
++	int i;
++
++	/* ARC 770D memory view */
++	axs101_set_memmap((void __iomem *) CREG_CPU_ADDR_770, axc001_memmap);
++	iowrite32(1, (void __iomem *) CREG_CPU_ADDR_770_UPD);
++
++	/* AXI tunnel memory map (incoming traffic from MB into CPU Card */
++	axs101_set_memmap((void __iomem *) CREG_CPU_ADDR_TUNN,
++			      axc001_axi_tunnel_memmap);
++	iowrite32(1, (void __iomem *) CREG_CPU_ADDR_TUNN_UPD);
++
++	/* MB peripherals memory map */
++	for (i = AXS_MB_MST_TUNNEL_CPU; i <= AXS_MB_MST_USB_OHCI; i++)
++		axs101_set_memmap((void __iomem *) AXS_MB_CREG + (i << 4),
++				      axs_mb_memmap);
++
++	iowrite32(0x3ff, (void __iomem *) AXS_MB_CREG + 0x100); /* Update */
++
++	/* GPIO pins 18 and 19 are used as UART rx and tx, respectively. */
++	iowrite32(0x01, (void __iomem *) CREG_CPU_GPIO_UART_MUX);
++
++	/* Set up the MB interrupt system: mux interrupts to GPIO7) */
++	iowrite32(0x01, (void __iomem *) CREG_MB_IRQ_MUX);
++
++	/* reset ethernet and ULPI interfaces */
++	iowrite32(0x18, (void __iomem *) CREG_MB_SW_RESET);
++
++	/* map GPIO 14:10 to ARC 9:5 (IRQ mux change for MB v2 onwards) */
++	iowrite32(0x52, (void __iomem *) CREG_CPU_ARC770_IRQ_MUX);
++
++	axs10x_early_init();
++}
++
++static const char *axs101_compat[] __initconst = {
++	"snps,axs101",
++	NULL,
++};
++
++MACHINE_START(AXS101, "axs101")
++	.dt_compat	= axs101_compat,
++	.init_early	= axs101_early_init,
++MACHINE_END
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch b/target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
new file mode 100644
index 0000000..171000c
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0002-ARC-axs101-Tweak-DDR-port-aperture-mappings-for-perf.patch
@@ -0,0 +1,65 @@ 
+From c38cc2a321a9cd2dfbd6be45c85e7bd4ea11febd Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta@synopsys.com>
+Date: Tue, 27 May 2014 19:27:37 +0530
+Subject: [PATCH 2/4] ARC: [axs101] Tweak DDR port aperture mappings for
+ performance
+
+Route all MB originated traffic to DDR Port 1 and keep Port 0 for CPU
+traffic only
+
+Basic system parameters
+--------------------------------------------------------------------------------------
+        Host                 OS Description 				Mhz  tlb   cache  mem   scal
+                                                			    pages  line   par   load
+                                                      				   bytes
+----------------- ------------- --------------------------------------- ---- ----- ----- ------ ----
+axs101-sd-2-new-f Linux 3.13.0+ axs101-sd-2-new-fw-old-img-rerun    	739  	8    32 1.1100    1
+axs101-sd-3-arc-3 Linux 3.13.9+ axs101-sd-3-arc-3.13-tip-regression 	735  	8    32 1.1000    1
+axs101-sd-9-diffe Linux 3.13.11 axs101-sd-9-different-tweak         	740  	8    32 1.0000    1
+
+Processor, Processes - times in microseconds - smaller is better
+------------------------------------------------------------------------------
+Host                 OS  Mhz null null      open slct sig  sig  fork exec sh
+                             call  I/O stat clos TCP  inst hndl proc proc proc
+--------- ------------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+axs101-sd Linux 3.13.0+  739 0.50 0.88 5.38 14.6 34.1 0.92 5.18 2135 6555 12.K
+axs101-sd Linux 3.13.9+  735 0.50 0.90 5.89 19.2 81.4 0.94 4.08 2560 8559 15.K
+axs101-sd Linux 3.13.11  740 0.50 0.88 4.45 17.8 34.4 0.94 3.25 2052 6493 12.K
+                                                 ^^^^                     ^^^^
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+---
+ arch/arc/plat-axs10x/axs10x.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c
+index 2e7686d..759a7a1 100644
+--- a/arch/arc/plat-axs10x/axs10x.c
++++ b/arch/arc/plat-axs10x/axs10x.c
+@@ -173,8 +173,8 @@ static const struct aperture axc001_memmap[16] = {
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_DDR_PORT0,		0x0}, /* 0x8000_0000: DDR   0..256M */
+ 	{AXC001_SLV_DDR_PORT0,		0x1}, /* 0x9000_0000: DDR 256..512M */
+-	{AXC001_SLV_DDR_PORT1,		0x0},
+-	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_DDR_PORT0,		0x2},
++	{AXC001_SLV_DDR_PORT0,		0x3},
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xD},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xE}, /* MB: CREG, CGU... */
+@@ -194,10 +194,10 @@ static const struct aperture axc001_axi_tunnel_memmap[16] = {
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_NONE,		0x0},
+-	{AXC001_SLV_DDR_PORT0,		0x0},
+-	{AXC001_SLV_DDR_PORT0,		0x1},
+ 	{AXC001_SLV_DDR_PORT1,		0x0},
+ 	{AXC001_SLV_DDR_PORT1,		0x1},
++	{AXC001_SLV_DDR_PORT1,		0x2},
++	{AXC001_SLV_DDR_PORT1,		0x3},
+ 	{AXC001_SLV_NONE,		0x0},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xD},
+ 	{AXC001_SLV_AXI_TUNNEL,		0xE},
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch b/target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
new file mode 100644
index 0000000..7bf28de
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0003-ARC-axs101-Add-missing-__init-annotations.patch
@@ -0,0 +1,71 @@ 
+From f6fddfaa10c334281744258a7b7056539c3fa518 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta@synopsys.com>
+Date: Sun, 7 Jun 2015 11:17:34 +0530
+Subject: [PATCH 3/4] ARC: [axs101] Add missing __init annotations
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+---
+ arch/arc/plat-axs10x/axs10x.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arc/plat-axs10x/axs10x.c b/arch/arc/plat-axs10x/axs10x.c
+index 759a7a1..a1cecda 100644
+--- a/arch/arc/plat-axs10x/axs10x.c
++++ b/arch/arc/plat-axs10x/axs10x.c
+@@ -37,7 +37,7 @@
+ #define CREG_CPU_ARC770_IRQ_MUX	(AXC001_CREG + 0x114)
+ #define CREG_CPU_GPIO_UART_MUX	(AXC001_CREG + 0x120)
+ 
+-static void enable_gpio_intc_wire(void)
++static void __init axs10x_enable_gpio_intc_wire(void)
+ {
+ 	/*
+ 	 * Peripherals on CPU Card and Mother Board are wired to cpu intc via
+@@ -83,7 +83,7 @@ static void enable_gpio_intc_wire(void)
+ 	iowrite32(1 << MB_TO_GPIO_IRQ, (void __iomem *) GPIO_INTEN);
+ }
+ 
+-static void axs10x_print_board_ver(unsigned int creg, const char *str)
++static void __init axs10x_print_board_ver(unsigned int creg, const char *str)
+ {
+ 	union ver {
+ 		struct {
+@@ -101,7 +101,7 @@ static void axs10x_print_board_ver(unsigned int creg, const char *str)
+ 		board.y);
+ }
+ 
+-static void axs10x_early_init(void)
++static void __init axs10x_early_init(void)
+ {
+ 	int mb_rev;
+ 	char mb[32];
+@@ -112,7 +112,7 @@ static void axs10x_early_init(void)
+ 	else
+ 		mb_rev = 2;	/* HT-2 (rev2.0) */
+ 
+-	enable_gpio_intc_wire();
++	axs10x_enable_gpio_intc_wire();
+ 
+ 	scnprintf(mb, 32, "MainBoard v%d", mb_rev);
+ 	axs10x_print_board_ver(CREG_MB_VER, mb);
+@@ -227,7 +227,7 @@ static const struct aperture axs_mb_memmap[16] = {
+ 	{AXS_MB_SLV_AXI_TUNNEL_CPU,	0xF},
+ };
+ 
+-static noinline void
++static noinline void __init
+ axs101_set_memmap(void __iomem *base, const struct aperture map[16])
+ {
+ 	unsigned int slave_select, slave_offset;
+@@ -252,7 +252,7 @@ axs101_set_memmap(void __iomem *base, const struct aperture map[16])
+ 	iowrite32(slave_offset, base + 0xC);	/* OFFSET1 */
+ }
+ 
+-static void axs101_early_init(void)
++static void __init axs101_early_init(void)
+ {
+ 	int i;
+ 
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch b/target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
new file mode 100644
index 0000000..0b4dc9f
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0004-ARC-RIP-broken-64bit-RTSC.patch
@@ -0,0 +1,186 @@ 
+From e7bb2d5eca38f10aa9c49506ede6f8736d89d038 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta@synopsys.com>
+Date: Sat, 7 Mar 2015 17:06:09 +0530
+Subject: [PATCH 4/4] ARC: RIP broken 64bit RTSC
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+---
+ arch/arc/Kconfig                    |  6 -----
+ arch/arc/Makefile                   |  2 +-
+ arch/arc/configs/nsim_700_defconfig |  1 -
+ arch/arc/configs/nsimosci_defconfig |  1 -
+ arch/arc/configs/tb10x_defconfig    |  1 -
+ arch/arc/kernel/setup.c             |  8 ++----
+ arch/arc/kernel/time.c              | 49 +------------------------------------
+ 7 files changed, 4 insertions(+), 64 deletions(-)
+
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index 13d4c26..cf96ef2 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -324,12 +324,6 @@ config ARC_HAS_SWAPE
+ 	default y
+ 	depends on ARC_CPU_REL_4_10
+ 
+-config ARC_HAS_RTSC
+-	bool "Insn: RTSC (64-bit r/o cycle counter)"
+-	default y
+-	depends on ARC_CPU_REL_4_10
+-	depends on !SMP
+-
+ endmenu   # "ARC CPU Configuration"
+ 
+ config LINUX_LINK_BASE
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile
+index 562ac7d..547f375 100644
+--- a/arch/arc/Makefile
++++ b/arch/arc/Makefile
+@@ -33,7 +33,7 @@ cflags-$(atleast_gcc44)			+= -fsection-anchors
+ 
+ cflags-$(CONFIG_ARC_HAS_LLSC)		+= -mlock
+ cflags-$(CONFIG_ARC_HAS_SWAPE)		+= -mswape
+-cflags-$(CONFIG_ARC_HAS_RTSC)		+= -mrtsc
++
+ cflags-$(CONFIG_ARC_DW2_UNWIND)		+= -fasynchronous-unwind-tables
+ 
+ # By default gcc 4.8 generates dwarf4 which kernel unwinder can't grok
+diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig
+index ef4d3bc..33eaaa9 100644
+--- a/arch/arc/configs/nsim_700_defconfig
++++ b/arch/arc/configs/nsim_700_defconfig
+@@ -23,7 +23,6 @@ CONFIG_MODULES=y
+ # CONFIG_IOSCHED_DEADLINE is not set
+ # CONFIG_IOSCHED_CFQ is not set
+ CONFIG_ARC_PLAT_FPGA_LEGACY=y
+-# CONFIG_ARC_HAS_RTSC is not set
+ CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
+ CONFIG_PREEMPT=y
+ # CONFIG_COMPACTION is not set
+diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig
+index d2ac4e5..59238b4 100644
+--- a/arch/arc/configs/nsimosci_defconfig
++++ b/arch/arc/configs/nsimosci_defconfig
+@@ -24,7 +24,6 @@ CONFIG_MODULES=y
+ # CONFIG_IOSCHED_DEADLINE is not set
+ # CONFIG_IOSCHED_CFQ is not set
+ CONFIG_ARC_PLAT_FPGA_LEGACY=y
+-# CONFIG_ARC_HAS_RTSC is not set
+ CONFIG_ARC_BUILTIN_DTB_NAME="nsimosci"
+ # CONFIG_COMPACTION is not set
+ CONFIG_NET=y
+diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig
+index 6be6492..fbed989 100644
+--- a/arch/arc/configs/tb10x_defconfig
++++ b/arch/arc/configs/tb10x_defconfig
+@@ -26,7 +26,6 @@ CONFIG_MODULE_UNLOAD=y
+ # CONFIG_BLOCK is not set
+ CONFIG_ARC_PLAT_TB10X=y
+ CONFIG_ARC_CACHE_LINE_SHIFT=5
+-# CONFIG_ARC_HAS_RTSC is not set
+ CONFIG_ARC_STACK_NONEXEC=y
+ CONFIG_HZ=250
+ CONFIG_ARC_BUILTIN_DTB_NAME="abilis_tb100_dvk"
+diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
+index 1d167c6..5086c75 100644
+--- a/arch/arc/kernel/setup.c
++++ b/arch/arc/kernel/setup.c
+@@ -180,10 +180,9 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len)
+ 		       (unsigned int)(arc_get_core_freq() / 1000000),
+ 		       (unsigned int)(arc_get_core_freq() / 10000) % 100);
+ 
+-	n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s%s%s\nISA Extn\t: ",
++	n += scnprintf(buf + n, len - n, "Timers\t\t: %s%s\nISA Extn\t: ",
+ 		       IS_AVAIL1(cpu->timers.t0, "Timer0 "),
+-		       IS_AVAIL1(cpu->timers.t1, "Timer1 "),
+-		       IS_AVAIL2(cpu->timers.rtsc, "64-bit RTSC ", CONFIG_ARC_HAS_RTSC));
++		       IS_AVAIL1(cpu->timers.t1, "Timer1 "));
+ 
+ 	n += i = scnprintf(buf + n, len - n, "%s%s",
+ 			   IS_AVAIL2(atomic, "atomic ", CONFIG_ARC_HAS_LLSC));
+@@ -254,9 +253,6 @@ static void arc_chk_core_config(void)
+ 	if (!cpu->timers.t1)
+ 		panic("Timer1 is not present!\n");
+ 
+-	if (IS_ENABLED(CONFIG_ARC_HAS_RTSC) && !cpu->timers.rtsc)
+-		panic("RTSC is not present\n");
+-
+ #ifdef CONFIG_ARC_HAS_DCCM
+ 	/*
+ 	 * DCCM can be arbit placed in hardware.
+diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
+index dbe74f4..9307f87 100644
+--- a/arch/arc/kernel/time.c
++++ b/arch/arc/kernel/time.c
+@@ -26,6 +26,7 @@
+  * while TIMER1 for free running (clocksource)
+  *
+  * Newer ARC700 cores have 64bit clk fetching RTSC insn, preferred over TIMER1
++ * which however is currently broken
+  */
+ 
+ #include <linux/spinlock.h>
+@@ -59,52 +60,6 @@
+ 
+ /********** Clock Source Device *********/
+ 
+-#ifdef CONFIG_ARC_HAS_RTSC
+-
+-int arc_counter_setup(void)
+-{
+-	/*
+-	 * For SMP this needs to be 0. However Kconfig glue doesn't
+-	 * enable this option for SMP configs
+-	 */
+-	return 1;
+-}
+-
+-static cycle_t arc_counter_read(struct clocksource *cs)
+-{
+-	unsigned long flags;
+-	union {
+-#ifdef CONFIG_CPU_BIG_ENDIAN
+-		struct { u32 high, low; };
+-#else
+-		struct { u32 low, high; };
+-#endif
+-		cycle_t  full;
+-	} stamp;
+-
+-	flags = arch_local_irq_save();
+-
+-	__asm__ __volatile(
+-	"	.extCoreRegister tsch, 58,  r, cannot_shortcut	\n"
+-	"	rtsc %0, 0	\n"
+-	"	mov  %1, 0	\n"
+-	: "=r" (stamp.low), "=r" (stamp.high));
+-
+-	arch_local_irq_restore(flags);
+-
+-	return stamp.full;
+-}
+-
+-static struct clocksource arc_counter = {
+-	.name   = "ARC RTSC",
+-	.rating = 300,
+-	.read   = arc_counter_read,
+-	.mask   = CLOCKSOURCE_MASK(32),
+-	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+-};
+-
+-#else /* !CONFIG_ARC_HAS_RTSC */
+-
+ static bool is_usable_as_clocksource(void)
+ {
+ #ifdef CONFIG_SMP
+@@ -139,8 +94,6 @@ static struct clocksource arc_counter = {
+ 	.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
+ };
+ 
+-#endif
+-
+ /********** Clock Event Device *********/
+ 
+ /*
+-- 
+2.4.3
+
diff --git a/target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch b/target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
new file mode 100644
index 0000000..53f8074
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0005-openwrt-arc-remove-dependency-on-DEVTMPFS.patch
@@ -0,0 +1,36 @@ 
+From 271777096a31e76b2ffd750bc44efde9656de857 Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin <abrodkin@synopsys.com>
+Date: Thu, 13 Aug 2015 01:56:02 +0300
+Subject: [PATCH] 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 <abrodkin@synopsys.com>
+---
+ arch/arc/Kconfig | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index cf96ef2..f0c6d4c 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -11,8 +11,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/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch b/target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch
new file mode 100644
index 0000000..1e8dbae
--- /dev/null
+++ b/target/linux/arc/patches-4.1/0006-ARC-axs101-support-early-8250-uart.patch
@@ -0,0 +1,67 @@ 
+From c9e83055b21edb14f7a82efe82d3f9a16f97b723 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta@synopsys.com>
+Date: Mon, 2 Feb 2015 19:23:21 +0530
+Subject: [PATCH] ARC: [axs101] support early 8250 uart
+
+Earlycon calculates UART clock as "BASE_BAUD * 16". In case of ARC
+"BASE_BAUD" is calculated dynamically in runtime, basically it is an
+alias to arc_early_base_baud(), which in turn just does
+"arc_base_baud/16".
+
+8250 UART on AXS/SDP board uses 33.3MHz clock source which is set in
+"arc_base_baud" with this change.
+
+Additional compatibility string "snps,arc-sdp" is introduced as well
+because there're different flavours of AXS boards but they all share the
+same motherboard and so it's possible to re-use the same code for
+motherbord even if CPU daughterboard changes.
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+---
+ Documentation/devicetree/bindings/arc/axs101.txt | 2 +-
+ arch/arc/boot/dts/axs101.dts                     | 4 ++--
+ arch/arc/kernel/devtree.c                        | 2 ++
+ 3 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/arc/axs101.txt b/Documentation/devicetree/bindings/arc/axs101.txt
+index 568aa5f..48290d5 100644
+--- a/Documentation/devicetree/bindings/arc/axs101.txt
++++ b/Documentation/devicetree/bindings/arc/axs101.txt
+@@ -4,4 +4,4 @@ Synopsys DesignWare ARC Software Development Platforms Device Tree Bindings
+ SDP Main Board with an AXC001 CPU Card hoisting ARC700 core in silicon
+ 
+ Required root node properties:
+-    - compatible = "snps,axs101";
++    - compatible = "snps,axs101", "snps,arc-sdp";
+diff --git a/arch/arc/boot/dts/axs101.dts b/arch/arc/boot/dts/axs101.dts
+index 6c3391d..3f9b058 100644
+--- a/arch/arc/boot/dts/axs101.dts
++++ b/arch/arc/boot/dts/axs101.dts
+@@ -13,9 +13,9 @@
+ /include/ "axs10x_mb.dtsi"
+ 
+ / {
+-	compatible = "snps,axs101";
++	compatible = "snps,axs101", "snps,arc-sdp";
+ 
+ 	chosen {
+-		bootargs = "console=tty0 console=ttyS3,115200n8 consoleblank=0";
++		bootargs = "earlycon=uart8250,mmio32,0xe0022000,115200n8 console=tty0 console=ttyS3,115200n8 consoleblank=0";
+ 	};
+ };
+diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
+index e32b54a..f801d46 100644
+--- a/arch/arc/kernel/devtree.c
++++ b/arch/arc/kernel/devtree.c
+@@ -32,6 +32,8 @@ static void __init arc_set_early_base_baud(unsigned long dt_root)
+ 
+ 	if (of_flat_dt_is_compatible(dt_root, "abilis,arc-tb10x"))
+ 		arc_base_baud = core_clk/3;
++	else if (of_flat_dt_is_compatible(dt_root, "snps,arc-sdp"))
++		arc_base_baud = 33333333;	/* Fixed 33MHz clk */
+ 	else
+ 		arc_base_baud = core_clk;
+ }
+-- 
+2.4.3
+