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

Alexey Brodkin Alexey.Brodkin at synopsys.com
Thu Aug 27 07:03:53 EDT 2015


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 at openwrt.org>
Cc: Jo-Philipp Wich <jow at openwrt.org>
Signed-off-by: Alexey Brodkin <abrodkin at 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 at 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 at 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 at synopsys.com>
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+Signed-off-by: Vineet Gupta <vgupta at 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 at 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 at 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 at 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 at 0x2000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = < 0x2000 0x80 >;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			ictl_intc: gpio-controller at 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 at 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 at 0x12000 {
++			#interrupt-cells = <1>;
++			compatible = "snps,dw-apb-ictl";
++			reg = < 0x12000 0x200 >;
++			interrupt-controller;
++			interrupt-parent = <&cpu_intc>;
++			interrupts = < 7 >;
++		};
++
++		ethernet at 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 at 0x40000 {
++			compatible = "generic-ehci";
++			reg = < 0x40000 0x100 >;
++			interrupts = < 8 >;
++		};
++
++		ohci at 0x60000 {
++			compatible = "generic-ohci";
++			reg = < 0x60000 0x100 >;
++			interrupts = < 8 >;
++		};
++
++		mmc at 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 at 0x20000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x20000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <17>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		uart at 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 at 0x22000 {
++			compatible = "snps,dw-apb-uart";
++			reg = <0x22000 0x100>;
++			clock-frequency = <33333333>;
++			interrupts = <19>;
++			baud = <115200>;
++			reg-shift = <2>;
++			reg-io-width = <4>;
++		};
++
++		i2c at 0x1d000 {
++			compatible = "snps,designware-i2c";
++			reg = <0x1d000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <14>;
++		};
++
++		i2c at 0x1e000 {
++			compatible = "snps,designware-i2c";
++			reg = <0x1e000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <15>;
++		};
++
++		i2c at 0x1f000 {
++			compatible = "snps,designware-i2c";
++			#address-cells = <1>;
++			#size-cells = <0>;
++			reg = <0x1f000 0x100>;
++			clock-frequency = <400000>;
++			clocks = <&i2cclk>;
++			interrupts = <16>;
++
++			eeprom at 0x54{
++				compatible = "24c01";
++				reg = <0x54>;
++				pagesize = <0x8>;
++			};
++
++			eeprom at 0x57{
++				compatible = "24c04";
++				reg = <0x57>;
++				pagesize = <0x8>;
++			};
++		};
++
++		gpio0:gpio at 13000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = <0x13000 0x1000>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			gpio0_banka: gpio-controller at 0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <32>;
++				reg = <0>;
++			};
++
++			gpio0_bankb: gpio-controller at 1 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <1>;
++			};
++
++			gpio0_bankc: gpio-controller at 2 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <8>;
++				reg = <2>;
++			};
++		};
++
++		gpio1:gpio at 14000 {
++			compatible = "snps,dw-apb-gpio";
++			reg = <0x14000 0x1000>;
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			gpio1_banka: gpio-controller at 0 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <30>;
++				reg = <0>;
++			};
++
++			gpio1_bankb: gpio-controller at 1 {
++				compatible = "snps,dw-apb-gpio-port";
++				gpio-controller;
++				#gpio-cells = <2>;
++				snps,nr-gpios = <10>;
++				reg = <1>;
++			};
++
++			gpio1_bankc: gpio-controller at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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
+
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list