summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-25 17:19:01 (GMT)
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2015-05-25 17:19:01 (GMT)
commitc6847d3f5be31fd644d6a41de147b4604852966e (patch)
tree192129bb2c530fe17fa7ab2339cff505d54f5029
parentd0b360fab8b74eb5ae912e4841ef0403dbabb981 (diff)
parent67e2da6a84f50c0b0e43f4d4fb9eae91671e81ad (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
-rw-r--r--mk/kernel-ver.mk6
-rw-r--r--mk/modules-4.0.mk6
-rw-r--r--mk/modules.mk4
-rw-r--r--package/ffmpeg/Makefile4
-rw-r--r--package/imx-gpu-viv/Makefile4
-rw-r--r--package/kodi/Makefile37
-rw-r--r--package/kodi/patches/patch-configure_in50
-rw-r--r--package/kodi/patches/patch-tools_Linux_kodi_sh_in39
-rw-r--r--package/kodi/patches/patch-tools_TexturePacker_Makefile_in13
-rw-r--r--package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp13
-rw-r--r--package/libcec/Makefile31
-rw-r--r--package/libcec/patches/libcec-imx6-support.patch831
-rw-r--r--package/libcec/patches/patch-src_cec-client_CMakeLists_txt10
-rw-r--r--package/libcec/patches/patch-src_lib_libcec_pc_in9
-rw-r--r--package/libcec/patches/patch-src_libcec_libcec_pc_in16
-rw-r--r--package/libsquish/Makefile25
-rw-r--r--package/libsquish/patches/patch-Makefile10
-rw-r--r--package/openssl/Makefile3
-rw-r--r--package/platform/Makefile25
-rw-r--r--package/swig/Makefile8
-rw-r--r--package/tinyxml/Makefile4
-rw-r--r--package/tinyxml/files/tinyxml.pc10
-rw-r--r--package/tmsnc/patches/patch-config_log797
-rw-r--r--package/uclibc-ng/Config.in.manual1
-rw-r--r--target/arm/solidrun-imx6/patches/3.14.43/solidrun.patch (renamed from target/arm/solidrun-imx6/patches/3.14.40/solidrun.patch)0
-rw-r--r--target/config/Config.in.kernelversion.choice4
-rw-r--r--target/config/Config.in.kernelversion.default2
-rw-r--r--target/linux/Config.in1
-rw-r--r--target/linux/config/Config.in.gpio10
-rw-r--r--target/linux/config/Config.in.serial11
-rw-r--r--target/linux/patches/3.14.43/bsd-compatibility.patch (renamed from target/linux/patches/3.14.40/bsd-compatibility.patch)0
-rw-r--r--target/linux/patches/3.14.43/cleankernel.patch (renamed from target/linux/patches/3.14.40/cleankernel.patch)0
-rw-r--r--target/linux/patches/3.14.43/defaults.patch (renamed from target/linux/patches/3.14.40/defaults.patch)0
-rw-r--r--target/linux/patches/3.14.43/disable-netfilter.patch (renamed from target/linux/patches/3.14.40/disable-netfilter.patch)0
-rw-r--r--target/linux/patches/3.14.43/export-symbol-for-exmap.patch (renamed from target/linux/patches/3.14.40/export-symbol-for-exmap.patch)0
-rw-r--r--target/linux/patches/3.14.43/fblogo.patch (renamed from target/linux/patches/3.14.40/fblogo.patch)0
-rw-r--r--target/linux/patches/3.14.43/gemalto.patch (renamed from target/linux/patches/3.14.40/gemalto.patch)0
-rw-r--r--target/linux/patches/3.14.43/initramfs-nosizelimit.patch (renamed from target/linux/patches/3.14.40/initramfs-nosizelimit.patch)0
-rw-r--r--target/linux/patches/3.14.43/lemote-rfkill.patch (renamed from target/linux/patches/3.14.40/lemote-rfkill.patch)0
-rw-r--r--target/linux/patches/3.14.43/microblaze-axi.patch (renamed from target/linux/patches/3.14.40/microblaze-axi.patch)0
-rw-r--r--target/linux/patches/3.14.43/microblaze-ethernet.patch (renamed from target/linux/patches/3.14.40/microblaze-ethernet.patch)0
-rw-r--r--target/linux/patches/3.14.43/mkpiggy.patch (renamed from target/linux/patches/3.14.40/mkpiggy.patch)0
-rw-r--r--target/linux/patches/3.14.43/mptcp.patch (renamed from target/linux/patches/3.14.40/mptcp.patch)0
-rw-r--r--target/linux/patches/3.14.43/mtd-rootfs.patch (renamed from target/linux/patches/3.14.40/mtd-rootfs.patch)0
-rw-r--r--target/linux/patches/3.14.43/nfsv3-tcp.patch (renamed from target/linux/patches/3.14.40/nfsv3-tcp.patch)0
-rw-r--r--target/linux/patches/3.14.43/non-static.patch (renamed from target/linux/patches/3.14.40/non-static.patch)0
-rw-r--r--target/linux/patches/3.14.43/ppc64-missing-zlib.patch (renamed from target/linux/patches/3.14.40/ppc64-missing-zlib.patch)0
-rw-r--r--target/linux/patches/3.14.43/regmap-boolean.patch (renamed from target/linux/patches/3.14.40/regmap-boolean.patch)0
-rw-r--r--target/linux/patches/3.14.43/relocs.patch (renamed from target/linux/patches/3.14.40/relocs.patch)0
-rw-r--r--target/linux/patches/3.14.43/sgidefs.patch (renamed from target/linux/patches/3.14.40/sgidefs.patch)0
-rw-r--r--target/linux/patches/3.14.43/sortext.patch (renamed from target/linux/patches/3.14.40/sortext.patch)0
-rw-r--r--target/linux/patches/3.14.43/startup.patch (renamed from target/linux/patches/3.14.40/startup.patch)0
-rw-r--r--target/linux/patches/3.14.43/wlan-cf.patch (renamed from target/linux/patches/3.14.40/wlan-cf.patch)0
-rw-r--r--target/linux/patches/3.14.43/xargs.patch (renamed from target/linux/patches/3.14.40/xargs.patch)0
-rw-r--r--target/linux/patches/3.14.43/yaffs2.patch (renamed from target/linux/patches/3.14.40/yaffs2.patch)0
-rw-r--r--target/linux/patches/3.14.43/zlib-inflate.patch (renamed from target/linux/patches/3.14.40/zlib-inflate.patch)0
-rw-r--r--target/linux/patches/4.0.3/cris32-serial.patch2886
-rw-r--r--target/m68k/qemu-m68k/patches/3.14.43/m68k-coldfire-fec.patch (renamed from target/m68k/qemu-m68k/patches/3.14.40/m68k-coldfire-fec.patch)0
-rw-r--r--target/m68k/qemu-m68k/patches/3.14.43/qemu-coldfire.patch (renamed from target/m68k/qemu-m68k/patches/3.14.40/qemu-coldfire.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0001-mtd-add-rb4xx-nand-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0001-mtd-add-rb4xx-nand-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0003-net-add-ag71xx-mac-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0003-net-add-ag71xx-mac-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0006-spi-add-rb4xx-SPI-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0006-spi-add-rb4xx-SPI-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0007-spi-add-rb4xx-cpld-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0007-spi-add-rb4xx-cpld-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0008-gpio-add-GPIO-latch-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0008-gpio-add-GPIO-latch-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0009-spi-export-spi_bitbang_bufs-function.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0009-spi-export-spi_bitbang_bufs-function.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0010-spi-add-type-field-to-spi_transfer-struct.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0010-spi-add-type-field-to-spi_transfer-struct.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0011-mtd-m25p80-set-SPI-transfer-type.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0011-mtd-m25p80-set-SPI-transfer-type.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0013-net-add-swconfig-support.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0013-net-add-swconfig-support.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0014-phy-add-detach-callback-to-struct-phy_driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0014-phy-add-detach-callback-to-struct-phy_driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0015-phy-add-ar8216-PHY-support.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0015-phy-add-ar8216-PHY-support.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0016-phy-mdio-bitbang-ignore-TA-value.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0016-phy-mdio-bitbang-ignore-TA-value.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0017-MIPS-ath79-fix-maximum-timeout.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0017-MIPS-ath79-fix-maximum-timeout.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0019-MIPS-ath79-process-board-cmdline-option.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0019-MIPS-ath79-process-board-cmdline-option.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0020-spi-ath79-add-fast-flash-read-support.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0020-spi-ath79-add-fast-flash-read-support.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0021-phy-add-mdio-boardinfo.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0021-phy-add-mdio-boardinfo.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0022-mips-ath79-add-ath79-ethernet-driver.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0022-mips-ath79-add-ath79-ethernet-driver.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0024-various-fixups-for-Werror.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0024-various-fixups-for-Werror.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0025-rb4xx_nand-add-partition-for-cfgfs.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0025-rb4xx_nand-add-partition-for-cfgfs.patch)0
-rw-r--r--target/mips/dragino-ms14s/patches/3.14.43/0026-various-fixups-for-ath5k-fixing-system-freezes.patch (renamed from target/mips/mikrotik-rb4xx/patches/3.14.40/0026-various-fixups-for-ath5k-fixing-system-freezes.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0001-mtd-add-rb4xx-nand-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0001-mtd-add-rb4xx-nand-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0003-net-add-ag71xx-mac-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0003-net-add-ag71xx-mac-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0006-spi-add-rb4xx-SPI-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0006-spi-add-rb4xx-SPI-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0007-spi-add-rb4xx-cpld-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0007-spi-add-rb4xx-cpld-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0008-gpio-add-GPIO-latch-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0008-gpio-add-GPIO-latch-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0009-spi-export-spi_bitbang_bufs-function.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0009-spi-export-spi_bitbang_bufs-function.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0010-spi-add-type-field-to-spi_transfer-struct.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0010-spi-add-type-field-to-spi_transfer-struct.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0011-mtd-m25p80-set-SPI-transfer-type.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0011-mtd-m25p80-set-SPI-transfer-type.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0013-net-add-swconfig-support.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0013-net-add-swconfig-support.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0014-phy-add-detach-callback-to-struct-phy_driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0014-phy-add-detach-callback-to-struct-phy_driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0015-phy-add-ar8216-PHY-support.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0015-phy-add-ar8216-PHY-support.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0016-phy-mdio-bitbang-ignore-TA-value.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0016-phy-mdio-bitbang-ignore-TA-value.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0017-MIPS-ath79-fix-maximum-timeout.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0017-MIPS-ath79-fix-maximum-timeout.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0019-MIPS-ath79-process-board-cmdline-option.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0019-MIPS-ath79-process-board-cmdline-option.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0020-spi-ath79-add-fast-flash-read-support.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0020-spi-ath79-add-fast-flash-read-support.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0021-phy-add-mdio-boardinfo.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0021-phy-add-mdio-boardinfo.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0022-mips-ath79-add-ath79-ethernet-driver.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0022-mips-ath79-add-ath79-ethernet-driver.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0024-various-fixups-for-Werror.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0024-various-fixups-for-Werror.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0025-rb4xx_nand-add-partition-for-cfgfs.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0025-rb4xx_nand-add-partition-for-cfgfs.patch)0
-rw-r--r--target/mips/mikrotik-rb4xx/patches/3.14.43/0026-various-fixups-for-ath5k-fixing-system-freezes.patch (renamed from target/mips/dragino-ms14s/patches/3.14.40/0026-various-fixups-for-ath5k-fixing-system-freezes.patch)0
-rw-r--r--target/mips/mikrotik-rb532/patches/3.14.43/rb532-cfgfs.patch (renamed from target/mips/mikrotik-rb532/patches/3.14.40/rb532-cfgfs.patch)0
-rw-r--r--target/mips/mikrotik-rb532/patches/3.14.43/rb532-pci.patch (renamed from target/mips/mikrotik-rb532/patches/3.14.40/rb532-pci.patch)0
-rw-r--r--toolchain/uclibc-ng/Makefile11
114 files changed, 3075 insertions, 1806 deletions
diff --git a/mk/kernel-ver.mk b/mk/kernel-ver.mk
index aae2450..437c998 100644
--- a/mk/kernel-ver.mk
+++ b/mk/kernel-ver.mk
@@ -16,11 +16,11 @@ KERNEL_MOD_VERSION:= $(KERNEL_VERSION)
KERNEL_RELEASE:= 1
KERNEL_HASH:= 82eab56bd3e416b12771908edbe000a8bf58d78da88457f716aab00dc07b8e1b
endif
-ifeq ($(ADK_KERNEL_VERSION_3_14_40),y)
-KERNEL_VERSION:= 3.14.40
+ifeq ($(ADK_KERNEL_VERSION_3_14_43),y)
+KERNEL_VERSION:= 3.14.43
KERNEL_MOD_VERSION:= $(KERNEL_VERSION)
KERNEL_RELEASE:= 1
-KERNEL_HASH:= 2a89cce6ca7c574f17d44dcb541036d29725a102dd047963b850ede2ed28b2f0
+KERNEL_HASH:= 6ecfa347c78b31b96a2ad282e2835315bc94d4ec52955e2e11b51be2dc6fafd4
endif
ifeq ($(ADK_KERNEL_VERSION_3_12_40),y)
KERNEL_VERSION:= 3.12.40
diff --git a/mk/modules-4.0.mk b/mk/modules-4.0.mk
new file mode 100644
index 0000000..425c180
--- /dev/null
+++ b/mk/modules-4.0.mk
@@ -0,0 +1,6 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+USBMODULES+=drivers/usb/common/usb-common
+USBMODULES+=drivers/usb/core/usbcore
+USBUDC:=gadget/udc
diff --git a/mk/modules.mk b/mk/modules.mk
index 91b31f0..0b14a54 100644
--- a/mk/modules.mk
+++ b/mk/modules.mk
@@ -1,6 +1,10 @@
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.
+ifeq ($(ADK_KERNEL_VERSION_4_0),y)
+include $(ADK_TOPDIR)/mk/modules-4.0.mk
+endif
+
ifeq ($(ADK_KERNEL_VERSION_3_19),y)
include $(ADK_TOPDIR)/mk/modules-3.19.mk
endif
diff --git a/package/ffmpeg/Makefile b/package/ffmpeg/Makefile
index 2a85119..b0fc609 100644
--- a/package/ffmpeg/Makefile
+++ b/package/ffmpeg/Makefile
@@ -4,9 +4,9 @@
include ${ADK_TOPDIR}/rules.mk
PKG_NAME:= ffmpeg
-PKG_VERSION:= 2.6.2
+PKG_VERSION:= 2.6.3
PKG_RELEASE:= 1
-PKG_HASH:= 889e3aa069b724dc95cbfc79ef83322a8a39d9f6225f39fad1b47294fc1f29ba
+PKG_HASH:= 59eb98c1b5896ac29abc0385f7c875d1b4942d695818818d418ee71eea1e0cfb
PKG_DESCR:= record, convert and stream audio & video
PKG_SECTION:= libs/video
PKG_FDEPENDS:= libpthread
diff --git a/package/imx-gpu-viv/Makefile b/package/imx-gpu-viv/Makefile
index df9ba77..bed3e11 100644
--- a/package/imx-gpu-viv/Makefile
+++ b/package/imx-gpu-viv/Makefile
@@ -27,8 +27,12 @@ imx-gpu-viv-install:
$(INSTALL_DIR) $(IDIR_IMX_GPU_VIV)/usr/lib
$(CP) $(WRKBUILD)/gpu-core/usr/lib/lib*.so* \
$(IDIR_IMX_GPU_VIV)/usr/lib
+ $(CP) $(WRKBUILD)/g2d/usr/lib/lib*.so* \
+ $(IDIR_IMX_GPU_VIV)/usr/lib
$(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/include
$(CP) $(WRKBUILD)/gpu-core/usr/include/* \
$(STAGING_TARGET_DIR)/usr/include
+ $(CP) $(WRKBUILD)/g2d/usr/include/* \
+ $(STAGING_TARGET_DIR)/usr/include
include ${ADK_TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/kodi/Makefile b/package/kodi/Makefile
index 330fd45..3bf0a03 100644
--- a/package/kodi/Makefile
+++ b/package/kodi/Makefile
@@ -4,11 +4,11 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= kodi
-PKG_VERSION:= 7cc53a9a3da77869d1d5d3d3d9971b4bd1641b50
-PKG_RELEASE:= 2
+PKG_VERSION:= ff25ea118e3580bb1ebcbb7c450ed933da1782be
+PKG_RELEASE:= 1
PKG_DESCR:= software media player
PKG_SECTION:= mm/video
-PKG_DEPENDS:= boost python2 libstdcxx glibc-gconv
+PKG_DEPENDS:= boost python2 libstdcxx glibc-gconv libsquish
PKG_DEPENDS+= libass libmpeg2 libmad libdbus libglew mesalib
PKG_DEPENDS+= libjpeg-turbo libogg libvorbis libmodplug libcurl
PKG_DEPENDS+= libflac libbz2 libtiff liblzo libopenssl libnettle
@@ -25,12 +25,12 @@ PKG_BUILDDEP+= libsamplerate taglib libjasper lame libmicrohttpd
PKG_BUILDDEP+= eudev alsa-lib glib glu libmodplug libgtk2
PKG_BUILDDEP+= libgpg-error dbus libxslt libvorbis
PKG_BUILDDEP+= swig-host sdl-host sdl-image-host liblzo-host
-PKG_BUILDDEP+= zip-host unzip-host
+PKG_BUILDDEP+= zip-host unzip-host libsquish
PKG_URL:= http://kodi.tv/
PKG_SITES:= https://github.com/xbmc/xbmc.git
PKG_FLAVOURS_KODI:= WITH_SMB WITH_NFS WITH_SSH WITH_AVAHI WITH_CEC
-PKG_FLAVOURS_KODI+= WITH_AFP WITH_WEBSERVER WITH_RTMP WITH_BLURAY
+PKG_FLAVOURS_KODI+= WITH_WEBSERVER WITH_RTMP WITH_BLURAY WITH_LIRC
PKGFD_WITH_SMB:= enable samba support
PKGFB_WITH_SMB:= samba
@@ -47,15 +47,15 @@ PKGFS_WITH_AVAHI:= libavahi
PKGFD_WITH_CEC:= enable cec support
PKGFB_WITH_CEC:= libcec
PKGFS_WITH_CEC:= libcec
-PKGFD_WITH_AFP:= enable afp support
-PKGFB_WITH_AFP:= afpfs-ng
-PKGFS_WITH_AFP:= libafpclient
PKGFD_WITH_RTMP:= enable rtmp support
PKGFB_WITH_RTMP:= rtmpdump
PKGFS_WITH_RTMP:= librtmp
PKGFD_WITH_BLURAY:= enable bluray support
PKGFB_WITH_BLURAY:= libbluray
PKGFS_WITH_BLURAY:= libbluray
+PKGFD_WITH_LIRC:= enable lirc support
+PKGFB_WITH_LIRC:= lirc
+PKGFS_WITH_LIRC:= lirc
PKGFD_WITH_WEBSERVER:= enable internal webserver support
# libiconv missing, freescale GL libraries linked against glibc
@@ -124,11 +124,6 @@ CONFIGURE_ARGS+= --enable-libbluray
else
CONFIGURE_ARGS+= --disable-libbluray
endif
-ifneq ($(ADK_PACKAGE_KODI_WITH_AFP),)
-CONFIGURE_ARGS+= --enable-afpclient
-else
-CONFIGURE_ARGS+= --disable-afpclient
-endif
ifneq ($(ADK_PACKAGE_KODI_WITH_SMB),)
CONFIGURE_ARGS+= --enable-samba
else
@@ -154,6 +149,11 @@ CONFIGURE_ARGS+= --enable-rtmp
else
CONFIGURE_ARGS+= --disable-rtmp
endif
+ifneq ($(ADK_PACKAGE_KODI_WITH_LIRC),)
+CONFIGURE_ARGS+= --enable-lirc
+else
+CONFIGURE_ARGS+= --disable-lirc
+endif
ifneq ($(ADK_PACKAGE_KODI_WITH_AVAHI),)
CONFIGURE_ARGS+= --enable-avahi
else
@@ -169,33 +169,30 @@ ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
CONFIGURE_ARGS+= --with-platform=raspberry-pi \
--enable-player=omxplayer \
--enable-gles \
- --disable-sdl \
--disable-x11
endif
ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y)
CONFIGURE_ARGS+= --with-platform=raspberry-pi \
--enable-player=omxplayer \
--enable-gles \
- --disable-sdl \
--disable-x11
endif
ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
CONFIGURE_ARGS+= --disable-x11 \
- --disable-sdl \
--enable-gles \
--enable-codec=imxvpu
endif
pre-configure:
(cd $(WRKBUILD)/lib/cpluff && env PATH='$(AUTOTOOL_PATH)' ./autogen.sh)
-
-pre-build:
- $(SED) "s#@@STAGING_HOST_DIR@@#$(STAGING_HOST_DIR)#" \
- $(WRKBUILD)/tools/TexturePacker/Makefile.in
PATH='$(HOST_PATH)' \
make CXX="${HOST_CXX}" CC="${HOST_CC}" CFLAGS="${HOST_CFLAGS}" \
CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \
-C $(WRKBUILD)/tools/depends/native/JsonSchemaBuilder
+ PATH='$(HOST_PATH)' \
+ make CXX="${HOST_CXX}" CC="${HOST_CC}" CFLAGS="${HOST_CFLAGS}" \
+ CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \
+ -C $(WRKBUILD)/tools/depends/native/TexturePacker
kodi-install:
$(INSTALL_DIR) $(IDIR_KODI)/usr/lib/kodi/addons
diff --git a/package/kodi/patches/patch-configure_in b/package/kodi/patches/patch-configure_in
deleted file mode 100644
index dfd4a32..0000000
--- a/package/kodi/patches/patch-configure_in
+++ /dev/null
@@ -1,50 +0,0 @@
---- xbmc-14.0-Helix.orig/configure.in 2014-12-22 17:11:35.000000000 -0600
-+++ xbmc-14.0-Helix/configure.in 2014-12-28 02:47:04.799045092 -0600
-@@ -55,13 +55,6 @@ AC_DEFUN([XB_ADD_CODEC],
- # check for library basenames
- AC_DEFUN([XB_FIND_SONAME],
- [
-- if echo "$host" | grep -q freebsd ; then
-- AC_MSG_CHECKING([for lib$2 soname])
-- $1_SONAME=[`ldconfig -r | sed -n "s;.* \(/.*lib$2\.so.*\)$;\1;p" | head -n 1`]
-- if test x$$1_SONAME != x ; then
-- $1_SONAME=[`basename $$1_SONAME`]
-- fi
-- elif [[ "$host_vendor" != "apple" ]]; then
- AC_MSG_CHECKING([for lib$2 soname])
- $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS $4 -l$2 -Wl,-M 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}')
- if [[ -z $$1_FILENAME ]]; then
-@@ -71,24 +64,6 @@ AC_DEFUN([XB_FIND_SONAME],
- if [[ ! -z $$1_FILENAME ]]; then
- $1_SONAME=$($OBJDUMP -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}')
- fi
-- else
-- AC_MSG_CHECKING([for lib$2 dylib])
-- gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`]
-- env_lib_path=[`echo $LDFLAGS | sed 's/-L[ ]*//g'`]
-- if test "$cross_compiling" = yes; then
-- host_lib_path=""
-- else
-- host_lib_path="/usr/lib /usr/local/lib"
-- fi
-- for path in $gcc_lib_path $env_lib_path $host_lib_path; do
-- lib=[`ls -- $path/lib$2.dylib 2>/dev/null`]
-- if test x$lib != x; then
-- # we want the path/name that is embedded in the dylib
-- $1_FILENAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`]
-- $1_SONAME=[`basename $$1_FILENAME`]
-- fi
-- done
-- fi
- if [[ -z "$$1_SONAME" ]]; then
- AC_MSG_RESULT([no])
- if test -z "$3" || test "x${$3}" = "xyes"; then
-@@ -1015,7 +990,7 @@ if test "$use_gles" = "yes"; then
- AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."])
- AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."])
- AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
-- LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util"
-+ LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lkhrn_static -lpthread -lm"
- else
- AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library))
- AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
diff --git a/package/kodi/patches/patch-tools_Linux_kodi_sh_in b/package/kodi/patches/patch-tools_Linux_kodi_sh_in
deleted file mode 100644
index 2d0e188..0000000
--- a/package/kodi/patches/patch-tools_Linux_kodi_sh_in
+++ /dev/null
@@ -1,39 +0,0 @@
---- kodi-14.0rc2.orig/tools/Linux/kodi.sh.in 2014-12-05 19:38:43.000000000 -0600
-+++ kodi-14.0rc2/tools/Linux/kodi.sh.in 2014-12-07 08:33:01.128418001 -0600
-@@ -86,15 +86,7 @@ print_crash_report()
- echo -n " Kernel: " >> $FILE
- uname -rvs >> $FILE
- echo -n " Release: " >> $FILE
-- if [ -f /etc/os-release ]; then
-- . /etc/os-release
-- echo $NAME $VERSION >> $FILE
-- elif command_exists lsb_release; then
-- echo >> $FILE
-- lsb_release -a 2> /dev/null | sed -e 's/^/ /' >> $FILE
-- else
-- echo "lsb_release not available" >> $FILE
-- fi
-+ echo OpenADK >> $FILE
- echo "############## END SYSTEM INFO ##############" >> $FILE
- echo >> $FILE
- echo "############### STACK TRACE #################" >> $FILE
-@@ -138,19 +130,6 @@ print_crash_report()
- }
-
- migrate_home
--python @datadir@/${bin_name}/FEH.py $SAVED_ARGS
--RET=$?
--if [ $RET -ne 0 ]; then
-- exit $RET
--fi
--
--if command_exists gdb; then
-- # Output warning in case ulimit is unsupported by shell
-- eval ulimit -c unlimited
-- if [ ! $? = "0" ]; then
-- echo "${bin_name}: ulimit is unsupported by this shell" 1>&2
-- fi
--fi
-
- LOOP=1
- while [ $(( $LOOP )) = "1" ]
diff --git a/package/kodi/patches/patch-tools_TexturePacker_Makefile_in b/package/kodi/patches/patch-tools_TexturePacker_Makefile_in
deleted file mode 100644
index 0fe1e08..0000000
--- a/package/kodi/patches/patch-tools_TexturePacker_Makefile_in
+++ /dev/null
@@ -1,13 +0,0 @@
---- xbmc-14.0-Helix.orig/tools/TexturePacker/Makefile.in 2014-12-22 17:11:35.000000000 -0600
-+++ xbmc-14.0-Helix/tools/TexturePacker/Makefile.in 2014-12-27 13:48:57.427472564 -0600
-@@ -33,5 +33,10 @@ $(TARGET): $(SRCS) @abs_top_srcdir@/xbmc
- # TexturePacker run native on build system, build it with native tools
- make -C @abs_top_srcdir@/lib/libsquish/ libsquish-native.so
- $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $(DEFINES) $(NATIVE_ARCH) $(SRCS) $(LDFLAGS_FOR_BUILD) -o $(TARGET)
-+ifeq ($(findstring Darwin,$(shell uname -s)),Darwin)
-+ install_name_tool -change /usr/lib/libSDL_image-1.2.0.dylib \
-+ /home/wbx/myapp/host_x86_64-linux-gnu/usr/lib/libSDL_image-1.2.0.dylib \
-+ $(TARGET)
-+endif
-
- include @abs_top_srcdir@/Makefile.include
diff --git a/package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp b/package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp
deleted file mode 100644
index 4f24390..0000000
--- a/package/kodi/patches/patch-xbmc_cores_dvdplayer_DVDDemuxers_DVDDemuxFFmpeg_cpp
+++ /dev/null
@@ -1,13 +0,0 @@
---- xbmc-14.0-Helix.orig/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp 2014-12-22 17:11:35.000000000 -0600
-+++ xbmc-14.0-Helix/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp 2014-12-25 13:38:23.629060371 -0600
-@@ -538,8 +538,8 @@ void CDVDDemuxFFmpeg::Reset()
- void CDVDDemuxFFmpeg::Flush()
- {
- // naughty usage of an internal ffmpeg function
-- if (m_pFormatContext)
-- av_read_frame_flush(m_pFormatContext);
-+ //if (m_pFormatContext)
-+ // av_read_frame_flush(m_pFormatContext);
-
- m_currentPts = DVD_NOPTS_VALUE;
-
diff --git a/package/libcec/Makefile b/package/libcec/Makefile
index 917aca3..dcbba4d 100644
--- a/package/libcec/Makefile
+++ b/package/libcec/Makefile
@@ -4,15 +4,14 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= libcec
-PKG_VERSION:= 2.2.0
-PKG_RELEASE:= 2
-PKG_HASH:= da8a0c5acf2f9134e38d7993c08d960b7da2a9ea6b6b557a9d788361884b8396
+PKG_VERSION:= 185559110dc88aeca0915a90b3b369d2d42c0f7c
+PKG_RELEASE:= 1
PKG_DESCR:= control your device with your tv remote control
PKG_SECTION:= libs/video
-PKG_DEPENDS:= libudev
-PKG_BUILDDEP:= eudev
+PKG_DEPENDS:= libudev libplatform
+PKG_BUILDDEP:= eudev cmake-host platform
PKG_URL:= http://libcec.pulse-eight.com/
-PKG_SITES:= http://openadk.org/distfiles/
+PKG_SITES:= https://github.com/Pulse-Eight/libcec.git
PKG_OPTS:= dev
PKG_DEPENDS_RASPBERRY_PI:= bcm28xx-vc
@@ -25,19 +24,13 @@ include $(ADK_TOPDIR)/mk/package.mk
$(eval $(call PKG_template,LIBCEC,libcec,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
-AUTOTOOL_STYLE:= autoreconf
-ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
-CONFIGURE_ARGS+= --enable-imx6
-endif
-ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
-CONFIGURE_ARGS+= --enable-rpi \
- --with-rpi-include-path=$(STAGING_TARGET_DIR)/opt/vc/include \
- --with-rpi-lib-path=$(STAGING_TARGET_DIR)/opt/vc/lib
-endif
-ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2),y)
-CONFIGURE_ARGS+= --enable-rpi \
- --with-rpi-include-path=$(STAGING_TARGET_DIR)/opt/vc/include \
- --with-rpi-lib-path=$(STAGING_TARGET_DIR)/opt/vc/lib
+WRKBUILD= $(WRKDIR)/$(PKG_NAME)-obj
+TARGET_LDFLAGS+= -ltinfo
+
+CONFIG_STYLE:= cmake
+CMAKE_FLAGS+= -DSKIP_PYTHON_WRAPPER=1 -DBUILD_SHARED_LIBS=1
+ifeq ($(ADK_TARGET_BOARD_BCM28XX),y)
+CMAKE_FLAGS+= -DHAVE_RPI_API=1
endif
libcec-install:
diff --git a/package/libcec/patches/libcec-imx6-support.patch b/package/libcec/patches/libcec-imx6-support.patch
deleted file mode 100644
index 8519abb..0000000
--- a/package/libcec/patches/libcec-imx6-support.patch
+++ /dev/null
@@ -1,831 +0,0 @@
-diff -Naur libcec-2.2.0/configure.ac libcec-2.2.0.patch/configure.ac
---- libcec-2.2.0/configure.ac 2014-11-01 01:51:37.000000000 +0100
-+++ libcec-2.2.0.patch/configure.ac 2014-11-10 23:14:45.210162950 +0100
-@@ -100,6 +100,14 @@
- esac
- fi
-
-+## i.MX6 support
-+AC_ARG_ENABLE([imx6],
-+ [AS_HELP_STRING([--enable-imx6],
-+ [enable support for freescale i.MX6 (default is no)])],
-+ [use_imx6=$enableval],
-+ [use_imx6=no])
-+
-+
- ## add the top dir and include to the include path, so we can include config.h and cec.h
- CPPFLAGS="$CPPFLAGS -I\$(abs_top_srcdir)/src -I\$(abs_top_srcdir)/include"
-
-@@ -306,6 +314,17 @@
- fi
-
-
-+## mark i.MX6 support as available
-+if test "x$use_imx6" != "xno"; then
-+ AC_DEFINE([HAVE_IMX_API],[1],[Define to 1 to include i.MX6 support])
-+ AM_CONDITIONAL(USE_IMX_API, true)
-+ features="$features\n i.MX6 support :\t\t\tyes"
-+ LIB_INFO="$LIB_INFO 'i.MX6'"
-+else
-+ AM_CONDITIONAL(USE_IMX_API, false)
-+ features="$features\n i.MX6 support :\t\t\tno"
-+fi
-+
- ## check if our build system is complete
- AC_CHECK_HEADER(algorithm,,AC_MSG_ERROR($msg_required_header_missing))
- AC_CHECK_HEADER(ctype.h,,AC_MSG_ERROR($msg_required_header_missing))
-diff -Naur libcec-2.2.0/include/cectypes.h libcec-2.2.0.patch/include/cectypes.h
---- libcec-2.2.0/include/cectypes.h 2014-10-28 16:20:50.000000000 +0100
-+++ libcec-2.2.0.patch/include/cectypes.h 2014-11-10 23:21:37.347945493 +0100
-@@ -307,6 +307,17 @@
- #define CEC_EXYNOS_VIRTUAL_COM "Exynos"
-
- /*!
-+ * the path to use for the i.MX CEC wire
-+ */
-+#define CEC_IMX_PATH "/dev/mxc_hdmi_cec"
-+
-+/*!
-+ * the name of the virtual COM port to use for the i.MX CEC wire
-+ */
-+#define CEC_IMX_VIRTUAL_COM "i.MX"
-+
-+
-+/*!
- * Mimimum client version
- */
- #define CEC_MIN_LIB_VERSION 2
-@@ -888,7 +899,8 @@
- ADAPTERTYPE_P8_DAUGHTERBOARD = 0x2,
- ADAPTERTYPE_RPI = 0x100,
- ADAPTERTYPE_TDA995x = 0x200,
-- ADAPTERTYPE_EXYNOS = 0x300
-+ ADAPTERTYPE_EXYNOS = 0x300,
-+ ADAPTERTYPE_IMX = 0x400
- } cec_adapter_type;
-
- typedef struct cec_menu_language
-diff -Naur libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp libcec-2.2.0.patch/src/lib/adapter/AdapterFactory.cpp
---- libcec-2.2.0/src/lib/adapter/AdapterFactory.cpp 2014-10-28 16:20:50.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/adapter/AdapterFactory.cpp 2014-11-10 23:18:08.761485552 +0100
-@@ -57,6 +57,11 @@
- #include "Exynos/ExynosCECAdapterCommunication.h"
- #endif
-
-+#if defined(HAVE_IMX_API)
-+#include "IMX/IMXCECAdapterDetection.h"
-+#include "IMX/IMXCECAdapterCommunication.h"
-+#endif
-+
- using namespace std;
- using namespace CEC;
-
-@@ -127,7 +132,22 @@
- #endif
-
-
--#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API)
-+
-+#if defined(HAVE_IMX_API)
-+ if (iAdaptersFound < iBufSize && CIMXCECAdapterDetection::FindAdapter() &&
-+ (!strDevicePath || !strcmp(strDevicePath, CEC_IMX_VIRTUAL_COM)))
-+ {
-+ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_IMX_PATH);
-+ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_IMX_VIRTUAL_COM);
-+ deviceList[iAdaptersFound].iVendorId = IMX_ADAPTER_VID;
-+ deviceList[iAdaptersFound].iProductId = IMX_ADAPTER_PID;
-+ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_IMX;
-+ iAdaptersFound++;
-+ }
-+#endif
-+
-+
-+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_IMX_API)
- #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration"
- #endif
-
-@@ -151,11 +171,16 @@
- return new CRPiCECAdapterCommunication(m_lib->m_cec);
- #endif
-
-+#if defined(HAVE_IMX_API)
-+ if (!strcmp(strPort, CEC_IMX_VIRTUAL_COM))
-+ return new CIMXCECAdapterCommunication(m_lib->m_cec);
-+#endif
-+
- #if defined(HAVE_P8_USB)
- return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate);
- #endif
-
--#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API)
-+#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_IMX_API)
- return NULL;
- #endif
- }
-diff -Naur libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h libcec-2.2.0.patch/src/lib/adapter/IMX/AdapterMessageQueue.h
---- libcec-2.2.0/src/lib/adapter/IMX/AdapterMessageQueue.h 1970-01-01 01:00:00.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/adapter/IMX/AdapterMessageQueue.h 2014-11-10 23:14:45.214162390 +0100
-@@ -0,0 +1,134 @@
-+#pragma once
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * This program is dual-licensed; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ * Alternatively, you can license this library under a commercial license,
-+ * please contact Pulse-Eight Licensing for more information.
-+ *
-+ * For more information contact:
-+ * Pulse-Eight Licensing <license@pulse-eight.com>
-+ * http://www.pulse-eight.com/
-+ * http://www.pulse-eight.net/
-+ */
-+
-+#include "lib/platform/threads/mutex.h"
-+
-+namespace CEC
-+{
-+ using namespace PLATFORM;
-+
-+ class CAdapterMessageQueueEntry
-+ {
-+ public:
-+ CAdapterMessageQueueEntry(const cec_command &command)
-+ : m_bWaiting(true), m_retval((uint32_t)-1), m_bSucceeded(false)
-+ {
-+ m_hash = hashValue(
-+ uint32_t(command.opcode_set ? command.opcode : CEC_OPCODE_NONE),
-+ command.initiator, command.destination);
-+ }
-+
-+ virtual ~CAdapterMessageQueueEntry(void) {}
-+
-+ /*!
-+ * @brief Query result from worker thread
-+ */
-+ uint32_t Result() const
-+ {
-+ return m_retval;
-+ }
-+
-+ /*!
-+ * @brief Signal waiting threads
-+ */
-+ void Broadcast(void)
-+ {
-+ CLockObject lock(m_mutex);
-+ m_condition.Broadcast();
-+ }
-+
-+ /*!
-+ * @brief Signal waiting thread(s) when message matches this entry
-+ */
-+ bool CheckMatch(uint32_t opcode, cec_logical_address initiator,
-+ cec_logical_address destination, uint32_t response)
-+ {
-+ uint32_t hash = hashValue(opcode, initiator, destination);
-+
-+ if (hash == m_hash)
-+ {
-+ CLockObject lock(m_mutex);
-+
-+ m_retval = response;
-+ m_bSucceeded = true;
-+ m_condition.Signal();
-+ return true;
-+ }
-+
-+ return false;
-+ }
-+
-+ /*!
-+ * @brief Wait for a response to this command.
-+ * @param iTimeout The timeout to use while waiting.
-+ * @return True when a response was received before the timeout passed, false otherwise.
-+ */
-+ bool Wait(uint32_t iTimeout)
-+ {
-+ CLockObject lock(m_mutex);
-+
-+ bool bReturn = m_bSucceeded ? true : m_condition.Wait(m_mutex, m_bSucceeded, iTimeout);
-+ m_bWaiting = false;
-+ return bReturn;
-+ }
-+
-+ /*!
-+ * @return True while a thread is waiting for a signal or isn't waiting yet, false otherwise.
-+ */
-+ bool IsWaiting(void)
-+ {
-+ CLockObject lock(m_mutex);
-+ return m_bWaiting;
-+ }
-+
-+ /*!
-+ * @return Hash value for given cec_command
-+ */
-+ static uint32_t hashValue(uint32_t opcode,
-+ cec_logical_address initiator,
-+ cec_logical_address destination)
-+ {
-+ return 1 | ((uint32_t)initiator << 8) |
-+ ((uint32_t)destination << 16) | ((uint32_t)opcode << 16);
-+ }
-+
-+ private:
-+ bool m_bWaiting; /**< true while a thread is waiting or when it hasn't started waiting yet */
-+ PLATFORM::CCondition<bool> m_condition; /**< the condition to wait on */
-+ PLATFORM::CMutex m_mutex; /**< mutex for changes to this class */
-+ uint32_t m_hash;
-+ uint32_t m_retval;
-+ bool m_bSucceeded;
-+ };
-+
-+};
-diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp
---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 1970-01-01 01:00:00.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.cpp 2014-11-10 23:14:45.217161982 +0100
-@@ -0,0 +1,328 @@
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
-+ *
-+ * You can redistribute this file and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ */
-+
-+#include "env.h"
-+
-+#if defined(HAVE_IMX_API)
-+#include "IMXCECAdapterCommunication.h"
-+
-+#include "lib/CECTypeUtils.h"
-+#include "lib/LibCEC.h"
-+#include "lib/platform/sockets/cdevsocket.h"
-+#include "lib/platform/util/StdString.h"
-+#include "lib/platform/util/buffer.h"
-+
-+/*
-+ * Ioctl definitions from kernel header
-+ */
-+#define HDMICEC_IOC_MAGIC 'H'
-+#define HDMICEC_IOC_SETLOGICALADDRESS _IOW(HDMICEC_IOC_MAGIC, 1, unsigned char)
-+#define HDMICEC_IOC_STARTDEVICE _IO(HDMICEC_IOC_MAGIC, 2)
-+#define HDMICEC_IOC_STOPDEVICE _IO(HDMICEC_IOC_MAGIC, 3)
-+#define HDMICEC_IOC_GETPHYADDRESS _IOR(HDMICEC_IOC_MAGIC, 4, unsigned char[4])
-+
-+#define MAX_CEC_MESSAGE_LEN 17
-+
-+#define MESSAGE_TYPE_RECEIVE_SUCCESS 1
-+#define MESSAGE_TYPE_NOACK 2
-+#define MESSAGE_TYPE_DISCONNECTED 3
-+#define MESSAGE_TYPE_CONNECTED 4
-+#define MESSAGE_TYPE_SEND_SUCCESS 5
-+
-+typedef struct hdmi_cec_event{
-+ int event_type;
-+ int msg_len;
-+ unsigned char msg[MAX_CEC_MESSAGE_LEN];
-+}hdmi_cec_event;
-+
-+
-+using namespace std;
-+using namespace CEC;
-+using namespace PLATFORM;
-+
-+#include "AdapterMessageQueue.h"
-+
-+#define LIB_CEC m_callback->GetLib()
-+
-+// these are defined in nxp private header file
-+#define CEC_MSG_SUCCESS 0x00 /*Message transmisson Succeed*/
-+#define CEC_CSP_OFF_STATE 0x80 /*CSP in Off State*/
-+#define CEC_BAD_REQ_SERVICE 0x81 /*Bad .req service*/
-+#define CEC_MSG_FAIL_UNABLE_TO_ACCESS 0x82 /*Message transmisson failed: Unable to access CEC line*/
-+#define CEC_MSG_FAIL_ARBITRATION_ERROR 0x83 /*Message transmisson failed: Arbitration error*/
-+#define CEC_MSG_FAIL_BIT_TIMMING_ERROR 0x84 /*Message transmisson failed: Bit timming error*/
-+#define CEC_MSG_FAIL_DEST_NOT_ACK 0x85 /*Message transmisson failed: Destination Address not aknowledged*/
-+#define CEC_MSG_FAIL_DATA_NOT_ACK 0x86 /*Message transmisson failed: Databyte not acknowledged*/
-+
-+
-+CIMXCECAdapterCommunication::CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback) :
-+ IAdapterCommunication(callback)/*,
-+ m_bLogicalAddressChanged(false)*/
-+{
-+ CLockObject lock(m_mutex);
-+
-+ m_iNextMessage = 0;
-+ //m_logicalAddresses.Clear();
-+ m_logicalAddress = CECDEVICE_UNKNOWN;
-+ m_bLogicalAddressRegistered = false;
-+ m_bInitialised = false;
-+ m_dev = new CCDevSocket(CEC_IMX_PATH);
-+}
-+
-+CIMXCECAdapterCommunication::~CIMXCECAdapterCommunication(void)
-+{
-+ Close();
-+
-+ CLockObject lock(m_mutex);
-+ delete m_dev;
-+ m_dev = 0;
-+}
-+
-+bool CIMXCECAdapterCommunication::IsOpen(void)
-+{
-+ return IsInitialised() && m_dev->IsOpen();
-+}
-+
-+bool CIMXCECAdapterCommunication::Open(uint32_t iTimeoutMs, bool UNUSED(bSkipChecks), bool bStartListening)
-+{
-+ if (m_dev->Open(iTimeoutMs))
-+ {
-+ if (!bStartListening || CreateThread()) {
-+ if (m_dev->Ioctl(HDMICEC_IOC_STARTDEVICE, NULL) == 0) {
-+ m_bInitialised = true;
-+ return true;
-+ }
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to start device\n", __func__);
-+ }
-+ m_dev->Close();
-+ }
-+
-+ return false;
-+}
-+
-+
-+void CIMXCECAdapterCommunication::Close(void)
-+{
-+ StopThread(0);
-+
-+ CLockObject lock(m_mutex);
-+ if (!m_bInitialised) {
-+ return;
-+ }
-+ if (m_dev->Ioctl(HDMICEC_IOC_STOPDEVICE, NULL) != 0) {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: Unable to stop device\n", __func__);
-+ }
-+ m_dev->Close();
-+ m_bInitialised = false;
-+}
-+
-+
-+std::string CIMXCECAdapterCommunication::GetError(void) const
-+{
-+ std::string strError(m_strError);
-+ return strError;
-+}
-+
-+
-+cec_adapter_message_state CIMXCECAdapterCommunication::Write(
-+ const cec_command &data, bool &UNUSED(bRetry), uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply))
-+{
-+ //cec_frame frame;
-+ unsigned char message[MAX_CEC_MESSAGE_LEN];
-+ int msg_len = 1;
-+ cec_adapter_message_state rc = ADAPTER_MESSAGE_STATE_ERROR;
-+
-+ if ((size_t)data.parameters.size + data.opcode_set + 1 > sizeof(message))
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: data size too large !", __func__);
-+ return ADAPTER_MESSAGE_STATE_ERROR;
-+ }
-+
-+ message[0] = (data.initiator << 4) | (data.destination & 0x0f);
-+ if (data.opcode_set)
-+ {
-+ message[1] = data.opcode;
-+ msg_len++;
-+ memcpy(&message[2], data.parameters.data, data.parameters.size);
-+ msg_len+=data.parameters.size;
-+ }
-+
-+ if (m_dev->Write(message, msg_len) == msg_len)
-+ {
-+ rc = ADAPTER_MESSAGE_STATE_SENT_ACKED;
-+ }
-+ else
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: sent command error !", __func__);
-+
-+ return rc;
-+}
-+
-+
-+uint16_t CIMXCECAdapterCommunication::GetFirmwareVersion(void)
-+{
-+ /* FIXME add ioctl ? */
-+ return 0;
-+}
-+
-+
-+cec_vendor_id CIMXCECAdapterCommunication::GetVendorId(void)
-+{
-+ return CEC_VENDOR_UNKNOWN;
-+}
-+
-+
-+uint16_t CIMXCECAdapterCommunication::GetPhysicalAddress(void)
-+{
-+ uint32_t info;
-+ uint16_t phy_addr;
-+
-+ if (m_dev->Ioctl(HDMICEC_IOC_GETPHYADDRESS, &info) != 0)
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_GETPHYADDRESS failed !", __func__);
-+ return CEC_INVALID_PHYSICAL_ADDRESS;
-+ }
-+ /* Rebuild 16 bit raw value from fsl 32 bits value */
-+ phy_addr = ((info & 0x0f) << 12) | (info & 0x0f00) |
-+ ((info & 0x0f0000) >> 12) | ((info & 0x0f000000) >> 24);
-+
-+ return phy_addr;
-+}
-+
-+
-+cec_logical_addresses CIMXCECAdapterCommunication::GetLogicalAddresses(void)
-+{
-+ cec_logical_addresses addresses;
-+ addresses.Clear();
-+
-+ CLockObject lock(m_mutex);
-+ if ((m_logicalAddress & (CECDEVICE_UNKNOWN | CECDEVICE_UNREGISTERED)) == 0)
-+ addresses.Set(m_logicalAddress);
-+
-+ return addresses;
-+}
-+
-+void CIMXCECAdapterCommunication::HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress))
-+{
-+ UnregisterLogicalAddress();
-+}
-+
-+bool CIMXCECAdapterCommunication::UnregisterLogicalAddress(void)
-+{
-+ CLockObject lock(m_mutex);
-+ if (!m_bLogicalAddressRegistered)
-+ return true;
-+
-+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, (void *)CECDEVICE_BROADCAST) != 0)
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__);
-+ return false;
-+ }
-+
-+ m_logicalAddress = CECDEVICE_UNKNOWN;
-+ m_bLogicalAddressRegistered = false;
-+ return true;
-+}
-+
-+bool CIMXCECAdapterCommunication::RegisterLogicalAddress(const cec_logical_address address)
-+{
-+ CLockObject lock(m_mutex);
-+
-+ if (m_logicalAddress == address && m_bLogicalAddressRegistered)
-+ {
-+ return true;
-+ }
-+
-+ if (m_dev->Ioctl(HDMICEC_IOC_SETLOGICALADDRESS, (void *)address) != 0)
-+ {
-+ LIB_CEC->AddLog(CEC_LOG_ERROR, "%s: HDMICEC_IOC_SETLOGICALADDRESS failed !", __func__);
-+ return false;
-+ }
-+
-+ m_logicalAddress = address;
-+ m_bLogicalAddressRegistered = true;
-+ return true;
-+}
-+
-+bool CIMXCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses)
-+{
-+ int log_addr = addresses.primary;
-+
-+ return RegisterLogicalAddress((cec_logical_address)log_addr);
-+}
-+
-+void *CIMXCECAdapterCommunication::Process(void)
-+{
-+ bool bHandled;
-+ hdmi_cec_event event;
-+ int ret;
-+
-+ uint32_t opcode, status;
-+ cec_logical_address initiator, destination;
-+
-+ while (!IsStopped())
-+ {
-+ ret = m_dev->Read((char *)&event, sizeof(event), 5000);
-+ if (ret > 0)
-+ {
-+
-+ initiator = cec_logical_address(event.msg[0] >> 4);
-+ destination = cec_logical_address(event.msg[0] & 0x0f);
-+
-+ //LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: Read data : type : %d initiator %d dest %d", __func__, event.event_type, initiator, destination);
-+ if (event.event_type == MESSAGE_TYPE_RECEIVE_SUCCESS)
-+ /* Message received */
-+ {
-+ cec_command cmd;
-+
-+ cec_command::Format(
-+ cmd, initiator, destination,
-+ ( event.msg_len > 1 ) ? cec_opcode(event.msg[1]) : CEC_OPCODE_NONE);
-+
-+ for( uint8_t i = 2; i < event.msg_len; i++ )
-+ cmd.parameters.PushBack(event.msg[i]);
-+
-+ if (!IsStopped())
-+ m_callback->OnCommandReceived(cmd);
-+ }
-+
-+ if (event.event_type == MESSAGE_TYPE_CONNECTED)
-+ /* HDMI has just been reconnected - Notify phy address*/
-+ {
-+ uint16_t iNewAddress = GetPhysicalAddress();
-+ m_callback->HandlePhysicalAddressChanged(iNewAddress);
-+ }
-+ /* We are not interested in other events */
-+ } /*else {
-+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s: Read returned %d", __func__, ret);
-+ }*/
-+
-+ }
-+
-+ return 0;
-+}
-+
-+#endif // HAVE_IMX_API
-diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.h libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.h
---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterCommunication.h 1970-01-01 01:00:00.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterCommunication.h 2014-11-10 23:14:45.217161982 +0100
-@@ -0,0 +1,119 @@
-+#pragma once
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
-+ *
-+ * You can redistribute this file and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ */
-+
-+#if defined(HAVE_IMX_API)
-+
-+#include "lib/platform/threads/mutex.h"
-+#include "lib/platform/threads/threads.h"
-+#include "lib/platform/sockets/socket.h"
-+#include "lib/adapter/AdapterCommunication.h"
-+#include <map>
-+
-+#define IMX_ADAPTER_VID 0x0471 /*FIXME TBD*/
-+#define IMX_ADAPTER_PID 0x1001
-+
-+
-+
-+namespace PLATFORM
-+{
-+ class CCDevSocket;
-+};
-+
-+
-+namespace CEC
-+{
-+ class CAdapterMessageQueueEntry;
-+
-+ class CIMXCECAdapterCommunication : public IAdapterCommunication, public PLATFORM::CThread
-+ {
-+ public:
-+ /*!
-+ * @brief Create a new USB-CEC communication handler.
-+ * @param callback The callback to use for incoming CEC commands.
-+ */
-+ CIMXCECAdapterCommunication(IAdapterCommunicationCallback *callback);
-+ virtual ~CIMXCECAdapterCommunication(void);
-+
-+ /** @name IAdapterCommunication implementation */
-+ ///{
-+ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true);
-+ void Close(void);
-+ bool IsOpen(void);
-+ std::string GetError(void) const;
-+ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply);
-+
-+ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) { return true; }
-+ bool StartBootloader(void) { return false; }
-+ bool SetLogicalAddresses(const cec_logical_addresses &addresses);
-+ cec_logical_addresses GetLogicalAddresses(void);
-+ bool PingAdapter(void) { return IsInitialised(); }
-+ uint16_t GetFirmwareVersion(void);
-+ uint32_t GetFirmwareBuildDate(void) { return 0; }
-+ bool IsRunningLatestFirmware(void) { return true; }
-+ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) { return false; }
-+ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) { return false; }
-+ std::string GetPortName(void) { return std::string("IMX"); }
-+ uint16_t GetPhysicalAddress(void);
-+ bool SetControlledMode(bool UNUSED(controlled)) { return true; }
-+ cec_vendor_id GetVendorId(void);
-+ bool SupportsSourceLogicalAddress(const cec_logical_address address) { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; }
-+ cec_adapter_type GetAdapterType(void) { return ADAPTERTYPE_IMX; }
-+ uint16_t GetAdapterVendorId(void) const { return IMX_ADAPTER_VID; }
-+ uint16_t GetAdapterProductId(void) const { return IMX_ADAPTER_PID; }
-+ void HandleLogicalAddressLost(cec_logical_address UNUSED(oldAddress));
-+ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) {}
-+ bool RegisterLogicalAddress(const cec_logical_address address);
-+ ///}
-+
-+ /** @name PLATFORM::CThread implementation */
-+ ///{
-+ void *Process(void);
-+ ///}
-+
-+ private:
-+ bool IsInitialised(void) const { return m_bInitialised; };
-+ bool UnregisterLogicalAddress(void);
-+
-+ std::string m_strError; /**< current error message */
-+
-+ //cec_logical_addresses m_logicalAddresses;
-+ cec_logical_address m_logicalAddress;
-+
-+ PLATFORM::CMutex m_mutex;
-+ PLATFORM::CCDevSocket *m_dev; /**< the device connection */
-+ bool m_bLogicalAddressRegistered;
-+ bool m_bInitialised;
-+
-+ PLATFORM::CMutex m_messageMutex;
-+ uint32_t m_iNextMessage;
-+ std::map<uint32_t, CAdapterMessageQueueEntry *> m_messages;
-+ };
-+
-+};
-+
-+#endif
-diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp
---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp 1970-01-01 01:00:00.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.cpp 2014-11-10 23:14:45.215162253 +0100
-@@ -0,0 +1,42 @@
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
-+ *
-+ * You can redistribute this file and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ */
-+
-+#include "env.h"
-+#include <stdio.h>
-+
-+#if defined(HAVE_IMX_API)
-+#include "IMXCECAdapterDetection.h"
-+
-+
-+using namespace CEC;
-+
-+bool CIMXCECAdapterDetection::FindAdapter(void)
-+{
-+ return access(CEC_IMX_PATH, 0) == 0;
-+}
-+
-+#endif
-diff -Naur libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.h libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.h
---- libcec-2.2.0/src/lib/adapter/IMX/IMXCECAdapterDetection.h 1970-01-01 01:00:00.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/adapter/IMX/IMXCECAdapterDetection.h 2014-11-10 23:14:45.215162253 +0100
-@@ -0,0 +1,36 @@
-+#pragma once
-+/*
-+ * This file is part of the libCEC(R) library.
-+ *
-+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved.
-+ * libCEC(R) is an original work, containing original code.
-+ *
-+ * libCEC(R) is a trademark of Pulse-Eight Limited.
-+ *
-+ * IMX adpater port is Copyright (C) 2013 by Stephan Rafin
-+ *
-+ * You can redistribute this file and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * 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.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ *
-+ */
-+
-+namespace CEC
-+{
-+ class CIMXCECAdapterDetection
-+ {
-+ public:
-+ static bool FindAdapter(void);
-+ };
-+}
-diff -Naur libcec-2.2.0/src/lib/CECTypeUtils.h libcec-2.2.0.patch/src/lib/CECTypeUtils.h
---- libcec-2.2.0/src/lib/CECTypeUtils.h 2014-10-28 16:20:50.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/CECTypeUtils.h 2014-11-10 23:14:45.212162668 +0100
-@@ -877,6 +877,8 @@
- return "Raspberry Pi";
- case ADAPTERTYPE_TDA995x:
- return "TDA995x";
-+ case ADAPTERTYPE_IMX:
-+ return "i.MX";
- default:
- return "unknown";
- }
-diff -Naur libcec-2.2.0/src/lib/Makefile.am libcec-2.2.0.patch/src/lib/Makefile.am
---- libcec-2.2.0/src/lib/Makefile.am 2014-10-28 16:20:50.000000000 +0100
-+++ libcec-2.2.0.patch/src/lib/Makefile.am 2014-11-10 23:20:02.597700521 +0100
-@@ -63,6 +63,12 @@
- adapter/TDA995x/TDA995xCECAdapterCommunication.cpp
- endif
-
-+## i.MX6 support
-+if USE_IMX_API
-+libcec_la_SOURCES += adapter/IMX/IMXCECAdapterDetection.cpp \
-+ adapter/IMX/IMXCECAdapterCommunication.cpp
-+endif
-+
- ## Exynos support
- if USE_EXYNOS_API
- libcec_la_SOURCES += adapter/Exynos/ExynosCECAdapterDetection.cpp \
diff --git a/package/libcec/patches/patch-src_cec-client_CMakeLists_txt b/package/libcec/patches/patch-src_cec-client_CMakeLists_txt
new file mode 100644
index 0000000..c6faee0
--- /dev/null
+++ b/package/libcec/patches/patch-src_cec-client_CMakeLists_txt
@@ -0,0 +1,10 @@
+--- libcec-185559110dc88aeca0915a90b3b369d2d42c0f7c.orig/src/cec-client/CMakeLists.txt 2015-05-22 14:47:17.000000000 -0500
++++ libcec-185559110dc88aeca0915a90b3b369d2d42c0f7c/src/cec-client/CMakeLists.txt 2015-05-22 15:02:00.606971031 -0500
+@@ -44,6 +44,7 @@ if (NOT WIN32)
+ # curses
+ if (HAVE_CURSES_API)
+ target_link_libraries(cec-client curses)
++ target_link_libraries(cec-client tinfo)
+ endif()
+
+ # rt
diff --git a/package/libcec/patches/patch-src_lib_libcec_pc_in b/package/libcec/patches/patch-src_lib_libcec_pc_in
deleted file mode 100644
index 5b71c1d..0000000
--- a/package/libcec/patches/patch-src_lib_libcec_pc_in
+++ /dev/null
@@ -1,9 +0,0 @@
---- libcec-2.2.0.orig/src/lib/libcec.pc.in 2014-11-11 13:49:38.000000000 -0600
-+++ libcec-2.2.0/src/lib/libcec.pc.in 2014-11-12 13:51:02.466501999 -0600
-@@ -7,6 +7,5 @@ Name: libcec
- Description: Pulse-Eight CEC adapter library
- URL: http://www.pulse-eight.com/
- Version: @VERSION@
--Requires: @REQUIRES@
- Libs: -L${libdir} -lcec
- Cflags: -I${includedir} -I${includedir}/libcec
diff --git a/package/libcec/patches/patch-src_libcec_libcec_pc_in b/package/libcec/patches/patch-src_libcec_libcec_pc_in
new file mode 100644
index 0000000..a02669b
--- /dev/null
+++ b/package/libcec/patches/patch-src_libcec_libcec_pc_in
@@ -0,0 +1,16 @@
+--- libcec-185559110dc88aeca0915a90b3b369d2d42c0f7c.orig/src/libcec/libcec.pc.in 2015-05-22 14:47:17.000000000 -0500
++++ libcec-185559110dc88aeca0915a90b3b369d2d42c0f7c/src/libcec/libcec.pc.in 2015-05-22 17:41:18.558883524 -0500
+@@ -1,12 +1,11 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+-includedir=@includedir@
++includedir=${prefix}/include
+
+ Name: libcec
+ Description: Pulse-Eight libCEC @LIBCEC_VERSION_MAJOR@.@LIBCEC_VERSION_MINOR@.@LIBCEC_VERSION_PATCH@
+ URL: http://www.pulse-eight.com/
+ Version: @LIBCEC_VERSION_MAJOR@.@LIBCEC_VERSION_MINOR@.@LIBCEC_VERSION_PATCH@
+-Requires: @LIBCEC_LIBREQUIRES@
+ Libs: -L${libdir} -lcec
+ Cflags: -I${includedir} -I${includedir}/libcec
diff --git a/package/libsquish/Makefile b/package/libsquish/Makefile
new file mode 100644
index 0000000..5ce5e6f
--- /dev/null
+++ b/package/libsquish/Makefile
@@ -0,0 +1,25 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:= libsquish
+PKG_VERSION:= 1.10
+PKG_RELEASE:= 1
+PKG_HASH:= a0118a79d927058b656e94dc4ffce5da37839962e4952be1fedbbdd901b42848
+PKG_DESCR:= c++ compression library
+PKG_SECTION:= libs/misc
+PKG_SITES:= http://sources.openelec.tv/devel/
+PKG_OPTS:= dev
+
+DISTFILES:= $(PKG_NAME)-$(PKG_VERSION)-openelec.tar.gz
+WRKDIST= ${WRKDIR}/${PKG_NAME}-$(PKG_VERSION)-openelec
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBSQUISH,libsquish,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS)))
+
+CONFIG_STYLE:= manual
+XAKE_FLAGS+= INSTALL_DIR="${WRKINST}/usr"
+
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk
diff --git a/package/libsquish/patches/patch-Makefile b/package/libsquish/patches/patch-Makefile
new file mode 100644
index 0000000..702db40
--- /dev/null
+++ b/package/libsquish/patches/patch-Makefile
@@ -0,0 +1,10 @@
+--- libsquish-1.10-openelec.orig/Makefile 2015-01-09 09:52:04.000000000 -0600
++++ libsquish-1.10-openelec/Makefile 2015-05-22 16:32:55.398921290 -0500
+@@ -10,6 +10,7 @@ LIB = libsquish.a
+ all : $(LIB) squish.pc
+
+ install : $(LIB) squish.pc
++ mkdir -p $(INSTALL_DIR)/include $(INSTALL_DIR)/lib/pkgconfig
+ install squish.h $(INSTALL_DIR)/include
+ install libsquish.a $(INSTALL_DIR)/lib
+ install squish.pc $(INSTALL_DIR)/lib/pkgconfig
diff --git a/package/openssl/Makefile b/package/openssl/Makefile
index e2e310e..873cc81 100644
--- a/package/openssl/Makefile
+++ b/package/openssl/Makefile
@@ -5,7 +5,7 @@ include ${ADK_TOPDIR}/rules.mk
PKG_NAME:= openssl
PKG_VERSION:= 1.0.2a
-PKG_RELEASE:= 3
+PKG_RELEASE:= 5
PKG_HASH:= 15b6393c20030aab02c8e2fe0243cb1d1d18062f6c095d67bca91871dc7f324a
PKG_DESCR:= secure socket layer libraries
PKG_SECTION:= libs/crypto
@@ -15,6 +15,7 @@ PKG_URL:= http://www.openssl.org/
PKG_SITES:= http://www.openssl.org/source/
PKG_LIBNAME:= libopenssl
PKG_OPTS:= dev
+PKG_NOPARALLEL:= 1
DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
diff --git a/package/platform/Makefile b/package/platform/Makefile
new file mode 100644
index 0000000..d413198
--- /dev/null
+++ b/package/platform/Makefile
@@ -0,0 +1,25 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:= platform
+PKG_VERSION:= aafa6e9f3b86f2258f5f75809849743b1779072b
+PKG_RELEASE:= 1
+PKG_DESCR:= platform library used by libcec
+PKG_SECTION:= libs/misc
+PKG_URL:= https://github.com/Pulse-Eight/platform
+PKG_SITES:= https://github.com/Pulse-Eight/platform.git
+PKG_LIBNAME:= libplatform
+PKG_OPTS:= dev
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBPLATFORM,libplatform,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS)))
+
+CONFIG_STYLE:= cmake
+
+libplatform-install:
+ :
+
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk
diff --git a/package/swig/Makefile b/package/swig/Makefile
index b885166..a686222 100644
--- a/package/swig/Makefile
+++ b/package/swig/Makefile
@@ -4,9 +4,9 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= swig
-PKG_VERSION:= 2.0.11
-PKG_RELEASE:= 2
-PKG_HASH:= 63780bf29f53937ad399a1f68bccb3730c90f65746868c4cdfc25cafcd0a424e
+PKG_VERSION:= 3.0.5
+PKG_RELEASE:= 1
+PKG_HASH:= 9f4cb9e8f213f041853646f58fe5e8428d63250d05f5c943b6fa759c77322a3c
PKG_DESCR:= swig utility
PKG_SECTION:= dev/tools
PKG_URL:= http://www.swig.org/
@@ -14,7 +14,7 @@ PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=swig/}
DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
-PKG_ARCH_DEPENDS:= native
+PKG_CFLINE_SWIG:= depends on ADK_HOST_ONLY
include $(ADK_TOPDIR)/mk/host.mk
include $(ADK_TOPDIR)/mk/package.mk
diff --git a/package/tinyxml/Makefile b/package/tinyxml/Makefile
index 1e124fa..692f513 100644
--- a/package/tinyxml/Makefile
+++ b/package/tinyxml/Makefile
@@ -25,10 +25,12 @@ CONFIG_STYLE:= manual
INSTALL_STYLE:= manual
tinyxml-install:
- $(INSTALL_DIR) $(IDIR_TINYXML)/usr/lib
+ $(INSTALL_DIR) $(IDIR_TINYXML)/usr/lib/
$(CP) $(WRKBUILD)/libtinyxml*.so* \
$(IDIR_TINYXML)/usr/lib
$(INSTALL_DATA) $(WRKBUILD)/tiny{str,xml}.h \
$(STAGING_TARGET_DIR)/usr/include
+ $(INSTALL_DATA) ./files/tinyxml.pc \
+ $(STAGING_TARGET_DIR)/usr/lib/pkgconfig
include ${ADK_TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/tinyxml/files/tinyxml.pc b/package/tinyxml/files/tinyxml.pc
new file mode 100644
index 0000000..684b090
--- /dev/null
+++ b/package/tinyxml/files/tinyxml.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: TinyXml
+Description: simple, small, C++ XML parser
+Version: 2.6.2
+Libs: -L${libdir} -ltinyxml
+Cflags: -I${includedir}
diff --git a/package/tmsnc/patches/patch-config_log b/package/tmsnc/patches/patch-config_log
deleted file mode 100644
index 21661b7..0000000
--- a/package/tmsnc/patches/patch-config_log
+++ /dev/null
@@ -1,797 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- tmsnc-0.3.2.orig/config.log 2006-10-17 13:14:23.000000000 +0200
-+++ tmsnc-0.3.2/config.log 2012-07-26 13:54:40.000000000 +0200
-@@ -4,34 +4,52 @@ running configure, to aid debugging if c
- It was created by configure, which was
- generated by GNU Autoconf 2.60a. Invocation command line was
-
-- $ ./configure
-+ $ /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/configure --build=i686-apple-darwin10 --host=mipsel-openadk-linux --target=mipsel-openadk-linux --program-prefix= --program-suffix= --prefix=/usr --bindir=/usr/bin --datadir=/usr/share --mandir=/usr/share/man --libexecdir=/usr/libexec --localstatedir=/var --sysconfdir=/etc --enable-shared --enable-static --disable-dependency-tracking --disable-libtool-lock --disable-nls --with-libiconv-prefix=/Volumes/adk/openadk/target_mipsel_uclibc/usr --with-openssl=/Volumes/adk/openadk/target_mipsel_uclibc/usr --with-ncurses=/Volumes/adk/openadk/target_mipsel_uclibc
-
- ## --------- ##
- ## Platform. ##
- ## --------- ##
-
--hostname = prophet
--uname -m = i686
--uname -r = 2.6.18-mactel
--uname -s = Linux
--uname -v = #1 SMP Tue Oct 10 12:17:51 CEST 2006
-+hostname = neon.localdomain
-+uname -m = i386
-+uname -r = 10.8.0
-+uname -s = Darwin
-+uname -v = Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-
--/usr/bin/uname -p = unknown
-+/usr/bin/uname -p = i386
- /bin/uname -X = unknown
-
--/bin/arch = i686
-+/bin/arch = unknown
- /usr/bin/arch -k = unknown
- /usr/convex/getsysinfo = unknown
--/usr/bin/hostinfo = unknown
-+/usr/bin/hostinfo = Mach kernel version:
-+ Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-+Kernel configured for up to 2 processors.
-+2 processors are physically available.
-+2 processors are logically available.
-+Processor type: i486 (Intel 80486)
-+Processors active: 0 1
-+Primary memory available: 4.00 gigabytes
-+Default processor set: 87 tasks, 378 threads, 2 processors
-+Load average: 1.56, Mach factor: 0.88
- /bin/machine = unknown
- /usr/bin/oslevel = unknown
- /bin/universe = unknown
-
--PATH: /usr/local/bin
-+PATH: /Volumes/adk/openadk/scripts
-+PATH: /Volumes/adk/openadk/bin/tools
-+PATH: /Volumes/adk/openadk/host_mipsel_uclibc/bin
-+PATH: /Volumes/adk/openadk/host_mipsel_uclibc/usr/bin
-+PATH: /Volumes/adk/openadk/target_mipsel_uclibc/scripts
-+PATH: /opt/local/bin
-+PATH: /opt/local/sbin
- PATH: /usr/bin
- PATH: /bin
--PATH: /usr/bin/X11
--PATH: /usr/games
-+PATH: /usr/sbin
-+PATH: /sbin
-+PATH: /usr/local/bin
-+PATH: /usr/local/MacGPG2/bin
-+PATH: /usr/X11/bin
-
-
- ## ----------- ##
-@@ -39,73 +57,74 @@ PATH: /usr/games
- ## ----------- ##
-
- configure:1789: checking for a BSD-compatible install
--configure:1845: result: /usr/bin/install -c
-+configure:1845: result: /Volumes/adk/openadk/scripts/install -c
- configure:1856: checking whether build environment is sane
- configure:1899: result: yes
- configure:1964: checking for gawk
--configure:1994: result: no
--configure:1964: checking for mawk
--configure:1980: found /usr/bin/mawk
--configure:1991: result: mawk
-+configure:1980: found /opt/local/bin/gawk
-+configure:1991: result: gawk
- configure:2002: checking whether make sets $(MAKE)
- configure:2023: result: yes
--configure:2258: checking for gcc
--configure:2274: found /usr/bin/gcc
--configure:2285: result: gcc
-+configure:2099: checking for mipsel-openadk-linux-strip
-+configure:2126: result: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-strip
-+configure:2218: checking for mipsel-openadk-linux-gcc
-+configure:2245: result: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc
- configure:2523: checking for C compiler version
--configure:2530: gcc --version >&5
--gcc (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)
--Copyright (C) 2006 Free Software Foundation, Inc.
-+configure:2530: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc --version >&5
-+mipsel-openadk-linux-uclibc-gcc (GCC) 4.6.3
-+Copyright (C) 2011 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions. There is NO
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- configure:2533: $? = 0
--configure:2540: gcc -v >&5
-+configure:2540: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -v >&5
- Using built-in specs.
--Target: i486-linux-gnu
--Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
-+COLLECT_GCC=/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc
-+COLLECT_LTO_WRAPPER=/Volumes/adk/openadk/host_mipsel_uclibc/libexec/gcc/mipsel-openadk-linux-uclibc/4.6.3/lto-wrapper
-+Target: mipsel-openadk-linux-uclibc
-+Configured with: /Volumes/adk/openadk/toolchain_build_mipsel_uclibc/w-gcc-4.6.3-1/gcc-4.6.3/configure --prefix=/Volumes/adk/openadk/host_mipsel_uclibc --build=i686-apple-darwin10 --host=i686-apple-darwin10 --target=mipsel-openadk-linux-uclibc --with-gmp=/Volumes/adk/openadk/host_mipsel_uclibc --with-mpfr=/Volumes/adk/openadk/host_mipsel_uclibc --with-libelf=/Volumes/adk/openadk/host_mipsel_uclibc --disable-__cxa_atexit --with-gnu-ld --disable-multilib --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-ppl --without-cloog --disable-nls --disable-sjlj-exceptions --disable-biarch --enable-libssp --enable-lto --enable-tls --enable-target-optspace --enable-languages=c,c++ --with-sysroot='/Volumes/adk/openadk/host_mipsel_uclibc/../target_mipsel_uclibc' --with-slibdir=/Volumes/adk/openadk/target_mipsel_uclibc/lib --enable-shared
- Thread model: posix
--gcc version 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)
-+gcc version 4.6.3 (GCC)
- configure:2543: $? = 0
--configure:2550: gcc -V >&5
--gcc: '-V' option must have argument
-+configure:2550: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -V >&5
-+mipsel-openadk-linux-uclibc-gcc: error: unrecognized option '-V'
-+mipsel-openadk-linux-uclibc-gcc: fatal error: no input files
-+compilation terminated.
- configure:2553: $? = 1
- configure:2576: checking for C compiler default output file name
--configure:2603: gcc conftest.c >&5
-+configure:2603: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c >&5
- configure:2606: $? = 0
- configure:2644: result: a.out
- configure:2661: checking whether the C compiler works
--configure:2671: ./a.out
--configure:2674: $? = 0
- configure:2691: result: yes
- configure:2698: checking whether we are cross compiling
--configure:2700: result: no
-+configure:2700: result: yes
- configure:2703: checking for suffix of executables
--configure:2710: gcc -o conftest conftest.c >&5
-+configure:2710: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c >&5
- configure:2713: $? = 0
- configure:2737: result:
- configure:2743: checking for suffix of object files
--configure:2769: gcc -c conftest.c >&5
-+configure:2769: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:2772: $? = 0
- configure:2795: result: o
- configure:2799: checking whether we are using the GNU C compiler
--configure:2828: gcc -c conftest.c >&5
-+configure:2828: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:2834: $? = 0
- configure:2841: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:2844: $? = 0
- configure:2851: test -s conftest.o
- configure:2854: $? = 0
- configure:2868: result: yes
--configure:2873: checking whether gcc accepts -g
--configure:2903: gcc -c -g conftest.c >&5
-+configure:2873: checking whether /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc accepts -g
-+configure:2903: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -g -DNDEBUG conftest.c >&5
- configure:2909: $? = 0
- configure:2916: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:2919: $? = 0
- configure:2926: test -s conftest.o
- configure:2929: $? = 0
- configure:3059: result: yes
--configure:3076: checking for gcc option to accept ISO C89
--configure:3150: gcc -c -g -O2 conftest.c >&5
-+configure:3076: checking for /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc option to accept ISO C89
-+configure:3150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:3156: $? = 0
- configure:3163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:3166: $? = 0
-@@ -114,17 +133,18 @@ configure:3176: $? = 0
- configure:3196: result: none needed
- configure:3225: checking for style of include used by make
- configure:3253: result: GNU
--configure:3281: checking dependency style of gcc
--configure:3371: result: gcc3
-+configure:3281: checking dependency style of /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc
-+configure:3371: result: none
- configure:3401: checking for a BSD-compatible install
--configure:3457: result: /usr/bin/install -c
-+configure:3457: result: /Volumes/adk/openadk/scripts/install -c
- configure:3468: checking whether make sets $(MAKE)
- configure:3489: result: yes
- configure:3506: checking how to run the C preprocessor
--configure:3546: gcc -E conftest.c
-+configure:3546: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E -DNDEBUG conftest.c
- configure:3552: $? = 0
--configure:3590: gcc -E conftest.c
--conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
-+configure:3590: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E -DNDEBUG conftest.c
-+conftest.c:10:28: fatal error: ac_nonexistent.h: No such file or directory
-+compilation terminated.
- configure:3596: $? = 1
- configure: failed program was:
- | /* confdefs.h. */
-@@ -137,11 +157,12 @@ configure: failed program was:
- | #define VERSION "0.3.2"
- | /* end confdefs.h. */
- | #include <ac_nonexistent.h>
--configure:3636: result: gcc -E
--configure:3665: gcc -E conftest.c
-+configure:3636: result: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E
-+configure:3665: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E -DNDEBUG conftest.c
- configure:3671: $? = 0
--configure:3709: gcc -E conftest.c
--conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
-+configure:3709: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E -DNDEBUG conftest.c
-+conftest.c:10:28: fatal error: ac_nonexistent.h: No such file or directory
-+compilation terminated.
- configure:3715: $? = 1
- configure: failed program was:
- | /* confdefs.h. */
-@@ -155,23 +176,19 @@ configure: failed program was:
- | /* end confdefs.h. */
- | #include <ac_nonexistent.h>
- configure:3760: checking for grep that handles long lines and -e
--configure:3834: result: /bin/grep
-+configure:3834: result: /usr/bin/grep
- configure:3839: checking for egrep
--configure:3917: result: /bin/grep -E
-+configure:3917: result: /usr/bin/grep -E
- configure:3922: checking for ANSI C header files
--configure:3952: gcc -c -g -O2 conftest.c >&5
-+configure:3952: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:3958: $? = 0
- configure:3965: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:3968: $? = 0
- configure:3975: test -s conftest.o
- configure:3978: $? = 0
--configure:4074: gcc -o conftest -g -O2 conftest.c >&5
--configure:4077: $? = 0
--configure:4083: ./conftest
--configure:4086: $? = 0
- configure:4103: result: yes
- configure:4129: checking for sys/types.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -179,7 +196,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for sys/stat.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -187,7 +204,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for stdlib.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -195,7 +212,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for string.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -203,7 +220,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for memory.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -211,7 +228,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for strings.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -219,7 +236,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for inttypes.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -227,7 +244,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for stdint.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -235,7 +252,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4129: checking for unistd.h
--configure:4150: gcc -c -g -O2 conftest.c >&5
-+configure:4150: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4156: $? = 0
- configure:4163: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4166: $? = 0
-@@ -243,7 +260,7 @@ configure:4173: test -s conftest.o
- configure:4176: $? = 0
- configure:4189: result: yes
- configure:4201: checking for pid_t
--configure:4231: gcc -c -g -O2 conftest.c >&5
-+configure:4231: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4237: $? = 0
- configure:4244: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4247: $? = 0
-@@ -251,7 +268,7 @@ configure:4254: test -s conftest.o
- configure:4257: $? = 0
- configure:4269: result: yes
- configure:4281: checking for size_t
--configure:4311: gcc -c -g -O2 conftest.c >&5
-+configure:4311: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4317: $? = 0
- configure:4324: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4327: $? = 0
-@@ -259,7 +276,7 @@ configure:4334: test -s conftest.o
- configure:4337: $? = 0
- configure:4349: result: yes
- configure:4361: checking whether time.h and sys/time.h may both be included
--configure:4391: gcc -c -g -O2 conftest.c >&5
-+configure:4391: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4397: $? = 0
- configure:4404: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4407: $? = 0
-@@ -267,7 +284,7 @@ configure:4414: test -s conftest.o
- configure:4417: $? = 0
- configure:4429: result: yes
- configure:4439: checking whether struct tm is in sys/time.h or time.h
--configure:4467: gcc -c -g -O2 conftest.c >&5
-+configure:4467: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG conftest.c >&5
- configure:4473: $? = 0
- configure:4480: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4483: $? = 0
-@@ -275,7 +292,7 @@ configure:4490: test -s conftest.o
- configure:4493: $? = 0
- configure:4505: result: time.h
- configure:4516: checking for library containing gethostbyname
--configure:4557: gcc -o conftest -g -O2 conftest.c >&5
-+configure:4557: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c >&5
- configure:4563: $? = 0
- configure:4570: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4573: $? = 0
-@@ -283,17 +300,15 @@ configure:4580: test -s conftest
- configure:4583: $? = 0
- configure:4607: result: none required
- configure:4615: checking for socket
--configure:4671: gcc -o conftest -g -O2 conftest.c >&5
-+configure:4671: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c >&5
- configure:4677: $? = 0
- configure:4684: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:4687: $? = 0
- configure:4694: test -s conftest
- configure:4697: $? = 0
- configure:4710: result: yes
--configure:5084: checking location of ncurses.h file...
--configure:5092: result: Found ncurses on /usr/include/ncurses.h
- configure:5367: checking for use_default_colors
--configure:5423: gcc -o conftest -g -O2 conftest.c -lncurses >&5
-+configure:5423: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -lncurses >&5
- configure:5429: $? = 0
- configure:5436: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:5439: $? = 0
-@@ -301,7 +316,7 @@ configure:5446: test -s conftest
- configure:5449: $? = 0
- configure:5463: result: yes
- configure:5367: checking for resizeterm
--configure:5423: gcc -o conftest -g -O2 conftest.c -lncurses >&5
-+configure:5423: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -lncurses >&5
- configure:5429: $? = 0
- configure:5436: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:5439: $? = 0
-@@ -309,7 +324,7 @@ configure:5446: test -s conftest
- configure:5449: $? = 0
- configure:5463: result: yes
- configure:5367: checking for resize_term
--configure:5423: gcc -o conftest -g -O2 conftest.c -lncurses >&5
-+configure:5423: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -lncurses >&5
- configure:5429: $? = 0
- configure:5436: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:5439: $? = 0
-@@ -317,9 +332,10 @@ configure:5446: test -s conftest
- configure:5449: $? = 0
- configure:5463: result: yes
- configure:5367: checking for wadd_wch
--configure:5423: gcc -o conftest -g -O2 conftest.c -lncurses >&5
--/tmp/cciXPB1b.o: In function `main':
--/home/jonas/tmsnc/conftest.c:60: undefined reference to `wadd_wch'
-+configure:5423: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -lncurses >&5
-+/var/folders/v7/v7rUSnywE5SYxctWLsie4++++TI/-Tmp-//ccPE2bt6.o: In function `main':
-+conftest.c:(.text.startup+0xc): undefined reference to `wadd_wch'
-+conftest.c:(.text.startup+0x18): undefined reference to `wadd_wch'
- collect2: ld returned 1 exit status
- configure:5429: $? = 1
- configure: failed program was:
-@@ -342,8 +358,8 @@ configure: failed program was:
- | #define HAVE_STDINT_H 1
- | #define HAVE_UNISTD_H 1
- | #define TIME_WITH_SYS_TIME 1
--| #define HAS_CURSES 1
- | #define USE_NCURSES 1
-+| #define HAS_CURSES 1
- | #define HAVE_USE_DEFAULT_COLORS 1
- | #define HAVE_RESIZETERM 1
- | #define HAVE_RESIZE_TERM 1
-@@ -388,25 +404,74 @@ configure: failed program was:
- | }
- configure:5463: result: no
- configure:5515: checking build system type
--configure:5533: result: i686-pc-linux-gnu
-+configure:5533: result: i686-apple-darwin10
- configure:5555: checking host system type
--configure:5570: result: i686-pc-linux-gnu
-+configure:5570: result: mipsel-openadk-linux-gnu
- configure:5616: checking for ld used by GCC
--configure:5680: result: /usr/bin/ld
--configure:5689: checking if the linker (/usr/bin/ld) is GNU ld
-+configure:5680: result: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-ld
-+configure:5689: checking if the linker (/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-ld) is GNU ld
- configure:5702: result: yes
- configure:5709: checking for shared library run path origin
- configure:5722: result: done
- configure:6152: checking for iconv
--configure:6184: gcc -o conftest -g -O2 conftest.c >&5
--configure:6190: $? = 0
--configure:6197: test -z "$ac_c_werror_flag" || test ! -s conftest.err
--configure:6200: $? = 0
--configure:6207: test -s conftest
--configure:6210: $? = 0
-+configure:6184: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -I/Volumes/adk/openadk/target_mipsel_uclibc/usr/include -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c >&5
-+/var/folders/v7/v7rUSnywE5SYxctWLsie4++++TI/-Tmp-//ccM3dqcv.o: In function `main':
-+conftest.c:(.text.startup+0x10): undefined reference to `libiconv_open'
-+conftest.c:(.text.startup+0x24): undefined reference to `libiconv_open'
-+conftest.c:(.text.startup+0x34): undefined reference to `libiconv'
-+conftest.c:(.text.startup+0x48): undefined reference to `libiconv'
-+conftest.c:(.text.startup+0x58): undefined reference to `libiconv_close'
-+conftest.c:(.text.startup+0x60): undefined reference to `libiconv_close'
-+collect2: ld returned 1 exit status
-+configure:6190: $? = 1
-+configure: failed program was:
-+| /* confdefs.h. */
-+| #define PACKAGE_NAME ""
-+| #define PACKAGE_TARNAME ""
-+| #define PACKAGE_VERSION ""
-+| #define PACKAGE_STRING ""
-+| #define PACKAGE_BUGREPORT ""
-+| #define PACKAGE "tmsnc"
-+| #define VERSION "0.3.2"
-+| #define STDC_HEADERS 1
-+| #define HAVE_SYS_TYPES_H 1
-+| #define HAVE_SYS_STAT_H 1
-+| #define HAVE_STDLIB_H 1
-+| #define HAVE_STRING_H 1
-+| #define HAVE_MEMORY_H 1
-+| #define HAVE_STRINGS_H 1
-+| #define HAVE_INTTYPES_H 1
-+| #define HAVE_STDINT_H 1
-+| #define HAVE_UNISTD_H 1
-+| #define TIME_WITH_SYS_TIME 1
-+| #define USE_NCURSES 1
-+| #define HAS_CURSES 1
-+| #define HAVE_USE_DEFAULT_COLORS 1
-+| #define HAVE_RESIZETERM 1
-+| #define HAVE_RESIZE_TERM 1
-+| /* end confdefs.h. */
-+| #include <stdlib.h>
-+| #include <iconv.h>
-+| int
-+| main ()
-+| {
-+| iconv_t cd = iconv_open("","");
-+| iconv(cd,NULL,NULL,NULL,NULL);
-+| iconv_close(cd);
-+| ;
-+| return 0;
-+| }
-+configure:6249: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -I/Volumes/adk/openadk/target_mipsel_uclibc/usr/include -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c /Volumes/adk/openadk/target_mipsel_uclibc/usr/lib/libiconv.so -Wl,-rpath -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib >&5
-+configure:6255: $? = 0
-+configure:6262: test -z "$ac_c_werror_flag" || test ! -s conftest.err
-+configure:6265: $? = 0
-+configure:6272: test -s conftest
-+configure:6275: $? = 0
- configure:6292: result: yes
-+configure:6302: checking how to link with libiconv
-+configure:6304: result: /Volumes/adk/openadk/target_mipsel_uclibc/usr/lib/libiconv.so -Wl,-rpath -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib
- configure:6315: checking for iconv declaration
--configure:6354: gcc -c -g -O2 conftest.c >&5
-+configure:6354: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -c -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -I/Volumes/adk/openadk/target_mipsel_uclibc/usr/include conftest.c >&5
- configure:6360: $? = 0
- configure:6367: test -z "$ac_c_werror_flag" || test ! -s conftest.err
- configure:6370: $? = 0
-@@ -415,10 +480,10 @@ configure:6380: $? = 0
- configure:6396: result:
- extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
- configure:6424: checking for openssl
--configure:6494: result: yes
-+configure:6447: result: /Volumes/adk/openadk/target_mipsel_uclibc/usr
- configure:6521: checking for gtf_filter_warez in -ltalkfilters
--configure:6556: gcc -o conftest -g -O2 conftest.c -ltalkfilters >&5
--/usr/bin/ld: cannot find -ltalkfilters
-+configure:6556: /Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -o conftest -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -DNDEBUG -I/Volumes/adk/openadk/target_mipsel_uclibc/usr/include -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib conftest.c -ltalkfilters >&5
-+/Volumes/adk/openadk/host_mipsel_uclibc/lib/gcc/mipsel-openadk-linux-uclibc/4.6.3/../../../../mipsel-openadk-linux-uclibc/bin/ld: cannot find -ltalkfilters
- collect2: ld returned 1 exit status
- configure:6562: $? = 1
- configure: failed program was:
-@@ -441,8 +506,8 @@ configure: failed program was:
- | #define HAVE_STDINT_H 1
- | #define HAVE_UNISTD_H 1
- | #define TIME_WITH_SYS_TIME 1
--| #define HAS_CURSES 1
- | #define USE_NCURSES 1
-+| #define HAS_CURSES 1
- | #define HAVE_USE_DEFAULT_COLORS 1
- | #define HAVE_RESIZETERM 1
- | #define HAVE_RESIZE_TERM 1
-@@ -481,37 +546,40 @@ generated by GNU Autoconf 2.60a. Invoca
- CONFIG_COMMANDS =
- $ ./config.status
-
--on prophet
-+on neon.localdomain
-
- config.status:646: creating Makefile
- config.status:646: creating doc/Makefile
- config.status:646: creating src/Makefile
- config.status:646: creating autopackage/default.apspec
- config.status:646: creating src/config.h
-+config.status:875: src/config.h is unchanged
- config.status:921: executing depfiles commands
-
- ## ---------------- ##
- ## Cache variables. ##
- ## ---------------- ##
-
--ac_cv_build=i686-pc-linux-gnu
-+ac_cv_build=i686-apple-darwin10
- ac_cv_c_compiler_gnu=yes
--ac_cv_env_CC_set=
--ac_cv_env_CC_value=
--ac_cv_env_CFLAGS_set=
--ac_cv_env_CFLAGS_value=
--ac_cv_env_CPPFLAGS_set=
--ac_cv_env_CPPFLAGS_value=
-+ac_cv_env_CC_set=set
-+ac_cv_env_CC_value=/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc
-+ac_cv_env_CFLAGS_set=set
-+ac_cv_env_CFLAGS_value='-fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe'
-+ac_cv_env_CPPFLAGS_set=set
-+ac_cv_env_CPPFLAGS_value=-DNDEBUG
- ac_cv_env_CPP_set=
- ac_cv_env_CPP_value=
--ac_cv_env_LDFLAGS_set=
--ac_cv_env_LDFLAGS_value=
--ac_cv_env_build_alias_set=
--ac_cv_env_build_alias_value=
--ac_cv_env_host_alias_set=
--ac_cv_env_host_alias_value=
--ac_cv_env_target_alias_set=
--ac_cv_env_target_alias_value=
-+ac_cv_env_LDFLAGS_set=set
-+ac_cv_env_LDFLAGS_value='-L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib'
-+ac_cv_env_build_alias_set=set
-+ac_cv_env_build_alias_value=i686-apple-darwin10
-+ac_cv_env_host_alias_set=set
-+ac_cv_env_host_alias_value=mipsel-openadk-linux
-+ac_cv_env_target_alias_set=set
-+ac_cv_env_target_alias_value=mipsel-openadk-linux
-+ac_cv_func_malloc_0_nonnull=yes
-+ac_cv_func_realloc_0_nonnull=yes
- ac_cv_func_resize_term=yes
- ac_cv_func_resizeterm=yes
- ac_cv_func_socket=yes
-@@ -528,15 +596,16 @@ ac_cv_header_sys_stat_h=yes
- ac_cv_header_sys_types_h=yes
- ac_cv_header_time=yes
- ac_cv_header_unistd_h=yes
--ac_cv_host=i686-pc-linux-gnu
-+ac_cv_host=mipsel-openadk-linux-gnu
- ac_cv_lib_talkfilters_gtf_filter_warez=no
- ac_cv_objext=o
--ac_cv_path_EGREP='/bin/grep -E'
--ac_cv_path_GREP=/bin/grep
--ac_cv_path_install='/usr/bin/install -c'
--ac_cv_prog_AWK=mawk
--ac_cv_prog_CPP='gcc -E'
--ac_cv_prog_ac_ct_CC=gcc
-+ac_cv_path_EGREP='/usr/bin/grep -E'
-+ac_cv_path_GREP=/usr/bin/grep
-+ac_cv_path_install='/Volumes/adk/openadk/scripts/install -c'
-+ac_cv_prog_AWK=gawk
-+ac_cv_prog_CC=/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc
-+ac_cv_prog_CPP='/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E'
-+ac_cv_prog_STRIP=/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-strip
- ac_cv_prog_cc_c89=
- ac_cv_prog_cc_g=yes
- ac_cv_prog_make_make_set=yes
-@@ -549,14 +618,14 @@ acl_cv_hardcode_libdir_flag_spec='${wl}-
- acl_cv_hardcode_libdir_separator=
- acl_cv_hardcode_minus_L=no
- acl_cv_libext=a
--acl_cv_path_LD=/usr/bin/ld
-+acl_cv_path_LD=/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-ld
- acl_cv_prog_gnu_ld=yes
- acl_cv_rpath=done
- acl_cv_shlibext=so
- acl_cv_wl=-Wl,
--am_cv_CC_dependencies_compiler_type=gcc3
-+am_cv_CC_dependencies_compiler_type=none
- am_cv_func_iconv=yes
--am_cv_lib_iconv=no
-+am_cv_lib_iconv=yes
- am_cv_proto_iconv='extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);'
- am_cv_proto_iconv_arg1=
-
-@@ -564,42 +633,42 @@ am_cv_proto_iconv_arg1=
- ## Output variables. ##
- ## ----------------- ##
-
--ACLOCAL='${SHELL} /home/jonas/tmsnc/missing --run aclocal-1.9'
--AMDEPBACKSLASH='\'
--AMDEP_FALSE='#'
--AMDEP_TRUE=''
--AMTAR='${SHELL} /home/jonas/tmsnc/missing --run tar'
--AUTOCONF='${SHELL} /home/jonas/tmsnc/missing --run autoconf'
--AUTOHEADER='${SHELL} /home/jonas/tmsnc/missing --run autoheader'
--AUTOMAKE='${SHELL} /home/jonas/tmsnc/missing --run automake-1.9'
--AWK='mawk'
--CC='gcc'
--CCDEPMODE='depmode=gcc3'
--CFLAGS='-g -O2'
--CPP='gcc -E'
--CPPFLAGS=''
--CURSES_INCLUDEDIR=''
--CURSES_LIBS='-lncurses -lpanel -lform'
-+ACLOCAL='${SHELL} /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/missing --run aclocal-1.9'
-+AMDEPBACKSLASH=''
-+AMDEP_FALSE=''
-+AMDEP_TRUE='#'
-+AMTAR='${SHELL} /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/missing --run tar'
-+AUTOCONF='${SHELL} /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/missing --run autoconf'
-+AUTOHEADER='${SHELL} /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/missing --run autoheader'
-+AUTOMAKE='${SHELL} /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/missing --run automake-1.9'
-+AWK='gawk'
-+CC='/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc'
-+CCDEPMODE='depmode=none'
-+CFLAGS='-fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe'
-+CPP='/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-gcc -E'
-+CPPFLAGS='-DNDEBUG -I/Volumes/adk/openadk/target_mipsel_uclibc/usr/include'
-+CURSES_INCLUDEDIR='-I/Volumes/adk/openadk/target_mipsel_uclibc/include'
-+CURSES_LIBS=' -L/Volumes/adk/openadk/target_mipsel_uclibc/lib -lncurses -lpanel -lform'
- CYGPATH_W='echo'
- DEFS='-DHAVE_CONFIG_H'
- DEPDIR='.deps'
- ECHO_C=''
- ECHO_N='-n'
- ECHO_T=''
--EGREP='/bin/grep -E'
-+EGREP='/usr/bin/grep -E'
- EXEEXT=''
--GREP='/bin/grep'
-+GREP='/usr/bin/grep'
- INSTALL_DATA='${INSTALL} -m 644'
- INSTALL_PROGRAM='${INSTALL}'
- INSTALL_SCRIPT='${INSTALL}'
- INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
--LDFLAGS=''
--LIBICONV=''
-+LDFLAGS='-L/Volumes/adk/openadk/target_mipsel_uclibc/lib -L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib'
-+LIBICONV='/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib/libiconv.so -Wl,-rpath -Wl,/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib'
- LIBOBJS=''
- LIBS=''
--LTLIBICONV=''
-+LTLIBICONV='-L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -liconv -R/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib'
- LTLIBOBJS=''
--MAKEINFO='${SHELL} /home/jonas/tmsnc/missing --run makeinfo'
-+MAKEINFO='${SHELL} /Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/missing --run makeinfo'
- OBJEXT='o'
- OPENSSL_FALSE='#'
- OPENSSL_TRUE=''
-@@ -611,57 +680,57 @@ PACKAGE_TARNAME=''
- PACKAGE_VERSION=''
- PATH_SEPARATOR=':'
- SET_MAKE=''
--SHELL='/bin/sh'
--SSLINC=''
--SSLLIB='-lssl -lcrypto'
--STRIP=''
-+SHELL='/bin/bash'
-+SSLINC='-I/Volumes/adk/openadk/target_mipsel_uclibc/usr/include'
-+SSLLIB='-L/Volumes/adk/openadk/target_mipsel_uclibc/usr/lib -lssl -lcrypto'
-+STRIP='/Volumes/adk/openadk/host_mipsel_uclibc/bin/mipsel-openadk-linux-uclibc-strip'
- TALKFILTERS_FALSE=''
- TALKFILTERS_TRUE='#'
- TFLIB=''
- VERSION='0.3.2'
--ac_ct_CC='gcc'
--am__fastdepCC_FALSE='#'
--am__fastdepCC_TRUE=''
-+ac_ct_CC=''
-+am__fastdepCC_FALSE=''
-+am__fastdepCC_TRUE='#'
- am__include='include'
- am__leading_dot='.'
- am__quote=''
- am__tar='${AMTAR} chof - "$$tardir"'
- am__untar='${AMTAR} xf -'
--bindir='${exec_prefix}/bin'
--build='i686-pc-linux-gnu'
--build_alias=''
-+bindir='/usr/bin'
-+build='i686-apple-darwin10'
-+build_alias='i686-apple-darwin10'
- build_cpu='i686'
--build_os='linux-gnu'
--build_vendor='pc'
--datadir='${datarootdir}'
-+build_os='darwin10'
-+build_vendor='apple'
-+datadir='/usr/share'
- datarootdir='${prefix}/share'
- docdir='${datarootdir}/doc/${PACKAGE}'
- dvidir='${docdir}'
- exec_prefix='${prefix}'
--host='i686-pc-linux-gnu'
--host_alias=''
--host_cpu='i686'
-+host='mipsel-openadk-linux-gnu'
-+host_alias='mipsel-openadk-linux'
-+host_cpu='mipsel'
- host_os='linux-gnu'
--host_vendor='pc'
-+host_vendor='openadk'
- htmldir='${docdir}'
- includedir='${prefix}/include'
- infodir='${datarootdir}/info'
--install_sh='/home/jonas/tmsnc/install-sh'
-+install_sh='/Volumes/adk/openadk/build_qemu_mipsel_uclibc/w-tmsnc-0.3.2-1/tmsnc-0.3.2/install-sh'
- libdir='${exec_prefix}/lib'
--libexecdir='${exec_prefix}/libexec'
-+libexecdir='/usr/libexec'
- localedir='${datarootdir}/locale'
--localstatedir='${prefix}/var'
--mandir='${datarootdir}/man'
--mkdir_p='mkdir -p --'
-+localstatedir='/var'
-+mandir='/usr/share/man'
-+mkdir_p='$(mkinstalldirs)'
- oldincludedir='/usr/include'
- pdfdir='${docdir}'
--prefix='/usr/local'
--program_transform_name='s,x,x,'
-+prefix='/usr'
-+program_transform_name='s&$$&&;s&^&&'
- psdir='${docdir}'
- sbindir='${exec_prefix}/sbin'
- sharedstatedir='${prefix}/com'
--sysconfdir='${prefix}/etc'
--target_alias=''
-+sysconfdir='/etc'
-+target_alias='mipsel-openadk-linux'
- tmsnc_VERSION='0.3.2'
-
- ## ----------- ##
-@@ -686,8 +755,8 @@ tmsnc_VERSION='0.3.2'
- #define HAVE_STDINT_H 1
- #define HAVE_UNISTD_H 1
- #define TIME_WITH_SYS_TIME 1
--#define HAS_CURSES 1
- #define USE_NCURSES 1
-+#define HAS_CURSES 1
- #define HAVE_USE_DEFAULT_COLORS 1
- #define HAVE_RESIZETERM 1
- #define HAVE_RESIZE_TERM 1
-@@ -710,7 +779,6 @@ generated by GNU Autoconf 2.60a. Invoca
- CONFIG_COMMANDS =
- $ ./config.status src/config.h
-
--on prophet
-+on neon.localdomain
-
- config.status:646: creating src/config.h
--config.status:875: src/config.h is unchanged
diff --git a/package/uclibc-ng/Config.in.manual b/package/uclibc-ng/Config.in.manual
index 8e7b6c2..57bce54 100644
--- a/package/uclibc-ng/Config.in.manual
+++ b/package/uclibc-ng/Config.in.manual
@@ -8,7 +8,6 @@ config ADK_PACKAGE_UCLIBC_NG
config ADK_PACKAGE_UCLIBC_NG_TEST
bool "uClibc-ng-test.......... embedded C library (testsuite)"
- select ADK_PACKAGE_MAKE if !ADK_TARGET_UCLINUX
select ADK_PACKAGE_LIBRT if !ADK_TARGET_UCLINUX
select ADK_PACKAGE_LIBPTHREAD if !ADK_TARGET_UCLINUX
select ADK_UCLIBC_TEST
diff --git a/target/arm/solidrun-imx6/patches/3.14.40/solidrun.patch b/target/arm/solidrun-imx6/patches/3.14.43/solidrun.patch
index 871a870..871a870 100644
--- a/target/arm/solidrun-imx6/patches/3.14.40/solidrun.patch
+++ b/target/arm/solidrun-imx6/patches/3.14.43/solidrun.patch
diff --git a/target/config/Config.in.kernelversion.choice b/target/config/Config.in.kernelversion.choice
index 0819c14..764d868 100644
--- a/target/config/Config.in.kernelversion.choice
+++ b/target/config/Config.in.kernelversion.choice
@@ -26,8 +26,8 @@ config ADK_KERNEL_VERSION_3_18_12
depends on !ADK_TARGET_SYSTEM_QEMU_SPARC
select ADK_KERNEL_VERSION_3_18
-config ADK_KERNEL_VERSION_3_14_40
- bool "3.14.40"
+config ADK_KERNEL_VERSION_3_14_43
+ bool "3.14.43"
depends on !ADK_TARGET_ARCH_NIOS2
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI
depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI2
diff --git a/target/config/Config.in.kernelversion.default b/target/config/Config.in.kernelversion.default
index 7689fc5..d361520 100644
--- a/target/config/Config.in.kernelversion.default
+++ b/target/config/Config.in.kernelversion.default
@@ -33,7 +33,7 @@ config ADK_KERNEL_VERSION
default "4.0.3" if ADK_KERNEL_VERSION_4_0
default "3.19.5" if ADK_KERNEL_VERSION_3_19_5
default "3.18.12" if ADK_KERNEL_VERSION_3_18_12
- default "3.14.40" if ADK_KERNEL_VERSION_3_14_40
+ default "3.14.43" if ADK_KERNEL_VERSION_3_14_43
default "3.12.40" if ADK_KERNEL_VERSION_3_12_40
default "3.10.75" if ADK_KERNEL_VERSION_3_10_75
default "3.4.107" if ADK_KERNEL_VERSION_3_4_107
diff --git a/target/linux/Config.in b/target/linux/Config.in
index 4595a73..80cc146 100644
--- a/target/linux/Config.in
+++ b/target/linux/Config.in
@@ -8,6 +8,7 @@ source target/linux/config/Config.in.flash
source target/linux/config/Config.in.fs
source target/linux/config/Config.in.netdevice
source target/linux/config/Config.in.usb
+source target/linux/config/Config.in.serial
source target/linux/config/Config.in.graphics
source target/linux/config/Config.in.input
source target/linux/config/Config.in.pcmcia
diff --git a/target/linux/config/Config.in.gpio b/target/linux/config/Config.in.gpio
index 03f7ea5..535f9c6 100644
--- a/target/linux/config/Config.in.gpio
+++ b/target/linux/config/Config.in.gpio
@@ -10,6 +10,9 @@ config ADK_KERNEL_GPIO_SYSFS
config ADK_KERNEL_GPIO_GENERIC
bool
+config ADK_KERNEL_GPIO_DEVRES
+ bool
+
config ADK_KERNEL_BCM2708_GPIO
bool
select ADK_KERNEL_GPIOLIB
@@ -30,3 +33,10 @@ config ADK_KERNEL_GPIO_MXC
depends on ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default y if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
default n
+
+config ADK_KERNEL_ETRAX_GPIO
+ bool
+ select ADK_KERNEL_GPIO_DEVRES
+ depends on ADK_TARGET_SYSTEM_QEMU_CRIS
+ default y if ADK_TARGET_SYSTEM_QEMU_CRIS
+ default n
diff --git a/target/linux/config/Config.in.serial b/target/linux/config/Config.in.serial
new file mode 100644
index 0000000..79daca3
--- /dev/null
+++ b/target/linux/config/Config.in.serial
@@ -0,0 +1,11 @@
+menu "Serial devices support"
+depends on ADK_TARGET_WITH_SERIAL || ADK_TARGET_QEMU || ADK_TARGET_VBOX
+
+config ADK_KERNEL_ETRAXFS_SERIAL
+ bool "ETRAXFS serial driver"
+ default y if ADK_TARGET_SYSTEM_QEMU_CRIS
+ default n
+ help
+ Serial driver for ETRAXFS CRISv32 Qemu Emulation.
+
+endmenu
diff --git a/target/linux/patches/3.14.40/bsd-compatibility.patch b/target/linux/patches/3.14.43/bsd-compatibility.patch
index b954b65..b954b65 100644
--- a/target/linux/patches/3.14.40/bsd-compatibility.patch
+++ b/target/linux/patches/3.14.43/bsd-compatibility.patch
diff --git a/target/linux/patches/3.14.40/cleankernel.patch b/target/linux/patches/3.14.43/cleankernel.patch
index d8c055d..d8c055d 100644
--- a/target/linux/patches/3.14.40/cleankernel.patch
+++ b/target/linux/patches/3.14.43/cleankernel.patch
diff --git a/target/linux/patches/3.14.40/defaults.patch b/target/linux/patches/3.14.43/defaults.patch
index f071fd1..f071fd1 100644
--- a/target/linux/patches/3.14.40/defaults.patch
+++ b/target/linux/patches/3.14.43/defaults.patch
diff --git a/target/linux/patches/3.14.40/disable-netfilter.patch b/target/linux/patches/3.14.43/disable-netfilter.patch
index 7b1ca01..7b1ca01 100644
--- a/target/linux/patches/3.14.40/disable-netfilter.patch
+++ b/target/linux/patches/3.14.43/disable-netfilter.patch
diff --git a/target/linux/patches/3.14.40/export-symbol-for-exmap.patch b/target/linux/patches/3.14.43/export-symbol-for-exmap.patch
index 4f0fc84..4f0fc84 100644
--- a/target/linux/patches/3.14.40/export-symbol-for-exmap.patch
+++ b/target/linux/patches/3.14.43/export-symbol-for-exmap.patch
diff --git a/target/linux/patches/3.14.40/fblogo.patch b/target/linux/patches/3.14.43/fblogo.patch
index cbbb421..cbbb421 100644
--- a/target/linux/patches/3.14.40/fblogo.patch
+++ b/target/linux/patches/3.14.43/fblogo.patch
diff --git a/target/linux/patches/3.14.40/gemalto.patch b/target/linux/patches/3.14.43/gemalto.patch
index 65f7af1..65f7af1 100644
--- a/target/linux/patches/3.14.40/gemalto.patch
+++ b/target/linux/patches/3.14.43/gemalto.patch
diff --git a/target/linux/patches/3.14.40/initramfs-nosizelimit.patch b/target/linux/patches/3.14.43/initramfs-nosizelimit.patch
index 40d2f6b..40d2f6b 100644
--- a/target/linux/patches/3.14.40/initramfs-nosizelimit.patch
+++ b/target/linux/patches/3.14.43/initramfs-nosizelimit.patch
diff --git a/target/linux/patches/3.14.40/lemote-rfkill.patch b/target/linux/patches/3.14.43/lemote-rfkill.patch
index a614884..a614884 100644
--- a/target/linux/patches/3.14.40/lemote-rfkill.patch
+++ b/target/linux/patches/3.14.43/lemote-rfkill.patch
diff --git a/target/linux/patches/3.14.40/microblaze-axi.patch b/target/linux/patches/3.14.43/microblaze-axi.patch
index 1a4b17d..1a4b17d 100644
--- a/target/linux/patches/3.14.40/microblaze-axi.patch
+++ b/target/linux/patches/3.14.43/microblaze-axi.patch
diff --git a/target/linux/patches/3.14.40/microblaze-ethernet.patch b/target/linux/patches/3.14.43/microblaze-ethernet.patch
index 742ab47..742ab47 100644
--- a/target/linux/patches/3.14.40/microblaze-ethernet.patch
+++ b/target/linux/patches/3.14.43/microblaze-ethernet.patch
diff --git a/target/linux/patches/3.14.40/mkpiggy.patch b/target/linux/patches/3.14.43/mkpiggy.patch
index 751678b..751678b 100644
--- a/target/linux/patches/3.14.40/mkpiggy.patch
+++ b/target/linux/patches/3.14.43/mkpiggy.patch
diff --git a/target/linux/patches/3.14.40/mptcp.patch b/target/linux/patches/3.14.43/mptcp.patch
index 9784e05..9784e05 100644
--- a/target/linux/patches/3.14.40/mptcp.patch
+++ b/target/linux/patches/3.14.43/mptcp.patch
diff --git a/target/linux/patches/3.14.40/mtd-rootfs.patch b/target/linux/patches/3.14.43/mtd-rootfs.patch
index 775d5fc..775d5fc 100644
--- a/target/linux/patches/3.14.40/mtd-rootfs.patch
+++ b/target/linux/patches/3.14.43/mtd-rootfs.patch
diff --git a/target/linux/patches/3.14.40/nfsv3-tcp.patch b/target/linux/patches/3.14.43/nfsv3-tcp.patch
index 68ed95b..68ed95b 100644
--- a/target/linux/patches/3.14.40/nfsv3-tcp.patch
+++ b/target/linux/patches/3.14.43/nfsv3-tcp.patch
diff --git a/target/linux/patches/3.14.40/non-static.patch b/target/linux/patches/3.14.43/non-static.patch
index a967703..a967703 100644
--- a/target/linux/patches/3.14.40/non-static.patch
+++ b/target/linux/patches/3.14.43/non-static.patch
diff --git a/target/linux/patches/3.14.40/ppc64-missing-zlib.patch b/target/linux/patches/3.14.43/ppc64-missing-zlib.patch
index c6e0616..c6e0616 100644
--- a/target/linux/patches/3.14.40/ppc64-missing-zlib.patch
+++ b/target/linux/patches/3.14.43/ppc64-missing-zlib.patch
diff --git a/target/linux/patches/3.14.40/regmap-boolean.patch b/target/linux/patches/3.14.43/regmap-boolean.patch
index d73620e..d73620e 100644
--- a/target/linux/patches/3.14.40/regmap-boolean.patch
+++ b/target/linux/patches/3.14.43/regmap-boolean.patch
diff --git a/target/linux/patches/3.14.40/relocs.patch b/target/linux/patches/3.14.43/relocs.patch
index 69a7c88..69a7c88 100644
--- a/target/linux/patches/3.14.40/relocs.patch
+++ b/target/linux/patches/3.14.43/relocs.patch
diff --git a/target/linux/patches/3.14.40/sgidefs.patch b/target/linux/patches/3.14.43/sgidefs.patch
index f00a284..f00a284 100644
--- a/target/linux/patches/3.14.40/sgidefs.patch
+++ b/target/linux/patches/3.14.43/sgidefs.patch
diff --git a/target/linux/patches/3.14.40/sortext.patch b/target/linux/patches/3.14.43/sortext.patch
index 8fd4e1d..8fd4e1d 100644
--- a/target/linux/patches/3.14.40/sortext.patch
+++ b/target/linux/patches/3.14.43/sortext.patch
diff --git a/target/linux/patches/3.14.40/startup.patch b/target/linux/patches/3.14.43/startup.patch
index d396b75..d396b75 100644
--- a/target/linux/patches/3.14.40/startup.patch
+++ b/target/linux/patches/3.14.43/startup.patch
diff --git a/target/linux/patches/3.14.40/wlan-cf.patch b/target/linux/patches/3.14.43/wlan-cf.patch
index fc20759..fc20759 100644
--- a/target/linux/patches/3.14.40/wlan-cf.patch
+++ b/target/linux/patches/3.14.43/wlan-cf.patch
diff --git a/target/linux/patches/3.14.40/xargs.patch b/target/linux/patches/3.14.43/xargs.patch
index 2c7b3df..2c7b3df 100644
--- a/target/linux/patches/3.14.40/xargs.patch
+++ b/target/linux/patches/3.14.43/xargs.patch
diff --git a/target/linux/patches/3.14.40/yaffs2.patch b/target/linux/patches/3.14.43/yaffs2.patch
index f075aa6..f075aa6 100644
--- a/target/linux/patches/3.14.40/yaffs2.patch
+++ b/target/linux/patches/3.14.43/yaffs2.patch
diff --git a/target/linux/patches/3.14.40/zlib-inflate.patch b/target/linux/patches/3.14.43/zlib-inflate.patch
index 58e1f6d..58e1f6d 100644
--- a/target/linux/patches/3.14.40/zlib-inflate.patch
+++ b/target/linux/patches/3.14.43/zlib-inflate.patch
diff --git a/target/linux/patches/4.0.3/cris32-serial.patch b/target/linux/patches/4.0.3/cris32-serial.patch
new file mode 100644
index 0000000..0f071cf
--- /dev/null
+++ b/target/linux/patches/4.0.3/cris32-serial.patch
@@ -0,0 +1,2886 @@
+diff -Nur linux-4.0.3.orig/arch/cris/arch-v32/drivers/Kconfig linux-4.0.3/arch/cris/arch-v32/drivers/Kconfig
+--- linux-4.0.3.orig/arch/cris/arch-v32/drivers/Kconfig 2015-05-13 14:14:53.000000000 +0200
++++ linux-4.0.3/arch/cris/arch-v32/drivers/Kconfig 2015-05-25 17:20:55.000000000 +0200
+@@ -49,24 +49,261 @@
+ if you do not need DMA to something else.
+ ser0 can use dma4 or dma6 for output and dma5 or dma7 for input.
+
++choice
++ prompt "Ser0 default port type "
++ depends on ETRAX_SERIAL_PORT0
++ default ETRAX_SERIAL_PORT0_TYPE_232
++ help
++ Type of serial port.
++
++config ETRAX_SERIAL_PORT0_TYPE_232
++ bool "Ser0 is a RS-232 port"
++ help
++ Configure serial port 0 to be a RS-232 port.
++
++config ETRAX_SERIAL_PORT0_TYPE_485HD
++ bool "Ser0 is a half duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 0 to be a half duplex (two wires) RS-485 port.
++
++config ETRAX_SERIAL_PORT0_TYPE_485FD
++ bool "Ser0 is a full duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 0 to be a full duplex (four wires) RS-485 port.
++endchoice
++
++config ETRAX_SER0_DTR_BIT
++ string "Ser 0 DTR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT0
++
++config ETRAX_SER0_RI_BIT
++ string "Ser 0 RI bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT0
++
++config ETRAX_SER0_DSR_BIT
++ string "Ser 0 DSR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT0
++
++config ETRAX_SER0_CD_BIT
++ string "Ser 0 CD bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT0
++
+ config ETRAX_SERIAL_PORT1
+ bool "Serial port 1 enabled"
+ depends on ETRAXFS_SERIAL
+ help
+ Enables the ETRAX FS serial driver for ser1 (ttyS1).
+
++choice
++ prompt "Ser1 default port type"
++ depends on ETRAX_SERIAL_PORT1
++ default ETRAX_SERIAL_PORT1_TYPE_232
++ help
++ Type of serial port.
++
++config ETRAX_SERIAL_PORT1_TYPE_232
++ bool "Ser1 is a RS-232 port"
++ help
++ Configure serial port 1 to be a RS-232 port.
++
++config ETRAX_SERIAL_PORT1_TYPE_485HD
++ bool "Ser1 is a half duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 1 to be a half duplex (two wires) RS-485 port.
++
++config ETRAX_SERIAL_PORT1_TYPE_485FD
++ bool "Ser1 is a full duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 1 to be a full duplex (four wires) RS-485 port.
++endchoice
++
++config ETRAX_SER1_DTR_BIT
++ string "Ser 1 DTR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT1
++
++config ETRAX_SER1_RI_BIT
++ string "Ser 1 RI bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT1
++
++config ETRAX_SER1_DSR_BIT
++ string "Ser 1 DSR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT1
++
++config ETRAX_SER1_CD_BIT
++ string "Ser 1 CD bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT1
++
+ config ETRAX_SERIAL_PORT2
+ bool "Serial port 2 enabled"
+ depends on ETRAXFS_SERIAL
+ help
+ Enables the ETRAX FS serial driver for ser2 (ttyS2).
+
++choice
++ prompt "Ser2 default port type"
++ depends on ETRAX_SERIAL_PORT2
++ default ETRAX_SERIAL_PORT2_TYPE_232
++ help
++ What DMA channel to use for ser2
++
++config ETRAX_SERIAL_PORT2_TYPE_232
++ bool "Ser2 is a RS-232 port"
++ help
++ Configure serial port 2 to be a RS-232 port.
++
++config ETRAX_SERIAL_PORT2_TYPE_485HD
++ bool "Ser2 is a half duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 2 to be a half duplex (two wires) RS-485 port.
++
++config ETRAX_SERIAL_PORT2_TYPE_485FD
++ bool "Ser2 is a full duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 2 to be a full duplex (four wires) RS-485 port.
++endchoice
++
++
++config ETRAX_SER2_DTR_BIT
++ string "Ser 2 DTR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT2
++
++config ETRAX_SER2_RI_BIT
++ string "Ser 2 RI bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT2
++
++config ETRAX_SER2_DSR_BIT
++ string "Ser 2 DSR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT2
++
++config ETRAX_SER2_CD_BIT
++ string "Ser 2 CD bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT2
++
+ config ETRAX_SERIAL_PORT3
+ bool "Serial port 3 enabled"
+ depends on ETRAXFS_SERIAL
+ help
+ Enables the ETRAX FS serial driver for ser3 (ttyS3).
+
++choice
++ prompt "Ser3 default port type"
++ depends on ETRAX_SERIAL_PORT3
++ default ETRAX_SERIAL_PORT3_TYPE_232
++ help
++ What DMA channel to use for ser3.
++
++config ETRAX_SERIAL_PORT3_TYPE_232
++ bool "Ser3 is a RS-232 port"
++ help
++ Configure serial port 3 to be a RS-232 port.
++
++config ETRAX_SERIAL_PORT3_TYPE_485HD
++ bool "Ser3 is a half duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 3 to be a half duplex (two wires) RS-485 port.
++
++config ETRAX_SERIAL_PORT3_TYPE_485FD
++ bool "Ser3 is a full duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 3 to be a full duplex (four wires) RS-485 port.
++endchoice
++
++config ETRAX_SER3_DTR_BIT
++ string "Ser 3 DTR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT3
++
++config ETRAX_SER3_RI_BIT
++ string "Ser 3 RI bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT3
++
++config ETRAX_SER3_DSR_BIT
++ string "Ser 3 DSR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT3
++
++config ETRAX_SER3_CD_BIT
++ string "Ser 3 CD bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT3
++
++config ETRAX_SERIAL_PORT4
++ bool "Serial port 4 enabled"
++ depends on ETRAXFS_SERIAL && CRIS_MACH_ARTPEC3
++ help
++ Enables the ETRAX FS serial driver for ser4 (ttyS4).
++
++choice
++ prompt "Ser4 default port type"
++ depends on ETRAX_SERIAL_PORT4
++ default ETRAX_SERIAL_PORT4_TYPE_232
++ help
++ What DMA channel to use for ser4.
++
++config ETRAX_SERIAL_PORT4_TYPE_232
++ bool "Ser4 is a RS-232 port"
++ help
++ Configure serial port 4 to be a RS-232 port.
++
++config ETRAX_SERIAL_PORT4_TYPE_485HD
++ bool "Ser4 is a half duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 4 to be a half duplex (two wires) RS-485 port.
++
++config ETRAX_SERIAL_PORT4_TYPE_485FD
++ bool "Ser4 is a full duplex RS-485 port"
++ depends on ETRAX_RS485
++ help
++ Configure serial port 4 to be a full duplex (four wires) RS-485 port.
++endchoice
++
++choice
++ prompt "Ser4 DMA in channel "
++ depends on ETRAX_SERIAL_PORT4
++ default ETRAX_SERIAL_PORT4_NO_DMA_IN
++ help
++ What DMA channel to use for ser4.
++
++
++config ETRAX_SERIAL_PORT4_NO_DMA_IN
++ bool "Ser4 uses no DMA for input"
++ help
++ Do not use DMA for ser4 input.
++
++config ETRAX_SERIAL_PORT4_DMA9_IN
++ bool "Ser4 uses DMA9 for input"
++ depends on ETRAX_SERIAL_PORT4
++ help
++ Enables the DMA9 input channel for ser4 (ttyS4).
++ If you do not enable DMA, an interrupt for each character will be
++ used when receiving data.
++ Normally you want to use DMA, unless you use the DMA channel for
++ something else.
++
++endchoice
++
++config ETRAX_SER4_DTR_BIT
++ string "Ser 4 DTR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT4
++
++config ETRAX_SER4_RI_BIT
++ string "Ser 4 RI bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT4
++
++config ETRAX_SER4_DSR_BIT
++ string "Ser 4 DSR bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT4
++
++config ETRAX_SER4_CD_BIT
++ string "Ser 4 CD bit (empty = not used)"
++ depends on ETRAX_SERIAL_PORT4
++
+ config ETRAX_SYNCHRONOUS_SERIAL
+ bool "Synchronous serial-port support"
+ depends on ETRAX_ARCH_V32
+diff -Nur linux-4.0.3.orig/arch/cris/include/uapi/asm/ioctls.h linux-4.0.3/arch/cris/include/uapi/asm/ioctls.h
+--- linux-4.0.3.orig/arch/cris/include/uapi/asm/ioctls.h 2015-05-13 14:14:53.000000000 +0200
++++ linux-4.0.3/arch/cris/include/uapi/asm/ioctls.h 2015-05-25 17:20:56.000000000 +0200
+@@ -5,6 +5,10 @@
+ #define TIOCSERSETRS485 0x5461 /* enable rs-485 (deprecated) */
+ #define TIOCSERWRRS485 0x5462 /* write rs-485 */
+ #define TIOCSRS485 0x5463 /* enable rs-485 */
++#define TIOCSERSETRS485FD 0x5464 /* set rs-485 full/half duplex mode */
++
++
++#define TIOCSERSETDIVISOR 0x5465 /* set the divisor for non standard bauds */
+
+ #include <asm-generic/ioctls.h>
+
+diff -Nur linux-4.0.3.orig/drivers/tty/serial/crisv32.c linux-4.0.3/drivers/tty/serial/crisv32.c
+--- linux-4.0.3.orig/drivers/tty/serial/crisv32.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-4.0.3/drivers/tty/serial/crisv32.c 2015-05-25 17:20:56.000000000 +0200
+@@ -0,0 +1,2581 @@
++/* $Id: crisv32.c,v 1.109 2010-07-09 15:00:44 jespern Exp $
++ *
++ * Serial port driver for the ETRAX FS chip
++ *
++ * Copyright (C) 1998-2006 Axis Communications AB
++ *
++ * Many, many authors. Based once upon a time on serial.c for 16x50.
++ *
++ * Johan Adolfsson - port to ETRAX FS
++ * Mikael Starvik - port to serial_core framework
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/console.h>
++#include <linux/types.h>
++#include <linux/errno.h>
++#include <linux/serial_core.h>
++#include <linux/delay.h>
++#include <linux/slab.h>
++#include <linux/tty_flip.h>
++
++#include <asm/io.h>
++#include <asm/irq.h>
++#include <asm/uaccess.h>
++
++#include <dma.h>
++#include <arch/system.h>
++#include <mach/pinmux.h>
++#include <hwregs/dma.h>
++#include <hwregs/reg_rdwr.h>
++#include <hwregs/ser_defs.h>
++#include <hwregs/dma_defs.h>
++#include <hwregs/gio_defs.h>
++#include <hwregs/intr_vect_defs.h>
++#include <hwregs/reg_map.h>
++
++#define UART_NR CONFIG_ETRAX_SERIAL_PORTS + 1 /* Ports + dummy port */
++#define SERIAL_RECV_DESCRIPTORS 8
++
++/* We only buffer 255 characters here, no need for more tx descriptors. */
++#define SERIAL_TX_DESCRIPTORS 4
++
++/* Kept for experimental purposes. */
++#define SERIAL_DESCR_BUF_SIZE 256
++#define regi_NULL 0
++#define DMA_WAIT_UNTIL_RESET(inst) \
++ do { \
++ reg_dma_rw_stat r; \
++ do { \
++ r = REG_RD(dma, (inst), rw_stat); \
++ } while (r.mode != regk_dma_rst); \
++ } while (0)
++
++#define __DMA(ch) regi_dma##ch
++#define DMA(ch) __DMA(ch)
++#define DMA_IRQ(ch) (DMA0_INTR_VECT + (ch))
++
++/* Macro to set up control lines for a port. */
++#define SETUP_PINS(port) \
++ if (serial_cris_ports[port].used) { \
++ if (strcmp(CONFIG_ETRAX_SER##port##_DTR_BIT, "")) \
++ crisv32_io_get_name(&serial_cris_ports[port].dtr_pin, \
++ CONFIG_ETRAX_SER##port##_DTR_BIT); \
++ else \
++ serial_cris_ports[port].dtr_pin = dummy_pin; \
++ if (strcmp(CONFIG_ETRAX_SER##port##_DSR_BIT, "")) \
++ crisv32_io_get_name(&serial_cris_ports[port].dsr_pin, \
++ CONFIG_ETRAX_SER##port##_DSR_BIT); \
++ else \
++ serial_cris_ports[port].dsr_pin = dummy_pin; \
++ if (strcmp(CONFIG_ETRAX_SER##port##_RI_BIT, "")) \
++ crisv32_io_get_name(&serial_cris_ports[port].ri_pin, \
++ CONFIG_ETRAX_SER##port##_RI_BIT); \
++ else \
++ serial_cris_ports[port].ri_pin = dummy_pin; \
++ if (strcmp(CONFIG_ETRAX_SER##port##_CD_BIT, "")) \
++ crisv32_io_get_name(&serial_cris_ports[port].cd_pin, \
++ CONFIG_ETRAX_SER##port##_CD_BIT); \
++ else \
++ serial_cris_ports[port].cd_pin = dummy_pin; \
++ }
++
++/* Set a serial port register if anything has changed. */
++#define MODIFY_REG(instance, reg, var) \
++ if (REG_RD_INT(ser, instance, reg) \
++ != REG_TYPE_CONV(int, reg_ser_##reg, var)) \
++ REG_WR(ser, instance, reg, var);
++
++/*
++ * Regarding RS485 operation in crisv32 serial driver.
++ * ---------------------------------------------------
++ * RS485 can be run in two modes, full duplex using four wires (485FD) and
++ * half duplex using two wires (485HD). The default mode of each serial port
++ * is configured in the kernel configuration. The available modes are:
++ * RS-232, RS-485 half duplex, and RS-485 full duplex.
++ *
++ * In the 485HD mode the direction of the data bus must be able to switch.
++ * The direction of the transceiver is controlled by the RTS signal. Hence
++ * the auto_rts function in the ETRAX FS chip is enabled in this mode, which
++ * automatically toggle RTS when transmitting. The initial direction of the
++ * port is receiving.
++ *
++ * In the 485FD mode two transceivers will be used, one in each direction.
++ * Usually the hardware can handle both 485HD and 485FD, which implies that
++ * one of the transceivers can change direction. Consequently that transceiver
++ * must be tied to operate in the opposite direction of the other one, setting
++ * and keeping RTS to a fixed value do this.
++ *
++ * There are two special "ioctl" that can configure the ports. These two are
++ * left for backward compatible with older applications. The effects of using
++ * them are described below:
++ * The TIOCSERSETRS485:
++ * This ioctl sets a serial port in 232 mode to 485HD mode or vise versa. The
++ * state of the port is kept when closing the port. Note that this ioctl has no
++ * effect on a serial port in the 485FD mode.
++ * The TIOCSERWRRS485:
++ * This ioctl set a serial port in 232 mode to 485HD mode and writes the data
++ * "included" in the ioctl to the port. The port will then stay in 485HD mode.
++ * Using this ioctl on a serial port in the 485HD mode will transmit the data
++ * without changing the mode. Using this ioctl on a serial port in 485FD mode
++ * will not change the mode and simply send the data using the 485FD mode.
++ */
++
++#define TYPE_232 0
++#define TYPE_485HD 1
++#define TYPE_485FD 2
++
++struct etrax_recv_buffer {
++ struct etrax_recv_buffer *next;
++ unsigned short length;
++ unsigned char error;
++ unsigned char pad;
++
++ unsigned char buffer[0];
++};
++
++struct uart_cris_port {
++ struct uart_port port;
++
++ int initialized;
++ int used;
++ int irq;
++
++ /* Used to check if port enabled as well by testing for zero. */
++ reg_scope_instances regi_ser;
++ reg_scope_instances regi_dmain;
++ reg_scope_instances regi_dmaout;
++
++ struct crisv32_iopin dtr_pin;
++ struct crisv32_iopin dsr_pin;
++ struct crisv32_iopin ri_pin;
++ struct crisv32_iopin cd_pin;
++
++ struct dma_descr_context tr_context_descr
++ __attribute__ ((__aligned__(32)));
++ struct dma_descr_data tr_descr[SERIAL_TX_DESCRIPTORS]
++ __attribute__ ((__aligned__(32)));
++ struct dma_descr_context rec_context_descr
++ __attribute__ ((__aligned__(32)));
++ struct dma_descr_data rec_descr[SERIAL_RECV_DESCRIPTORS]
++ __attribute__ ((__aligned__(32)));
++
++ /* This is the first one in the list the HW is working on now. */
++ struct dma_descr_data* first_tx_descr;
++
++ /* This is the last one in the list the HW is working on now. */
++ struct dma_descr_data* last_tx_descr;
++
++ /* This is how many characters the HW is working on now. */
++ unsigned int tx_pending_chars;
++
++ int tx_started;
++ unsigned int cur_rec_descr;
++ struct etrax_recv_buffer *first_recv_buffer;
++ struct etrax_recv_buffer *last_recv_buffer;
++
++ unsigned int recv_cnt;
++ unsigned int max_recv_cnt;
++
++ /* The time for 1 char, in usecs. */
++ unsigned long char_time_usec;
++
++ /* Last tx usec in the jiffies. */
++ unsigned long last_tx_active_usec;
++
++ /* Last tx time in jiffies. */
++ unsigned long last_tx_active;
++
++ /* Last rx usec in the jiffies. */
++ unsigned long last_rx_active_usec;
++
++ /* Last rx time in jiffies. */
++ unsigned long last_rx_active;
++
++#ifdef CONFIG_ETRAX_RS485
++ /* RS-485 support, duh. */
++ struct rs485_control rs485;
++#endif
++ int port_type;
++ int write_ongoing;
++};
++
++extern struct uart_driver serial_cris_driver;
++static struct uart_port *console_port;
++static int console_baud = 115200;
++static struct uart_cris_port serial_cris_ports[UART_NR] = {
++{
++#ifdef CONFIG_ETRAX_SERIAL_PORT0
++ .used = 1,
++ .irq = SER0_INTR_VECT,
++ .regi_ser = regi_ser0,
++ /*
++ * We initialize the dma stuff like this to get a compiler error
++ * if a CONFIG is missing
++ */
++ .regi_dmain =
++# ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
++ regi_dma7,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT0_DMA1_IN)
++ regi_dma1,
++# elif defined CONFIG_ETRAX_SERIAL_PORT0_NO_DMA_IN
++ regi_NULL,
++# endif
++
++ .regi_dmaout =
++# ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
++ regi_dma6,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT0_DMA7_OUT)
++ regi_dma7,
++# else
++ regi_NULL,
++# endif
++
++# ifdef CONFIG_ETRAX_RS485
++# ifdef CONFIG_ETRAX_SERIAL_PORT0_TYPE_485HD
++ .port_type = TYPE_485HD,
++# endif
++# ifdef CONFIG_ETRAX_SERIAL_PORT0_TYPE_485FD
++ .port_type = TYPE_485FD,
++# endif
++# endif
++#else
++ .regi_ser = regi_NULL,
++ .regi_dmain = regi_NULL,
++ .regi_dmaout = regi_NULL,
++#endif
++ .write_ongoing = 0
++}, /* ttyS0 */
++{
++#ifdef CONFIG_ETRAX_SERIAL_PORT1
++ .used = 1,
++ .irq = SER1_INTR_VECT,
++ .regi_ser = regi_ser1,
++ .regi_dmain =
++# ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA5_IN
++ regi_dma5,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_IN)
++ regi_NULL,
++# endif
++
++ .regi_dmaout =
++# ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA4_OUT
++ regi_dma4,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT1_NO_DMA_OUT)
++ regi_NULL,
++# endif
++
++# ifdef CONFIG_ETRAX_RS485
++# ifdef CONFIG_ETRAX_SERIAL_PORT1_TYPE_485HD
++ .port_type = TYPE_485HD,
++# endif
++# ifdef CONFIG_ETRAX_SERIAL_PORT1_TYPE_485FD
++ .port_type = TYPE_485FD,
++# endif
++# endif
++#else
++ .regi_ser = regi_NULL,
++ .regi_dmain = regi_NULL,
++ .regi_dmaout = regi_NULL,
++#endif
++ .write_ongoing = 0
++}, /* ttyS1 */
++{
++#ifdef CONFIG_ETRAX_SERIAL_PORT2
++ .used = 1,
++ .irq = SER2_INTR_VECT,
++ .regi_ser = regi_ser2,
++ .regi_dmain =
++# ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
++ regi_dma3,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT2_DMA7_IN)
++ regi_dma7,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_IN)
++ regi_NULL,
++# endif
++
++ .regi_dmaout =
++# ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
++ regi_dma2,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT2_DMA6_OUT)
++ regi_dma6,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT2_NO_DMA_OUT)
++ regi_NULL,
++# endif
++
++# ifdef CONFIG_ETRAX_RS485
++# ifdef CONFIG_ETRAX_SERIAL_PORT2_TYPE_485HD
++ .port_type = TYPE_485HD,
++# endif
++# ifdef CONFIG_ETRAX_SERIAL_PORT2_TYPE_485FD
++ .port_type = TYPE_485FD,
++# endif
++# endif
++#else
++ .regi_ser = regi_NULL,
++ .regi_dmain = regi_NULL,
++ .regi_dmaout = regi_NULL,
++#endif
++ .write_ongoing = 0
++}, /* ttyS2 */
++{
++#ifdef CONFIG_ETRAX_SERIAL_PORT3
++ .used = 1,
++ .irq = SER3_INTR_VECT,
++ .regi_ser = regi_ser3,
++ .regi_dmain =
++# ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA9_IN
++ regi_dma9,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT3_DMA4_IN)
++ regi_dma3,
++# else
++ regi_NULL,
++# endif
++
++ .regi_dmaout =
++# ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA8_OUT
++ regi_dma8,
++# elif defined(CONFIG_ETRAX_SERIAL_PORT3_DMA2_OUT)
++ regi_dma2,
++# else
++ regi_NULL,
++# endif
++# ifdef CONFIG_ETRAX_RS485
++# ifdef CONFIG_ETRAX_SERIAL_PORT3_TYPE_485HD
++ .port_type = TYPE_485HD,
++# endif
++# ifdef CONFIG_ETRAX_SERIAL_PORT3_TYPE_485FD
++ .port_type = TYPE_485FD,
++# endif
++# endif
++#else
++ .regi_ser = regi_NULL,
++ .regi_dmain = regi_NULL,
++ .regi_dmaout = regi_NULL,
++#endif
++ .write_ongoing = 0
++}, /* ttyS3 */
++#if CONFIG_ETRAX_SERIAL_PORTS == 5
++{
++#ifdef CONFIG_ETRAX_SERIAL_PORT4
++ .used = 1,
++ .irq = SER4_INTR_VECT,
++ .regi_ser = regi_ser4,
++ .regi_dmain =
++# ifdef CONFIG_ETRAX_SERIAL_PORT4_DMA9_IN
++ regi_dma9,
++# else
++ regi_NULL,
++# endif
++
++ .regi_dmaout = regi_NULL,
++# ifdef CONFIG_ETRAX_RS485
++# ifdef CONFIG_ETRAX_SERIAL_PORT4_TYPE_485HD
++ .port_type = TYPE_485HD,
++# endif
++# ifdef CONFIG_ETRAX_SERIAL_PORT4_TYPE_485FD
++ .port_type = TYPE_485FD,
++# endif
++# endif
++#else
++ .regi_ser = regi_NULL,
++ .regi_dmain = regi_NULL,
++ .regi_dmaout = regi_NULL,
++#endif
++ .write_ongoing = 0
++}, /* ttyS4 */
++#endif
++{
++#ifdef CONFIG_ETRAX_DEBUG_PORT_NULL
++ .used = 1,
++#endif
++ .regi_ser = regi_NULL,
++ .write_ongoing = 0
++} /* Dummy console port */
++
++};
++
++/* Dummy pin used for unused CD, DSR, DTR and RI signals. */
++static unsigned long io_dummy;
++static struct crisv32_ioport dummy_port =
++{
++ &io_dummy,
++ &io_dummy,
++ &io_dummy,
++ 32
++};
++static struct crisv32_iopin dummy_pin =
++{
++ &dummy_port,
++ 0
++};
++
++static int selected_console =
++#if defined(CONFIG_ETRAX_DEBUG_PORT0)
++0;
++#elif defined(CONFIG_ETRAX_DEBUG_PORT1)
++1;
++#elif defined(CONFIG_ETRAX_DEBUG_PORT2)
++2;
++#elif defined(CONFIG_ETRAX_DEBUG_PORT3)
++3;
++#elif defined(CONFIG_ETRAX_DEBUG_PORT4)
++4;
++#else /* CONFIG_ETRAX_DEBUG_PORT_NULL */
++#if CONFIG_ETRAX_SERIAL_PORTS == 5
++5;
++#else
++4;
++#endif
++#endif
++
++extern void reset_watchdog(void);
++
++static void serial_cris_stop_rx(struct uart_port *port);
++
++/*
++ * Interrupts are disabled on entering
++ */
++#ifndef CONFIG_ETRAX_VCS_SIM
++static void
++cris_console_write(struct console *co, const char *s, unsigned int count)
++{
++ struct uart_cris_port *up;
++ int i;
++ reg_ser_r_stat_din stat;
++ reg_ser_rw_tr_dma_en tr_dma_en, old;
++
++ up = &serial_cris_ports[selected_console];
++
++ /*
++ * This function isn't covered by the struct uart_ops, so we
++ * have to check manually that the port really is there,
++ * configured and live.
++ */
++ if (!up->regi_ser)
++ return;
++
++ /* Switch to manual mode. */
++ tr_dma_en = old = REG_RD (ser, up->regi_ser, rw_tr_dma_en);
++ if (tr_dma_en.en == regk_ser_yes) {
++ tr_dma_en.en = regk_ser_no;
++ REG_WR(ser, up->regi_ser, rw_tr_dma_en, tr_dma_en);
++ }
++
++ /* Send data. */
++ for (i = 0; i < count; i++) {
++ /* LF -> CRLF */
++ if (s[i] == '\n') {
++ do {
++ stat = REG_RD (ser, up->regi_ser, r_stat_din);
++ } while (!stat.tr_rdy);
++ REG_WR_INT (ser, up->regi_ser, rw_dout, '\r');
++ }
++ /* Wait until transmitter is ready and send. */
++ do {
++ stat = REG_RD (ser, up->regi_ser, r_stat_din);
++ } while (!stat.tr_rdy);
++ REG_WR_INT (ser, up->regi_ser, rw_dout, s[i]);
++
++ /* Feed watchdog, because this may take looong time. */
++ reset_watchdog();
++ }
++
++ /* Restore mode. */
++ if (tr_dma_en.en != old.en)
++ REG_WR(ser, up->regi_ser, rw_tr_dma_en, old);
++}
++#else
++
++extern void print_str( const char *str );
++static char buffer[1024];
++static char msg[] = "Debug: ";
++static int buffer_pos = sizeof(msg) - 1;
++
++static void
++cris_console_write(struct console *co, const char *buf, unsigned int len)
++{
++ char* pos;
++ pos = memchr(buf, '\n', len);
++ if (pos) {
++ int l = ++pos - buf;
++ memcpy(buffer + buffer_pos, buf, l);
++ memcpy(buffer, msg, sizeof(msg) - 1);
++ buffer[buffer_pos + l] = '\0';
++ print_str(buffer);
++ buffer_pos = sizeof(msg) - 1;
++ if (pos - buf != len) {
++ memcpy(buffer + buffer_pos, pos, len - l);
++ buffer_pos += len - l;
++ }
++ } else {
++ memcpy(buffer + buffer_pos, buf, len);
++ buffer_pos += len;
++ }
++}
++#endif
++
++static void cris_serial_port_init(struct uart_port *port, int line);
++static int __init
++cris_console_setup(struct console *co, char *options)
++{
++ struct uart_port *port;
++ int baud = 115200;
++ int bits = 8;
++ int parity = 'n';
++ int flow = 'n';
++
++ if (co->index >= UART_NR)
++ co->index = 0;
++ if (options)
++ selected_console = co->index;
++ port = &serial_cris_ports[selected_console].port;
++ console_port = port;
++
++ co->flags |= CON_CONSDEV;
++
++ if (options)
++ uart_parse_options(options, &baud, &parity, &bits, &flow);
++ console_baud = baud;
++ cris_serial_port_init(port, selected_console);
++ co->index = port->line;
++ uart_set_options(port, co, baud, parity, bits, flow);
++
++ return 0;
++}
++
++static struct tty_driver*
++cris_console_device(struct console* co, int *index)
++{
++ struct uart_driver *p = co->data;
++ *index = selected_console;
++ return p->tty_driver;
++}
++
++static struct console cris_console = {
++ .name = "ttyS",
++ .write = cris_console_write,
++ .device = cris_console_device,
++ .setup = cris_console_setup,
++ .flags = CON_PRINTBUFFER,
++ .index = -1,
++ .data = &serial_cris_driver,
++};
++
++#define SERIAL_CRIS_CONSOLE &cris_console
++
++struct uart_driver serial_cris_driver = {
++ .owner = THIS_MODULE,
++ .driver_name = "serial",
++ .dev_name = "ttyS",
++ .major = TTY_MAJOR,
++ .minor = 64,
++ .nr = UART_NR,
++ .cons = SERIAL_CRIS_CONSOLE,
++};
++
++static int inline crisv32_serial_get_rts(struct uart_cris_port *up)
++{
++ reg_scope_instances regi_ser = up->regi_ser;
++ /*
++ * Return what the user has controlled rts to or
++ * what the pin is? (if auto_rts is used it differs during tx)
++ */
++ reg_ser_r_stat_din rstat = REG_RD(ser, regi_ser, r_stat_din);
++ return !(rstat.rts_n == regk_ser_active);
++}
++
++/*
++ * A set = 0 means 3.3V on the pin, bitvalue: 0=active, 1=inactive
++ * 0=0V , 1=3.3V
++ */
++static inline void crisv32_serial_set_rts(struct uart_cris_port *up, int set, int force)
++{
++ reg_scope_instances regi_ser = up->regi_ser;
++
++#ifdef CONFIG_ETRAX_RS485
++ /* Never toggle RTS if port is in 485 mode. If port is in 485FD mode we
++ * do not want to send with the reciever and for 485HD mode auto_rts
++ * take care of the RTS for us.
++ */
++ if (force || !up->rs485.enabled) {
++#else
++ {
++#endif
++ unsigned long flags;
++ reg_ser_rw_rec_ctrl rec_ctrl;
++
++ local_irq_save(flags);
++ rec_ctrl = REG_RD(ser, regi_ser, rw_rec_ctrl);
++
++ if (set)
++ rec_ctrl.rts_n = regk_ser_active;
++ else
++ rec_ctrl.rts_n = regk_ser_inactive;
++ REG_WR(ser, regi_ser, rw_rec_ctrl, rec_ctrl);
++ local_irq_restore(flags);
++ }
++}
++
++/* Input */
++static int inline crisv32_serial_get_cts(struct uart_cris_port *up)
++{
++ reg_scope_instances regi_ser = up->regi_ser;
++ reg_ser_r_stat_din rstat = REG_RD(ser, regi_ser, r_stat_din);
++ return (rstat.cts_n == regk_ser_active);
++}
++
++/*
++ * Send a single character for XON/XOFF purposes. We do it in this separate
++ * function instead of the alternative support port.x_char, in the ...start_tx
++ * function, so we don't mix up this case with possibly enabling transmission
++ * of queued-up data (in case that's disabled after *receiving* an XOFF or
++ * negative CTS). This function is used for both DMA and non-DMA case; see HW
++ * docs specifically blessing sending characters manually when DMA for
++ * transmission is enabled and running. We may be asked to transmit despite
++ * the transmitter being disabled by a ..._stop_tx call so we need to enable
++ * it temporarily but restore the state afterwards.
++ *
++ * Beware: I'm not sure how the RS-485 stuff is supposed to work. Using
++ * XON/XOFF seems problematic if there are several controllers, but if it's
++ * actually RS-422 (multi-drop; one sender and multiple receivers), it might
++ * Just Work, so don't bail out just because it looks a little suspicious.
++ */
++
++void serial_cris_send_xchar(struct uart_port *port, char ch)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ reg_ser_rw_dout dout = { .data = ch };
++ reg_ser_rw_ack_intr ack_intr = { .tr_rdy = regk_ser_yes };
++ reg_ser_r_stat_din rstat;
++ reg_ser_rw_tr_ctrl prev_tr_ctrl, tr_ctrl;
++ reg_scope_instances regi_ser = up->regi_ser;
++ unsigned long flags;
++
++ /*
++ * Wait for tr_rdy in case a character is already being output. Make
++ * sure we have integrity between the register reads and the writes
++ * below, but don't busy-wait with interrupts off and the port lock
++ * taken.
++ */
++ spin_lock_irqsave(&port->lock, flags);
++ do {
++ spin_unlock_irqrestore(&port->lock, flags);
++ spin_lock_irqsave(&port->lock, flags);
++ prev_tr_ctrl = tr_ctrl = REG_RD(ser, regi_ser, rw_tr_ctrl);
++ rstat = REG_RD(ser, regi_ser, r_stat_din);
++ } while (!rstat.tr_rdy);
++
++ /*
++ * Ack an interrupt if one was just issued for the previous character
++ * that was output. This is required for non-DMA as the interrupt is
++ * used as the only indicator that the transmitter is ready and it
++ * isn't while this x_char is being transmitted.
++ */
++ REG_WR(ser, regi_ser, rw_ack_intr, ack_intr);
++
++ /* Enable the transmitter in case it was disabled. */
++ tr_ctrl.stop = 0;
++ REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
++
++ /*
++ * Finally, send the blessed character; nothing should stop it now,
++ * except for an xoff-detected state, which we'll handle below.
++ */
++ REG_WR(ser, regi_ser, rw_dout, dout);
++ up->port.icount.tx++;
++
++ /* There might be an xoff state to clear. */
++ rstat = REG_RD(ser, up->regi_ser, r_stat_din);
++
++ /*
++ * Clear any xoff state that *may* have been there to
++ * inhibit transmission of the character.
++ */
++ if (rstat.xoff_detect) {
++ reg_ser_rw_xoff_clr xoff_clr = { .clr = 1 };
++ reg_ser_rw_tr_dma_en tr_dma_en;
++ REG_WR(ser, regi_ser, rw_xoff_clr, xoff_clr);
++ tr_dma_en = REG_RD(ser, regi_ser, rw_tr_dma_en);
++
++ /*
++ * If we had an xoff state but cleared it, instead sneak in a
++ * disabled state for the transmitter, after the character we
++ * sent. Thus we keep the port disabled, just as if the xoff
++ * state was still in effect (or actually, as if stop_tx had
++ * been called, as we stop DMA too).
++ */
++ prev_tr_ctrl.stop = 1;
++
++ tr_dma_en.en = 0;
++ REG_WR(ser, regi_ser, rw_tr_dma_en, tr_dma_en);
++ }
++
++ /* Restore "previous" enabled/disabled state of the transmitter. */
++ REG_WR(ser, regi_ser, rw_tr_ctrl, prev_tr_ctrl);
++
++ spin_unlock_irqrestore(&port->lock, flags);
++}
++
++static void transmit_chars_dma(struct uart_cris_port *up);
++
++/*
++ * Do not spin_lock_irqsave or disable interrupts by other means here; it's
++ * already done by the caller.
++ */
++
++static void serial_cris_start_tx(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ reg_scope_instances regi_ser = up->regi_ser;
++ reg_ser_rw_tr_ctrl tr_ctrl;
++
++ /* we have already done below if a write is ongoing */
++ if (!up->regi_dmaout && up->write_ongoing)
++ return;
++
++#ifdef CONFIG_ETRAX_RS485
++ if (up->rs485.enabled)
++ {
++ /* If we are in RS-485 mode, we need to toggle RTS and disable
++ * the receiver before initiating a DMA transfer
++ */
++
++ if (up->rs485.delay_rts_before_send > 0) {
++ reg_ser_rw_tr_ctrl tr_ctrl = REG_RD(ser, regi_ser, rw_tr_ctrl);
++ tr_ctrl.auto_rts = regk_ser_no;
++ REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
++ crisv32_serial_set_rts(up, up->rs485.rts_on_send, 1);
++ msleep(up->rs485.delay_rts_before_send);
++ tr_ctrl.auto_rts = regk_ser_yes;
++ REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
++ crisv32_serial_set_rts(up, !up->rs485.rts_on_send, 1);
++ }
++ }
++#endif
++
++ tr_ctrl = REG_RD(ser, regi_ser, rw_tr_ctrl);
++ tr_ctrl.stop = regk_ser_no;
++ REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
++ if (!up->regi_dmaout) {
++ reg_ser_rw_intr_mask intr_mask =
++ REG_RD(ser, regi_ser, rw_intr_mask);
++ intr_mask.tr_rdy = regk_ser_yes;
++ REG_WR(ser, regi_ser, rw_intr_mask, intr_mask);
++ up->write_ongoing = 1;
++ } else {
++ /*
++ * We're called possibly to re-enable transmission after it
++ * has been disabled. If so, DMA needs to be re-enabled.
++ */
++ reg_ser_rw_tr_dma_en tr_dma_en = { .en = 1 };
++ REG_WR(ser, regi_ser, rw_tr_dma_en, tr_dma_en);
++ transmit_chars_dma(up);
++ }
++}
++
++/*
++ * This function handles both the DMA and non-DMA case by ordering the
++ * transmitter to stop of after the current character. We don't need to wait
++ * for any such character to be completely transmitted; we do that where it
++ * matters, like in serial_cris_set_termios. Don't busy-wait here; see
++ * Documentation/serial/driver: this function is called within
++ * spin_lock_irq{,save} and thus separate ones would be disastrous (when SMP).
++ * There's no documented need to set the txd pin to any particular value;
++ * break setting is controlled solely by serial_cris_break_ctl.
++ */
++
++static void serial_cris_stop_tx(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ reg_scope_instances regi_ser = up->regi_ser;
++ reg_ser_rw_tr_ctrl tr_ctrl;
++ reg_ser_rw_intr_mask intr_mask;
++ reg_ser_rw_tr_dma_en tr_dma_en = {0};
++ reg_ser_rw_xoff_clr xoff_clr = {0};
++
++ /*
++ * For the non-DMA case, we'd get a tr_rdy interrupt that we're not
++ * interested in as we're not transmitting any characters. For the
++ * DMA case, that interrupt is already turned off, but no reason to
++ * waste code on conditionals here.
++ */
++ intr_mask = REG_RD(ser, regi_ser, rw_intr_mask);
++ intr_mask.tr_rdy = regk_ser_no;
++ REG_WR(ser, regi_ser, rw_intr_mask, intr_mask);
++
++ tr_ctrl = REG_RD(ser, regi_ser, rw_tr_ctrl);
++ tr_ctrl.stop = 1;
++ REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
++
++ /*
++ * Always clear possible hardware xoff-detected state here, no need to
++ * unnecessary consider mctrl settings and when they change. We clear
++ * it here rather than in start_tx: both functions are called as the
++ * effect of XOFF processing, but start_tx is also called when upper
++ * levels tell the driver that there are more characters to send, so
++ * avoid adding code there.
++ */
++ xoff_clr.clr = 1;
++ REG_WR(ser, regi_ser, rw_xoff_clr, xoff_clr);
++
++ /*
++ * Disable transmitter DMA, so that if we're in XON/XOFF, we can send
++ * those single characters without also giving go-ahead for queued up
++ * DMA data.
++ */
++ tr_dma_en.en = 0;
++ REG_WR(ser, regi_ser, rw_tr_dma_en, tr_dma_en);
++}
++
++static void serial_cris_stop_rx(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ reg_scope_instances regi_ser = up->regi_ser;
++ reg_ser_rw_rec_ctrl rec_ctrl = REG_RD(ser, regi_ser, rw_rec_ctrl);
++
++ rec_ctrl.en = regk_ser_no;
++ REG_WR(ser, regi_ser, rw_rec_ctrl, rec_ctrl);
++}
++
++static void serial_cris_enable_ms(struct uart_port *port)
++{
++}
++
++static void check_modem_status(struct uart_cris_port *up)
++{
++}
++
++static unsigned int serial_cris_tx_empty(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ unsigned long flags;
++ unsigned int ret;
++ reg_ser_r_stat_din rstat = {0};
++
++ spin_lock_irqsave(&up->port.lock, flags);
++ if (up->regi_dmaout) {
++ /*
++ * For DMA, before looking at r_stat, we need to check that we
++ * either haven't actually started or that end-of-list is
++ * reached, else a tr_empty indication is just an internal
++ * state. The caller qualifies, if needed, that the
++ * port->info.xmit buffer is empty, so we don't need to
++ * check that.
++ */
++ reg_dma_rw_stat status = REG_RD(dma, up->regi_dmaout, rw_stat);
++
++ if (!up->tx_started) {
++ ret = 1;
++ goto done;
++ }
++
++ if (status.list_state != regk_dma_data_at_eol) {
++ ret = 0;
++ goto done;
++ }
++ }
++
++ rstat = REG_RD(ser, up->regi_ser, r_stat_din);
++ ret = rstat.tr_empty ? TIOCSER_TEMT : 0;
++
++ done:
++ spin_unlock_irqrestore(&up->port.lock, flags);
++ return ret;
++}
++static unsigned int serial_cris_get_mctrl(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ unsigned int ret;
++
++ ret = 0;
++ if (crisv32_serial_get_rts(up))
++ ret |= TIOCM_RTS;
++ /* DTR is active low */
++ if (!crisv32_io_rd(&up->dtr_pin))
++ ret |= TIOCM_DTR;
++ /* CD is active low */
++ if (!crisv32_io_rd(&up->cd_pin))
++ ret |= TIOCM_CD;
++ /* RI is active low */
++ if (!crisv32_io_rd(&up->ri_pin))
++ ret |= TIOCM_RI;
++ /* DSR is active low */
++ if (!crisv32_io_rd(&up->dsr_pin))
++ ret |= TIOCM_DSR;
++ if (crisv32_serial_get_cts(up))
++ ret |= TIOCM_CTS;
++ return ret;
++}
++
++static void serial_cris_set_mctrl(struct uart_port *port, unsigned int mctrl)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++
++ crisv32_serial_set_rts(up, mctrl & TIOCM_RTS ? 1 : 0, 0);
++ /* DTR is active low */
++ crisv32_io_set(&up->dtr_pin, mctrl & TIOCM_DTR ? 0 : 1);
++ /* RI is active low */
++ crisv32_io_set(&up->ri_pin, mctrl & TIOCM_RNG ? 0 : 1);
++ /* CD is active low */
++ crisv32_io_set(&up->cd_pin, mctrl & TIOCM_CD ? 0 : 1);
++}
++
++static void serial_cris_break_ctl(struct uart_port *port, int break_state)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ unsigned long flags;
++ reg_ser_rw_tr_ctrl tr_ctrl;
++ reg_ser_rw_tr_dma_en tr_dma_en;
++ reg_ser_rw_intr_mask intr_mask;
++
++ spin_lock_irqsave(&up->port.lock, flags);
++ tr_ctrl = REG_RD(ser, up->regi_ser, rw_tr_ctrl);
++ tr_dma_en = REG_RD(ser, up->regi_ser, rw_tr_dma_en);
++ intr_mask = REG_RD(ser, up->regi_ser, rw_intr_mask);
++
++ if (break_state != 0) { /* Send break */
++ /*
++ * We need to disable DMA (if used) or tr_rdy interrupts if no
++ * DMA. No need to make this conditional on use of DMA;
++ * disabling will be a no-op for the other mode.
++ */
++ intr_mask.tr_rdy = regk_ser_no;
++ tr_dma_en.en = 0;
++
++ /*
++ * Stop transmission and set the txd pin to 0 after the
++ * current character. The txd setting will take effect after
++ * any current transmission has completed.
++ */
++ tr_ctrl.stop = 1;
++ tr_ctrl.txd = 0;
++ } else {
++ /* Re-enable either transmit DMA or the serial interrupt. */
++ if (up->regi_dmaout)
++ tr_dma_en.en = 1;
++ else
++ intr_mask.tr_rdy = regk_ser_yes;
++
++
++ tr_ctrl.stop = 0;
++ tr_ctrl.txd = 1;
++ }
++ REG_WR(ser, up->regi_ser, rw_tr_ctrl, tr_ctrl);
++ REG_WR(ser, up->regi_ser, rw_tr_dma_en, tr_dma_en);
++ REG_WR(ser, up->regi_ser, rw_intr_mask, intr_mask);
++
++ spin_unlock_irqrestore(&up->port.lock, flags);
++}
++
++/*
++ * The output DMA channel is free - use it to send as many chars as
++ * possible.
++ */
++
++static void
++transmit_chars_dma(struct uart_cris_port *up)
++{
++ struct dma_descr_data *descr, *pending_descr, *dmapos;
++ struct dma_descr_data *last_tx_descr;
++ struct circ_buf *xmit = &up->port.state->xmit;
++ unsigned int sentl = 0;
++ reg_dma_rw_ack_intr ack_intr = { .data = regk_dma_yes };
++ reg_dma_rw_stat status;
++ reg_scope_instances regi_dmaout = up->regi_dmaout;
++ unsigned int chars_in_q;
++ unsigned int chars_to_send;
++
++ /* Acknowledge dma data descriptor irq, if there was one. */
++ REG_WR(dma, regi_dmaout, rw_ack_intr, ack_intr);
++
++ /*
++ * First get the amount of bytes sent during the last DMA transfer,
++ * and update xmit accordingly.
++ */
++ status = REG_RD(dma, regi_dmaout, rw_stat);
++ if (status.list_state == regk_dma_data_at_eol || !up->tx_started)
++ dmapos = phys_to_virt((int)up->last_tx_descr->next);
++ else
++ dmapos = phys_to_virt(REG_RD_INT(dma, regi_dmaout, rw_data));
++
++ pending_descr = up->first_tx_descr;
++ while (pending_descr != dmapos) {
++ sentl += pending_descr->after - pending_descr->buf;
++ pending_descr->after = pending_descr->buf = NULL;
++ pending_descr = phys_to_virt((int)pending_descr->next);
++ }
++
++ up->first_tx_descr = pending_descr;
++ last_tx_descr = up->last_tx_descr;
++
++ /* Update stats. */
++ up->port.icount.tx += sentl;
++
++ up->tx_pending_chars -= sentl;
++
++ /* Update xmit buffer. */
++ xmit->tail = (xmit->tail + sentl) & (UART_XMIT_SIZE - 1);
++
++ /*
++ * Find out the largest amount of consecutive bytes we want to send
++ * now.
++ */
++ chars_in_q = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
++
++ if (chars_in_q == 0)
++ /* Tell upper layers that we're now idle. */
++ goto done;
++
++ /* Some of those characters are actually pending output. */
++ chars_to_send = chars_in_q - up->tx_pending_chars;
++
++ /*
++ * Clamp the new number of pending chars to the advertised
++ * one.
++ */
++ if (chars_to_send + up->tx_pending_chars > up->port.fifosize)
++ chars_to_send = up->port.fifosize - up->tx_pending_chars;
++
++ /* If we don't want to send any, we're done. */
++ if (chars_to_send == 0)
++ goto done;
++
++ descr = phys_to_virt((int)last_tx_descr->next);
++
++ /*
++ * We can't send anything if we could make the condition in
++ * the while-loop above (reaping finished descriptors) be met
++ * immediately before the first iteration. However, don't
++ * mistake the full state for the empty state.
++ */
++ if ((descr == up->first_tx_descr && up->tx_pending_chars != 0)
++ || descr->next == up->first_tx_descr)
++ goto done;
++
++ /* Set up the descriptor for output. */
++ descr->buf = (void*)virt_to_phys(xmit->buf + xmit->tail
++ + up->tx_pending_chars);
++ descr->after = descr->buf + chars_to_send;
++ descr->eol = 1;
++ descr->out_eop = 0;
++ descr->intr = 1;
++ descr->wait = 0;
++ descr->in_eop = 0;
++ descr->md = 0;
++ /*
++ * Make sure GCC doesn't move this eol clear before the eol set
++ * above.
++ */
++ barrier();
++ last_tx_descr->eol = 0;
++
++ up->last_tx_descr = descr;
++ up->tx_pending_chars += chars_to_send;
++
++ if (!up->tx_started) {
++ up->tx_started = 1;
++ up->tr_context_descr.next = 0;
++ up->tr_context_descr.saved_data
++ = (dma_descr_data*)virt_to_phys(descr);
++ up->tr_context_descr.saved_data_buf = descr->buf;
++ DMA_START_CONTEXT(regi_dmaout,
++ virt_to_phys(&up->tr_context_descr));
++ } else
++ DMA_CONTINUE_DATA(regi_dmaout);
++
++ /* DMA is now running (hopefully). */
++
++ done:
++ if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
++ uart_write_wakeup(&up->port);
++}
++
++static void
++transmit_chars_no_dma(struct uart_cris_port *up)
++{
++ int max_count;
++ struct circ_buf *xmit = &up->port.state->xmit;
++
++ reg_scope_instances regi_ser = up->regi_ser;
++ reg_ser_r_stat_din rstat;
++ reg_ser_rw_ack_intr ack_intr = { .tr_rdy = regk_ser_yes };
++
++ if (uart_circ_empty(xmit) || uart_tx_stopped(&up->port)) {
++ /* No more to send, so disable the interrupt. */
++ reg_ser_rw_intr_mask intr_mask;
++ intr_mask = REG_RD(ser, regi_ser, rw_intr_mask);
++ intr_mask.tr_rdy = 0;
++ intr_mask.tr_empty = 0;
++ REG_WR(ser, regi_ser, rw_intr_mask, intr_mask);
++ up->write_ongoing=0;
++ return;
++ }
++
++ /* If the serport is fast, we send up to max_count bytes before
++ exiting the loop. */
++ max_count = 64;
++ do {
++ reg_ser_rw_dout dout = { .data = xmit->buf[xmit->tail] };
++ REG_WR(ser, regi_ser, rw_dout, dout);
++ REG_WR(ser, regi_ser, rw_ack_intr, ack_intr);
++ xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE-1);
++ up->port.icount.tx++;
++ if (xmit->head == xmit->tail)
++ break;
++ rstat = REG_RD(ser, regi_ser, r_stat_din);
++ } while ((--max_count > 0) && rstat.tr_rdy);
++
++ if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
++ uart_write_wakeup(&up->port);
++} /* transmit_chars_no_dma */
++
++static struct etrax_recv_buffer *
++alloc_recv_buffer(unsigned int size)
++{
++ struct etrax_recv_buffer *buffer;
++
++ if (!(buffer = kmalloc(sizeof *buffer + size, GFP_ATOMIC)))
++ panic("%s: Could not allocate %d bytes buffer\n",
++ __FUNCTION__, size);
++
++ buffer->next = NULL;
++ buffer->length = 0;
++ buffer->error = TTY_NORMAL;
++
++ return buffer;
++}
++
++static void
++append_recv_buffer(struct uart_cris_port *up,
++ struct etrax_recv_buffer *buffer)
++{
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ if (!up->first_recv_buffer)
++ up->first_recv_buffer = buffer;
++ else
++ up->last_recv_buffer->next = buffer;
++
++ up->last_recv_buffer = buffer;
++
++ up->recv_cnt += buffer->length;
++ if (up->recv_cnt > up->max_recv_cnt)
++ up->max_recv_cnt = up->recv_cnt;
++
++ local_irq_restore(flags);
++}
++
++static int
++add_char_and_flag(struct uart_cris_port *up, unsigned char data,
++ unsigned char flag)
++{
++ struct etrax_recv_buffer *buffer;
++
++ buffer = alloc_recv_buffer(4);
++ buffer->length = 1;
++ buffer->error = flag;
++ buffer->buffer[0] = data;
++
++ append_recv_buffer(up, buffer);
++
++ up->port.icount.rx++;
++
++ return 1;
++}
++
++static void
++flush_to_flip_buffer(struct uart_cris_port *up)
++{
++ struct etrax_recv_buffer *buffer;
++
++ if (!up->first_recv_buffer)
++ return;
++
++ while ((buffer = up->first_recv_buffer)) {
++ unsigned int count = (unsigned int)
++ tty_insert_flip_string(&up->port.state->port,
++ buffer->buffer,
++ buffer->length);
++
++ up->recv_cnt -= count;
++
++ if (count == buffer->length) {
++ up->first_recv_buffer = buffer->next;
++ kfree(buffer);
++ } else {
++ buffer->length -= count;
++ memmove(buffer->buffer, buffer->buffer + count,
++ buffer->length);
++ buffer->error = TTY_NORMAL;
++ }
++ }
++
++ if (!up->first_recv_buffer)
++ up->last_recv_buffer = NULL;
++
++ /* This call includes a check for low-latency. */
++ tty_flip_buffer_push(&up->port.state->port);
++}
++
++static unsigned int
++handle_descr_data(struct uart_cris_port *up, struct dma_descr_data *descr,
++ unsigned int recvl)
++{
++ struct etrax_recv_buffer *buffer
++ = phys_to_virt((unsigned long)descr->buf) - sizeof *buffer;
++
++ if (up->recv_cnt + recvl > 65536) {
++ printk(KERN_ERR "Too much pending incoming data on %s!"
++ " Dropping %u bytes.\n", up->port.state->port.tty->name,
++ recvl);
++ return 0;
++ }
++
++ buffer->length = recvl;
++
++ append_recv_buffer(up, buffer);
++
++ flush_to_flip_buffer(up);
++
++ buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE);
++ descr->buf = (void*)virt_to_phys(buffer->buffer);
++ descr->after = descr->buf + SERIAL_DESCR_BUF_SIZE;
++
++ return recvl;
++}
++
++static unsigned int
++handle_all_descr_data(struct uart_cris_port *up)
++{
++ struct dma_descr_data *descr
++ = &up->rec_descr[(up->cur_rec_descr - 1)
++ % SERIAL_RECV_DESCRIPTORS];
++ struct dma_descr_data *prev_descr;
++ unsigned int recvl;
++ unsigned int ret = 0;
++ reg_scope_instances regi_dmain = up->regi_dmain;
++
++ while (1) {
++ prev_descr = descr;
++ descr = &up->rec_descr[up->cur_rec_descr];
++
++ if (descr == phys_to_virt(REG_RD(dma, regi_dmain, rw_data)))
++ break;
++
++ if (++up->cur_rec_descr == SERIAL_RECV_DESCRIPTORS)
++ up->cur_rec_descr = 0;
++
++ /* Find out how many bytes were read. */
++ recvl = descr->after - descr->buf;
++
++ /* Update stats. */
++ up->port.icount.rx += recvl;
++
++ ret += handle_descr_data(up, descr, recvl);
++ descr->eol = 1;
++ /*
++ * Make sure GCC doesn't move this eol clear before the
++ * eol set above.
++ */
++ barrier();
++ prev_descr->eol = 0;
++ flush_dma_descr(descr,1); // Cache bug workaround
++ flush_dma_descr(prev_descr,0); // Cache bug workaround
++ }
++
++ return ret;
++}
++
++static void
++receive_chars_dma(struct uart_cris_port *up)
++{
++ reg_ser_r_stat_din rstat;
++ reg_dma_rw_ack_intr ack_intr = {0};
++
++ /* Acknowledge both dma_descr and dma_eop irq. */
++ ack_intr.data = 1;
++ ack_intr.in_eop = 1;
++ REG_WR(dma, up->regi_dmain, rw_ack_intr, ack_intr);
++
++ handle_all_descr_data(up);
++
++ /* Read the status register to detect errors. */
++ rstat = REG_RD(ser, up->regi_ser, r_stat_din);
++
++ if (rstat.framing_err | rstat.par_err | rstat.orun) {
++ /*
++ * If we got an error, we must reset it by reading the
++ * rs_stat_din register and put the data in buffer manually.
++ */
++ reg_ser_rs_stat_din stat_din;
++ stat_din = REG_RD(ser, up->regi_ser, rs_stat_din);
++
++ if (stat_din.par_err)
++ add_char_and_flag(up, stat_din.data, TTY_PARITY);
++ else if (stat_din.orun)
++ add_char_and_flag(up, stat_din.data, TTY_OVERRUN);
++ else if (stat_din.framing_err)
++ add_char_and_flag(up, stat_din.data, TTY_FRAME);
++ }
++
++ /* Restart the receiving DMA, in case it got stuck on an EOL. */
++ DMA_CONTINUE_DATA(up->regi_dmain);
++}
++
++void receive_chars_no_dma(struct uart_cris_port *up)
++{
++ reg_ser_rs_stat_din stat_din;
++ reg_ser_r_stat_din rstat;
++ struct uart_icount *icount;
++ int max_count = 16;
++ char flag;
++ reg_ser_rw_ack_intr ack_intr = { 0 };
++
++ rstat = REG_RD(ser, up->regi_ser, r_stat_din);
++ up->last_rx_active_usec = GET_JIFFIES_USEC();
++ up->last_rx_active = jiffies;
++ icount = &up->port.icount;
++
++ do {
++ stat_din = REG_RD(ser, up->regi_ser, rs_stat_din);
++
++ flag = TTY_NORMAL;
++ ack_intr.dav = 1;
++ REG_WR(ser, up->regi_ser, rw_ack_intr, ack_intr);
++ icount->rx++;
++
++ if (stat_din.framing_err | stat_din.par_err | stat_din.orun) {
++ if (stat_din.data == 0x00 &&
++ stat_din.framing_err) {
++ /* Most likely a break. */
++ flag = TTY_BREAK;
++ icount->brk++;
++ } else if (stat_din.par_err) {
++ flag = TTY_PARITY;
++ icount->parity++;
++ } else if (stat_din.orun) {
++ flag = TTY_OVERRUN;
++ icount->overrun++;
++ } else if (stat_din.framing_err) {
++ flag = TTY_FRAME;
++ icount->frame++;
++ }
++ }
++
++ /*
++ * If this becomes important, we probably *could* handle this
++ * gracefully by keeping track of the unhandled character.
++ */
++ if (!tty_insert_flip_char(&up->port.state->port, stat_din.data, flag))
++ panic("%s: No tty buffer space", __FUNCTION__);
++ rstat = REG_RD(ser, up->regi_ser, r_stat_din);
++ } while (rstat.dav && (max_count-- > 0));
++ spin_unlock(&up->port.lock);
++ tty_flip_buffer_push(&up->port.state->port);
++ spin_lock(&up->port.lock);
++} /* receive_chars_no_dma */
++
++/*
++ * DMA output channel interrupt handler.
++ * this interrupt is called from DMA2(ser2), DMA8(ser3), DMA6(ser0) or
++ * DMA4(ser1) when they have finished a descriptor with the intr flag set.
++ */
++static irqreturn_t dma_tr_interrupt(int irq, void *dev_id)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)dev_id;
++ reg_dma_r_masked_intr masked_intr;
++ reg_scope_instances regi_dmaout;
++ int handled = 0;
++
++ spin_lock(&up->port.lock);
++ regi_dmaout = up->regi_dmaout;
++ if (!regi_dmaout) {
++ spin_unlock(&up->port.lock);
++ return IRQ_NONE;
++ }
++
++ /*
++ * Check for dma_descr (don't need to check for dma_eop in
++ * output DMA for serial).
++ */
++ masked_intr = REG_RD(dma, regi_dmaout, r_masked_intr);
++
++ if (masked_intr.data) {
++ /* We can send a new dma bunch. make it so. */
++
++ /*
++ * Read jiffies_usec first.
++ * We want this time to be as late as possible.
++ */
++ up->last_tx_active_usec = GET_JIFFIES_USEC();
++ up->last_tx_active = jiffies;
++ transmit_chars_dma(up);
++ handled = 1;
++ }
++ check_modem_status(up);
++ spin_unlock(&up->port.lock);
++ return IRQ_RETVAL(handled);
++}
++
++/* DMA input channel interrupt handler. */
++
++static irqreturn_t
++dma_rec_interrupt(int irq, void *dev_id)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)dev_id;
++ reg_dma_r_masked_intr masked_intr;
++ reg_scope_instances regi_dmain;
++ int handled = 0;
++
++ spin_lock(&up->port.lock);
++ regi_dmain = up->regi_dmain;
++ if (!regi_dmain) {
++ spin_unlock(&up->port.lock);
++ return IRQ_NONE;
++ }
++
++ /* Check for both dma_eop and dma_descr for the input dma channel. */
++ masked_intr = REG_RD(dma, regi_dmain, r_masked_intr);
++ if (masked_intr.data || masked_intr.in_eop) {
++ /* We have received something. */
++ receive_chars_dma(up);
++ handled = 1;
++ }
++ check_modem_status(up);
++ spin_unlock(&up->port.lock);
++ return IRQ_RETVAL(handled);
++}
++
++/* "Normal" serial port interrupt handler - both rx and tx. */
++
++static irqreturn_t
++ser_interrupt(int irq, void *dev_id)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)dev_id;
++ reg_scope_instances regi_ser;
++ int handled = 0;
++
++ spin_lock(&up->port.lock);
++ if (up->regi_dmain && up->regi_dmaout) {
++ spin_unlock(&up->port.lock);
++ return IRQ_NONE;
++ }
++
++ regi_ser = up->regi_ser;
++
++ if (regi_ser) {
++ reg_ser_r_masked_intr masked_intr;
++ masked_intr = REG_RD(ser, regi_ser, r_masked_intr);
++ /*
++ * Check what interrupts are active before taking
++ * actions. If DMA is used the interrupt shouldn't
++ * be enabled.
++ */
++ if (masked_intr.dav) {
++ receive_chars_no_dma(up);
++ handled = 1;
++ }
++ check_modem_status(up);
++
++ if (masked_intr.tr_rdy) {
++ transmit_chars_no_dma(up);
++ handled = 1;
++ }
++ }
++ spin_unlock(&up->port.lock);
++ return IRQ_RETVAL(handled);
++} /* ser_interrupt */
++
++static int start_recv_dma(struct uart_cris_port *up)
++{
++ struct dma_descr_data *descr = up->rec_descr;
++ struct etrax_recv_buffer *buffer;
++ int i;
++
++ /* Set up the receiving descriptors. */
++ for (i = 0; i < SERIAL_RECV_DESCRIPTORS; i++) {
++ buffer = alloc_recv_buffer(SERIAL_DESCR_BUF_SIZE);
++ descr[i].next = (void*)virt_to_phys(&descr[i+1]);
++ descr[i].buf = (void*)virt_to_phys(buffer->buffer);
++ descr[i].after = descr[i].buf + SERIAL_DESCR_BUF_SIZE;
++ descr[i].eol = 0;
++ descr[i].out_eop = 0;
++ descr[i].intr = 1;
++ descr[i].wait = 0;
++ descr[i].in_eop = 0;
++ descr[i].md = 0;
++
++ }
++
++ /* Link the last descriptor to the first. */
++ descr[i-1].next = (void*)virt_to_phys(&descr[0]);
++
++ /* And mark it as end of list. */
++ descr[i-1].eol = 1;
++
++ /* Start with the first descriptor in the list. */
++ up->cur_rec_descr = 0;
++ up->rec_context_descr.next = 0;
++ up->rec_context_descr.saved_data
++ = (dma_descr_data *)virt_to_phys(&descr[up->cur_rec_descr]);
++ up->rec_context_descr.saved_data_buf = descr[up->cur_rec_descr].buf;
++
++ /* Start the DMA. */
++ DMA_START_CONTEXT(up->regi_dmain,
++ virt_to_phys(&up->rec_context_descr));
++
++ /* Input DMA should be running now. */
++ return 1;
++}
++
++#ifdef CONFIG_CONSOLE_POLL
++/*
++ * Console polling routines for writing and reading from the uart while
++ * in an interrupt or debug context.
++ */
++
++static int serial_artpec_get_poll_char(struct uart_port *port)
++{
++ reg_ser_rs_stat_din stat;
++ reg_ser_rw_ack_intr ack_intr = { 0 };
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++
++ do {
++ stat = REG_RD(ser, up->regi_ser, rs_stat_din);
++ } while (!stat.dav);
++
++ /* Ack the data_avail interrupt. */
++ ack_intr.dav = 1;
++ REG_WR(ser, up->regi_ser, rw_ack_intr, ack_intr);
++
++ return stat.data;
++}
++
++static void serial_artpec_put_poll_char(struct uart_port *port,
++ unsigned char c)
++{
++ reg_ser_r_stat_din stat;
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++
++ do {
++ stat = REG_RD (ser, up->regi_ser, r_stat_din);
++ } while (!stat.tr_rdy);
++ REG_WR_INT (ser, up->regi_ser, rw_dout, c);
++}
++#endif /* CONFIG_CONSOLE_POLL */
++
++static void start_receive(struct uart_cris_port *up)
++{
++ reg_scope_instances regi_dmain = up->regi_dmain;
++ if (regi_dmain) {
++ start_recv_dma(up);
++ }
++}
++
++
++static void start_transmitter(struct uart_cris_port *up)
++{
++ int i;
++ reg_scope_instances regi_dmaout = up->regi_dmaout;
++ if (regi_dmaout) {
++ for (i = 0; i < SERIAL_TX_DESCRIPTORS; i++) {
++ memset(&up->tr_descr[i], 0, sizeof(up->tr_descr[i]));
++ up->tr_descr[i].eol = 1;
++ up->tr_descr[i].intr = 1;
++ up->tr_descr[i].next = (dma_descr_data *)
++ virt_to_phys(&up->tr_descr[i+1]);
++ }
++ up->tr_descr[i-1].next = (dma_descr_data *)
++ virt_to_phys(&up->tr_descr[0]);
++ up->first_tx_descr = &up->tr_descr[0];
++
++ /*
++ * We'll be counting up to up->last_tx_descr->next from
++ * up->first_tx_descr when starting DMA, so we should make
++ * them the same for the very first round. If instead we'd
++ * set last_tx_descr = first_tx_descr, we'd rely on
++ * accidentally working code and data as we'd take a pass over
++ * the first, unused, descriptor.
++ */
++ up->last_tx_descr = &up->tr_descr[i-1];
++ up->tx_started = 0;
++ up->tx_pending_chars = 0;
++ }
++}
++
++static int serial_cris_startup(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ unsigned long flags;
++ reg_ser_rw_intr_mask ser_intr_mask = {0};
++ reg_dma_rw_intr_mask dmain_intr_mask = {0};
++ reg_dma_rw_intr_mask dmaout_intr_mask = {0};
++ reg_dma_rw_cfg cfg = {.en = 1};
++ reg_scope_instances regi_dma;
++
++ /* We dont disable interrupts here because request_irq should
++ not be called with ints disabled. */
++ spin_lock(&up->port.lock);
++
++ dmain_intr_mask.data = dmain_intr_mask.in_eop = regk_dma_yes;
++ dmaout_intr_mask.data = regk_dma_yes;
++ if (!up->regi_dmain)
++ ser_intr_mask.dav = regk_ser_yes;
++
++ if (port->line == 0) {
++ if (request_irq(SER0_INTR_VECT, ser_interrupt,
++ IRQF_DISABLED, "ser0",
++ &serial_cris_ports[0]))
++ panic("irq ser0");
++ /* Port ser0 can use dma6 for tx and dma7 for rx. */
++#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
++ if (request_irq(DMA6_INTR_VECT, dma_tr_interrupt,
++ IRQF_DISABLED, "serial 0 dma tr",
++ &serial_cris_ports[0]))
++ panic("irq ser0txdma");
++ crisv32_request_dma(6, "ser0", DMA_PANIC_ON_ERROR, 0,
++ dma_ser0);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
++ if (request_irq(DMA7_INTR_VECT, dma_rec_interrupt,
++ IRQF_DISABLED, "serial 0 dma rec",
++ &serial_cris_ports[0]))
++ panic("irq ser0rxdma");
++ crisv32_request_dma(7, "ser0", DMA_PANIC_ON_ERROR, 0,
++ dma_ser0);
++#endif
++ } else if (port->line == 1) {
++ if (request_irq(SER1_INTR_VECT, ser_interrupt,
++ IRQF_DISABLED, "ser1",
++ &serial_cris_ports[1]))
++ panic("irq ser1");
++
++ /* Port ser1 can use dma4 for tx and dma5 for rx. */
++#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA4_OUT
++ if (request_irq(DMA4_INTR_VECT, dma_tr_interrupt,
++ IRQF_DISABLED, "serial 1 dma tr",
++ &serial_cris_ports[1]))
++ panic("irq ser1txdma");
++ crisv32_request_dma(4, "ser1", DMA_PANIC_ON_ERROR, 0,
++ dma_ser1);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA5_IN
++ if (request_irq(DMA5_INTR_VECT, dma_rec_interrupt,
++ IRQF_DISABLED, "serial 1 dma rec",
++ &serial_cris_ports[1]))
++ panic("irq ser1rxdma");
++ crisv32_request_dma(5, "ser1", DMA_PANIC_ON_ERROR, 0,
++ dma_ser1);
++#endif
++ } else if (port->line == 2) {
++ if (request_irq(SER2_INTR_VECT, ser_interrupt,
++ IRQF_DISABLED, "ser2",
++ &serial_cris_ports[2]))
++ panic("irq ser2");
++
++ /* Port ser2 can use dma2 for tx and dma3 for rx. */
++#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
++ if (request_irq(DMA2_INTR_VECT, dma_tr_interrupt,
++ IRQF_DISABLED, "serial 2 dma tr",
++ &serial_cris_ports[2]))
++ panic("irq ser2txdma");
++ crisv32_request_dma(2, "ser2", DMA_PANIC_ON_ERROR, 0,
++ dma_ser2);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
++ if (request_irq(DMA3_INTR_VECT, dma_rec_interrupt,
++ IRQF_DISABLED, "serial 2 dma rec",
++ &serial_cris_ports[2]))
++ panic("irq ser2rxdma");
++ crisv32_request_dma(3, "ser2", DMA_PANIC_ON_ERROR, 0,
++ dma_ser2);
++#endif
++ } else if (port->line == 3) {
++ if (request_irq(SER3_INTR_VECT, ser_interrupt,
++ IRQF_DISABLED, "ser3",
++ &serial_cris_ports[3]))
++ panic("irq ser3" );
++
++ /* Port ser3 can use dma8 for tx and dma9 for rx. */
++#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA8_OUT
++ if (request_irq(DMA8_INTR_VECT, dma_tr_interrupt,
++ IRQF_DISABLED, "serial 3 dma tr",
++ &serial_cris_ports[3]))
++ panic("irq ser3txdma");
++ crisv32_request_dma(8, "ser3", DMA_PANIC_ON_ERROR, 0,
++ dma_ser3);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA9_IN
++ if (request_irq(DMA9_INTR_VECT, dma_rec_interrupt,
++ IRQF_DISABLED, "serial 3 dma rec",
++ &serial_cris_ports[3]))
++ panic("irq ser3rxdma");
++ crisv32_request_dma(9, "ser3", DMA_PANIC_ON_ERROR, 0,
++ dma_ser3);
++#endif
++ }
++#if CONFIG_ETRAX_SERIAL_PORTS == 5
++ else if (port->line == 4) {
++ if (request_irq(SER4_INTR_VECT, ser_interrupt,
++ IRQF_DISABLED, "ser4",
++ &serial_cris_ports[4]))
++ panic("irq ser4" );
++
++#ifdef CONFIG_ETRAX_SERIAL_PORT4_DMA_OUT
++ if (request_irq(DMA4_INTR_VECT, dma_tr_interrupt,
++ IRQF_DISABLED, "serial 4 dma tr",
++ &serial_cris_ports[4]))
++ panic("irq ser4txdma");
++ crisv32_request_dma(5, "ser4", DMA_PANIC_ON_ERROR, 0,
++ dma_ser4);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT4_DMA_IN
++ if (request_irq(DMA5_INTR_VECT, dma_rec_interrupt,
++ IRQF_DISABLED, "serial 4 dma rec",
++ &serial_cris_ports[4]))
++ panic("irq ser4rxdma");
++ crisv32_request_dma(5, "ser4", DMA_PANIC_ON_ERROR, 0,
++ dma_ser4);
++#endif
++ }
++#endif
++
++ local_irq_save(flags);
++
++ /*
++ * Reset the DMA channels and make sure their interrupts are cleared.
++ */
++
++ regi_dma = up->regi_dmain;
++ if (regi_dma) {
++ reg_dma_rw_ack_intr ack_intr = { 0 };
++ DMA_RESET(regi_dma);
++ /* Wait until reset cycle is complete. */
++ DMA_WAIT_UNTIL_RESET(regi_dma);
++ REG_WR(dma, regi_dma, rw_cfg, cfg);
++ /* Make sure the irqs are cleared. */
++ ack_intr.group = 1;
++ ack_intr.ctxt = 1;
++ ack_intr.data = 1;
++ ack_intr.in_eop = 1;
++ ack_intr.stream_cmd = 1;
++ REG_WR(dma, regi_dma, rw_ack_intr, ack_intr);
++ }
++ regi_dma = up->regi_dmaout;
++ if (regi_dma) {
++ reg_dma_rw_ack_intr ack_intr = { 0 };
++ DMA_RESET(regi_dma);
++ /* Wait until reset cycle is complete. */
++ DMA_WAIT_UNTIL_RESET(regi_dma);
++ REG_WR(dma, regi_dma, rw_cfg, cfg);
++ /* Make sure the irqs are cleared. */
++ ack_intr.group = 1;
++ ack_intr.ctxt = 1;
++ ack_intr.data = 1;
++ ack_intr.in_eop = 1;
++ ack_intr.stream_cmd = 1;
++ REG_WR(dma, regi_dma, rw_ack_intr, ack_intr);
++ }
++
++ REG_WR(ser, up->regi_ser, rw_intr_mask, ser_intr_mask);
++ if (up->regi_dmain)
++ REG_WR(dma, up->regi_dmain, rw_intr_mask, dmain_intr_mask);
++ if (up->regi_dmaout)
++ REG_WR(dma, up->regi_dmaout, rw_intr_mask, dmaout_intr_mask);
++
++ start_receive(up);
++ start_transmitter(up);
++
++ serial_cris_set_mctrl(&up->port, up->port.mctrl);
++
++ local_irq_restore(flags);
++ spin_unlock(&up->port.lock);
++
++ return 0;
++}
++
++static void serial_cris_shutdown(struct uart_port *port)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ unsigned long flags;
++
++ spin_lock_irqsave(&up->port.lock, flags);
++
++ serial_cris_stop_tx(port);
++ serial_cris_stop_rx(port);
++
++ if (port->line == 0) {
++ free_irq(SER0_INTR_VECT, &serial_cris_ports[0]);
++#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA6_OUT
++ crisv32_free_dma(6);
++ free_irq(DMA6_INTR_VECT, &serial_cris_ports[0]);
++#elif defined(CONFIG_ETRAX_SERIAL_PORT0_DMA0_OUT)
++ crisv32_free_dma(0);
++ free_irq(DMA0_INTR_VECT, &serial_cris_ports[0]);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT0_DMA7_IN
++ crisv32_free_dma(7);
++ free_irq(DMA7_INTR_VECT, &serial_cris_ports[0]);
++#elif defined(CONFIG_ETRAX_SERIAL_PORT0_DMA1_IN)
++ crisv32_free_dma(1);
++ free_irq(DMA1_INTR_VECT, &serial_cris_ports[0]);
++#endif
++ } else if (port->line == 1) {
++ free_irq(SER1_INTR_VECT, &serial_cris_ports[1]);
++#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA4_OUT
++ crisv32_free_dma(4);
++ free_irq(DMA4_INTR_VECT, &serial_cris_ports[1]);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT1_DMA5_IN
++ crisv32_free_dma(5);
++ free_irq(DMA5_INTR_VECT, &serial_cris_ports[1]);
++#endif
++ } else if (port->line == 2) {
++ free_irq(SER2_INTR_VECT, &serial_cris_ports[2]);
++#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA2_OUT
++ crisv32_free_dma(2);
++ free_irq(DMA2_INTR_VECT, &serial_cris_ports[2]);
++#elif defined(CONFIG_ETRAX_SERIAL_PORT2_DMA6_OUT)
++ crisv32_free_dma(6);
++ free_irq(DMA6_INTR_VECT, &serial_cris_ports[2]);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
++ crisv32_free_dma(3);
++ free_irq(DMA3_INTR_VECT, &serial_cris_ports[2]);
++#elif defined(CONFIG_ETRAX_SERIAL_PORT2_DMA7_IN)
++ crisv32_free_dma(7);
++ free_irq(DMA7_INTR_VECT, &serial_cris_ports[2]);
++#endif
++ } else if (port->line == 3) {
++ free_irq(SER3_INTR_VECT, &serial_cris_ports[3]);
++#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA8_OUT
++ crisv32_free_dma(8);
++ free_irq(DMA8_INTR_VECT, &serial_cris_ports[3]);
++#elif defined(CONFIG_ETRAX_SERIAL_PORT3_DMA2_OUT)
++ crisv32_free_dma(2);
++ free_irq(DMA2_INTR_VECT, &serial_cris_ports[3]);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT3_DMA9_IN
++ crisv32_free_dma(9);
++ free_irq(DMA9_INTR_VECT, &serial_cris_ports[3]);
++#elif defined(CONFIG_ETRAX_SERIAL_PORT3_DMA3_IN)
++ crisv32_free_dma(3);
++ free_irq(DMA3_INTR_VECT, &serial_cris_ports[3]);
++#endif
++ }
++#if CONFIG_ETRAX_SERIAL_PORTS == 5
++ else if (port->line == 4) {
++ free_irq(SER4_INTR_VECT, &serial_cris_ports[4]);
++#ifdef CONFIG_ETRAX_SERIAL_PORT4_DMA9_IN
++ crisv32_free_dma(9);
++ free_irq(DMA9_INTR_VECT, &serial_cris_ports[4]);
++#endif
++ }
++#endif
++
++ serial_cris_set_mctrl(&up->port, up->port.mctrl);
++
++ if (up->regi_dmain) {
++ struct etrax_recv_buffer *rb;
++ struct etrax_recv_buffer *rb_next;
++ int i;
++ struct dma_descr_data *descr;
++
++ /*
++ * In case of DMA and receive errors, there might be pending
++ * receive buffers still linked here and not flushed upwards.
++ * Release them.
++ */
++ for (rb = up->first_recv_buffer; rb != NULL; rb = rb_next) {
++ rb_next = rb->next;
++ kfree (rb);
++ }
++ up->first_recv_buffer = NULL;
++ up->last_recv_buffer = NULL;
++
++ /*
++ * Also release buffers that were attached to the DMA
++ * before we shut down the hardware above.
++ */
++ for (i = 0, descr = up->rec_descr;
++ i < SERIAL_RECV_DESCRIPTORS;
++ i++)
++ if (descr[i].buf) {
++ rb = phys_to_virt((u32) descr[i].buf)
++ - sizeof *rb;
++ kfree(rb);
++ descr[i].buf = NULL;
++ }
++ }
++
++ spin_unlock_irqrestore(&up->port.lock, flags);
++
++}
++
++static void
++serial_cris_set_termios(struct uart_port *port, struct ktermios *termios,
++ struct ktermios *old)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ unsigned long flags;
++ reg_ser_rw_xoff xoff;
++ reg_ser_rw_xoff_clr xoff_clr = {0};
++ reg_ser_rw_tr_ctrl tx_ctrl = {0};
++ reg_ser_rw_tr_dma_en tx_dma_en = {0};
++ reg_ser_rw_rec_ctrl rx_ctrl = {0};
++ reg_ser_rw_tr_baud_div tx_baud_div = {0};
++ reg_ser_rw_rec_baud_div rx_baud_div = {0};
++ reg_ser_r_stat_din rstat;
++ int baud;
++
++ if (old &&
++ termios->c_cflag == old->c_cflag &&
++ termios->c_iflag == old->c_iflag)
++ return;
++
++ /* Start with default settings and then fill in changes. */
++
++ /* Tx: 8 bit, no/even parity, 1 stop bit, no cts. */
++ tx_ctrl.base_freq = regk_ser_f29_493;
++ tx_ctrl.en = 0;
++ tx_ctrl.stop = 0;
++#ifdef CONFIG_ETRAX_RS485
++ if (up->rs485.enabled && (up->port_type != TYPE_485FD)) {
++ tx_ctrl.auto_rts = regk_ser_yes;
++ tx_ctrl.rts_setup = regk_ser_bits2;
++
++ if (termios->c_cflag & CSTOPB) {
++ /* 2 stop bits. */
++ tx_ctrl.rts_delay = regk_ser_del2;
++ }
++ else {
++ /* 1 stop bits. */
++ tx_ctrl.rts_delay = regk_ser_del1;
++ }
++ } else
++#endif
++ tx_ctrl.auto_rts = regk_ser_no;
++ tx_ctrl.txd = 1;
++ tx_ctrl.auto_cts = 0;
++ /* Rx: 8 bit, no/even parity. */
++ if (up->regi_dmain) {
++ rx_ctrl.dma_mode = 1;
++ rx_ctrl.auto_eop = 1;
++ }
++ rx_ctrl.dma_err = regk_ser_stop;
++ rx_ctrl.sampling = regk_ser_majority;
++ rx_ctrl.timeout = 1;
++
++#ifdef CONFIG_ETRAX_RS485
++ if (up->rs485.enabled && (up->port_type != TYPE_485FD)) {
++# ifdef CONFIG_ETRAX_RS485_DISABLE_RECEIVER
++ rx_ctrl.half_duplex = regk_ser_yes;
++# endif
++ rx_ctrl.rts_n = up->rs485.rts_after_sent ?
++ regk_ser_active : regk_ser_inactive;
++ } else if (up->port_type == TYPE_485FD) {
++ rx_ctrl.rts_n = regk_ser_active;
++ } else
++#endif
++ rx_ctrl.rts_n = regk_ser_inactive;
++
++ /* Common for tx and rx: 8N1. */
++ tx_ctrl.data_bits = regk_ser_bits8;
++ rx_ctrl.data_bits = regk_ser_bits8;
++ tx_ctrl.par = regk_ser_even;
++ rx_ctrl.par = regk_ser_even;
++ tx_ctrl.par_en = regk_ser_no;
++ rx_ctrl.par_en = regk_ser_no;
++
++ tx_ctrl.stop_bits = regk_ser_bits1;
++
++
++ /* Change baud-rate and write it to the hardware. */
++
++ /* baud_clock = base_freq / (divisor*8)
++ * divisor = base_freq / (baud_clock * 8)
++ * base_freq is either:
++ * off, ext, 29.493MHz, 32.000 MHz, 32.768 MHz or 100 MHz
++ * 20.493MHz is used for standard baudrates
++ */
++
++ /*
++ * For the console port we keep the original baudrate here. Not very
++ * beautiful.
++ */
++ if ((port != console_port) || old)
++ baud = uart_get_baud_rate(port, termios, old, 0,
++ port->uartclk / 8);
++ else
++ baud = console_baud;
++
++ tx_baud_div.div = 29493000 / (8 * baud);
++ /* Rx uses same as tx. */
++ rx_baud_div.div = tx_baud_div.div;
++ rx_ctrl.base_freq = tx_ctrl.base_freq;
++
++ if ((termios->c_cflag & CSIZE) == CS7) {
++ /* Set 7 bit mode. */
++ tx_ctrl.data_bits = regk_ser_bits7;
++ rx_ctrl.data_bits = regk_ser_bits7;
++ }
++
++ if (termios->c_cflag & CSTOPB) {
++ /* Set 2 stop bit mode. */
++ tx_ctrl.stop_bits = regk_ser_bits2;
++ }
++
++ if (termios->c_cflag & PARENB) {
++ /* Enable parity. */
++ tx_ctrl.par_en = regk_ser_yes;
++ rx_ctrl.par_en = regk_ser_yes;
++ }
++
++ if (termios->c_cflag & CMSPAR) {
++ if (termios->c_cflag & PARODD) {
++ /* Set mark parity if PARODD and CMSPAR. */
++ tx_ctrl.par = regk_ser_mark;
++ rx_ctrl.par = regk_ser_mark;
++ } else {
++ tx_ctrl.par = regk_ser_space;
++ rx_ctrl.par = regk_ser_space;
++ }
++ } else {
++ if (termios->c_cflag & PARODD) {
++ /* Set odd parity. */
++ tx_ctrl.par = regk_ser_odd;
++ rx_ctrl.par = regk_ser_odd;
++ }
++ }
++
++ if (termios->c_cflag & CRTSCTS) {
++ /* Enable automatic CTS handling. */
++ tx_ctrl.auto_cts = regk_ser_yes;
++ }
++
++ /* Make sure the tx and rx are enabled. */
++ tx_ctrl.en = regk_ser_yes;
++ rx_ctrl.en = regk_ser_yes;
++
++ /*
++ * Wait for tr_idle in case a character is being output, so it won't
++ * be damaged by the changes we do below. It seems the termios
++ * changes "sometimes" (we can't see e.g. a tcsetattr TCSANOW
++ * parameter here) should take place no matter what state. However,
++ * in case we should wait, we may have a non-empty transmitter state
++ * as we tell the upper layers that we're all done when we've passed
++ * characters to the hardware, but we don't wait for them being
++ * actually shifted out.
++ */
++ spin_lock_irqsave(&port->lock, flags);
++
++ /*
++ * None of our interrupts re-enable DMA, so it's thankfully ok to
++ * disable it once, outside the loop.
++ */
++ tx_dma_en.en = 0;
++ REG_WR(ser, up->regi_ser, rw_tr_dma_en, tx_dma_en);
++ do {
++ /*
++ * Make sure we have integrity between the read r_stat status
++ * and us writing the registers below, but don't busy-wait
++ * with interrupts off. We need to keep the port lock though
++ * (if we go SMP), so nobody else writes characters.
++ */
++ local_irq_restore(flags);
++ local_irq_save(flags);
++ rstat = REG_RD(ser, up->regi_ser, r_stat_din);
++ } while (!rstat.tr_idle);
++
++ /* Actually write the control regs (if modified) to the hardware. */
++
++ uart_update_timeout(port, termios->c_cflag, port->uartclk/8);
++ MODIFY_REG(up->regi_ser, rw_rec_baud_div, rx_baud_div);
++ MODIFY_REG(up->regi_ser, rw_rec_ctrl, rx_ctrl);
++
++ MODIFY_REG(up->regi_ser, rw_tr_baud_div, tx_baud_div);
++ MODIFY_REG(up->regi_ser, rw_tr_ctrl, tx_ctrl);
++
++ tx_dma_en.en = up->regi_dmaout != 0;
++ REG_WR(ser, up->regi_ser, rw_tr_dma_en, tx_dma_en);
++
++ xoff = REG_RD(ser, up->regi_ser, rw_xoff);
++
++ if (up->port.state && up->port.state->port.tty &&
++ (termios->c_iflag & IXON)) {
++ xoff.chr = STOP_CHAR(up->port.state->port.tty);
++ xoff.automatic = regk_ser_yes;
++ } else
++ xoff.automatic = regk_ser_no;
++
++ MODIFY_REG(up->regi_ser, rw_xoff, xoff);
++
++ /*
++ * Make sure we don't start in an automatically shut-off state due to
++ * a previous early exit.
++ */
++ xoff_clr.clr = 1;
++ REG_WR(ser, up->regi_ser, rw_xoff_clr, xoff_clr);
++
++ serial_cris_set_mctrl(&up->port, up->port.mctrl);
++ spin_unlock_irqrestore(&up->port.lock, flags);
++}
++
++static const char *
++serial_cris_type(struct uart_port *port)
++{
++ return "CRISv32";
++}
++
++static void serial_cris_release_port(struct uart_port *port)
++{
++}
++
++static int serial_cris_request_port(struct uart_port *port)
++{
++ return 0;
++}
++
++static void serial_cris_config_port(struct uart_port *port, int flags)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ up->port.type = PORT_CRIS;
++}
++
++#if defined(CONFIG_ETRAX_RS485)
++
++static void cris_set_rs485_mode(struct uart_cris_port* up) {
++ reg_ser_rw_tr_ctrl tr_ctrl;
++ reg_ser_rw_rec_ctrl rec_ctrl;
++ reg_scope_instances regi_ser = up->regi_ser;
++
++ if (up->port_type == TYPE_485FD)
++ /* We do not want to change anything if we are in 485FD mode */
++ return;
++
++ tr_ctrl = REG_RD(ser, regi_ser, rw_tr_ctrl);
++ rec_ctrl = REG_RD(ser, regi_ser, rw_rec_ctrl);
++
++ /* Set port in RS-485 mode */
++ if (up->rs485.enabled) {
++ tr_ctrl.auto_rts = regk_ser_yes;
++ rec_ctrl.rts_n = up->rs485.rts_after_sent ?
++ regk_ser_active : regk_ser_inactive;
++ }
++ /* Set port to RS-232 mode */
++ else {
++ rec_ctrl.rts_n = regk_ser_inactive;
++ tr_ctrl.auto_rts = regk_ser_no;
++ rec_ctrl.half_duplex = regk_ser_no;
++ }
++
++ REG_WR(ser, regi_ser, rw_tr_ctrl, tr_ctrl);
++ REG_WR(ser, regi_ser, rw_rec_ctrl, rec_ctrl);
++}
++
++/* Enable/disable RS-485 mode on selected port. */
++static int
++cris_enable_rs485(struct uart_cris_port* up, struct rs485_control *r)
++{
++ if (up->port_type == TYPE_485FD)
++ /* Port in 485FD mode can not chage mode */
++ goto out;
++
++ up->rs485.enabled = 0x1 & r->enabled;
++ up->rs485.rts_on_send = 0x01 & r->rts_on_send;
++ up->rs485.rts_after_sent = 0x01 & r->rts_after_sent;
++ up->rs485.delay_rts_before_send = r->delay_rts_before_send;
++
++ cris_set_rs485_mode(up);
++ out:
++ return 0;
++}
++
++
++/* Enable RS485 mode on port and send the data. Port will stay
++ * in 485 mode after the data has been sent.
++ */
++static int
++cris_write_rs485(struct uart_cris_port *up, const unsigned char* buf, int count)
++{
++ up->rs485.enabled = 1;
++
++ /* Set the port in RS485 mode */
++ cris_set_rs485_mode(up);
++
++ /* Send the data */
++ count = serial_cris_driver.tty_driver->ops->write(up->port.state->port.tty, buf, count);
++
++ return count;
++}
++
++#endif /* CONFIG_ETRAX_RS485 */
++
++static int serial_cris_ioctl(struct uart_port *port, unsigned int cmd,
++ unsigned long arg)
++{
++#if defined(CONFIG_ETRAX_RS485)
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++
++ switch (cmd) {
++ case TIOCSRS485: {
++ struct serial_rs485 in;
++ struct rs485_control rs485ctrl;
++ if (copy_from_user(&in, (struct serial_rs485 *)cmd,
++ sizeof(rs485ctrl)))
++ return -EFAULT;
++ rs485ctrl.rts_on_send = in.flags & SER_RS485_RTS_ON_SEND;
++ rs485ctrl.rts_after_sent = in.flags & SER_RS485_RTS_AFTER_SEND;
++ rs485ctrl.enabled = in.flags & SER_RS485_ENABLED;
++ rs485ctrl.delay_rts_before_send = in.delay_rts_before_send;
++
++ return cris_enable_rs485(up, &rs485ctrl);
++ }
++
++ case TIOCSERSETRS485: {
++ struct rs485_control rs485ctrl;
++ if (copy_from_user(&rs485ctrl, (struct rs485_control*) arg,
++ sizeof(rs485ctrl)))
++ return -EFAULT;
++
++ return cris_enable_rs485(up, &rs485ctrl);
++ }
++
++ case TIOCSERWRRS485: {
++ struct rs485_write rs485wr;
++ if (copy_from_user(&rs485wr, (struct rs485_write*)arg,
++ sizeof(rs485wr)))
++ return -EFAULT;
++
++ return cris_write_rs485(up, rs485wr.outc, rs485wr.outc_size);
++ }
++
++ case TIOCSERSETRS485FD: {
++ reg_scope_instances regi_ser = up->regi_ser;
++ reg_ser_rw_rec_ctrl rec_ctrl = REG_RD(ser, regi_ser, rw_rec_ctrl);
++
++ if (arg)
++ rec_ctrl.half_duplex = regk_ser_no;
++ else
++ rec_ctrl.half_duplex = regk_ser_yes;
++
++ REG_WR(ser, regi_ser, rw_rec_ctrl, rec_ctrl);
++ return 0;
++ }
++
++ case TIOCSERSETDIVISOR: {
++ reg_ser_rw_tr_baud_div tx_baud_div = {0};
++ reg_ser_rw_rec_baud_div rx_baud_div = {0};
++
++ /* divisor must be >= 8 */
++ if (arg < 8)
++ return -EINVAL;
++
++ tx_baud_div.div = arg;
++ rx_baud_div.div = tx_baud_div.div; /* same as tx. */
++
++ MODIFY_REG(up->regi_ser, rw_rec_baud_div, rx_baud_div);
++ MODIFY_REG(up->regi_ser, rw_tr_baud_div, tx_baud_div);
++
++ return 0;
++ }
++
++ default:
++ return -ENOIOCTLCMD;
++ }
++
++ return 0;
++#else
++ return -ENOIOCTLCMD;
++#endif
++}
++
++static const struct uart_ops serial_cris_pops = {
++ .tx_empty = serial_cris_tx_empty,
++ .set_mctrl = serial_cris_set_mctrl,
++ .get_mctrl = serial_cris_get_mctrl,
++ .stop_tx = serial_cris_stop_tx,
++ .start_tx = serial_cris_start_tx,
++ .send_xchar = serial_cris_send_xchar,
++ .stop_rx = serial_cris_stop_rx,
++ .enable_ms = serial_cris_enable_ms,
++ .break_ctl = serial_cris_break_ctl,
++ .startup = serial_cris_startup,
++ .shutdown = serial_cris_shutdown,
++ .set_termios = serial_cris_set_termios,
++ .type = serial_cris_type,
++ .release_port = serial_cris_release_port,
++ .request_port = serial_cris_request_port,
++ .config_port = serial_cris_config_port,
++ .ioctl = serial_cris_ioctl,
++#ifdef CONFIG_CONSOLE_POLL
++ .poll_get_char = serial_artpec_get_poll_char,
++ .poll_put_char = serial_artpec_put_poll_char,
++#endif
++};
++
++/*
++ * It's too easy to break CONFIG_ETRAX_DEBUG_PORT_NULL and the
++ * no-config choices by adding and moving code to before a necessary
++ * early exit in all functions for the special case of
++ * up->regi_ser == 0. This collection of dummy functions lets us
++ * avoid that. Maybe there should be a generic table of dummy serial
++ * functions?
++ */
++
++static unsigned int serial_cris_tx_empty_dummy(struct uart_port *port)
++{
++ return TIOCSER_TEMT;
++}
++
++static void serial_cris_set_mctrl_dummy(struct uart_port *port,
++ unsigned int mctrl)
++{
++}
++
++static unsigned int serial_cris_get_mctrl_dummy(struct uart_port *port)
++{
++ return 0;
++}
++
++static void serial_cris_stop_tx_dummy(struct uart_port *port)
++{
++}
++
++static void serial_cris_start_tx_dummy(struct uart_port *port)
++{
++ /* Discard outbound characters. */
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ struct circ_buf *xmit = &up->port.state->xmit;
++ xmit->tail = xmit->head;
++ uart_write_wakeup(port);
++}
++
++#define serial_cris_stop_rx_dummy serial_cris_stop_tx_dummy
++
++#define serial_cris_enable_ms_dummy serial_cris_stop_tx_dummy
++
++static void serial_cris_break_ctl_dummy(struct uart_port *port,
++ int break_state)
++{
++}
++
++static int serial_cris_startup_dummy(struct uart_port *port)
++{
++ return 0;
++}
++
++#define serial_cris_shutdown_dummy serial_cris_stop_tx_dummy
++
++static void
++serial_cris_set_termios_dummy(struct uart_port *port, struct ktermios *termios,
++ struct ktermios *old)
++{
++}
++
++#define serial_cris_release_port_dummy serial_cris_stop_tx_dummy
++#define serial_cris_request_port_dummy serial_cris_startup_dummy
++
++static const struct uart_ops serial_cris_dummy_pops = {
++ /*
++ * We *could* save one or two of those with different
++ * signature by casting and knowledge of the ABI, but it's
++ * just not worth the maintenance headache.
++ * For the ones we don't define here, the default (usually meaning
++ * "unimplemented") makes sense.
++ */
++ .tx_empty = serial_cris_tx_empty_dummy,
++ .set_mctrl = serial_cris_set_mctrl_dummy,
++ .get_mctrl = serial_cris_get_mctrl_dummy,
++ .stop_tx = serial_cris_stop_tx_dummy,
++ .start_tx = serial_cris_start_tx_dummy,
++ .stop_rx = serial_cris_stop_rx_dummy,
++ .enable_ms = serial_cris_enable_ms_dummy,
++ .break_ctl = serial_cris_break_ctl_dummy,
++ .startup = serial_cris_startup_dummy,
++ .shutdown = serial_cris_shutdown_dummy,
++ .set_termios = serial_cris_set_termios_dummy,
++
++ /* This one we keep the same. */
++ .type = serial_cris_type,
++
++ .release_port = serial_cris_release_port_dummy,
++ .request_port = serial_cris_request_port_dummy,
++
++ /*
++ * This one we keep the same too, as long as it doesn't do
++ * anything else but to set the type.
++ */
++ .config_port = serial_cris_config_port,
++};
++
++static void cris_serial_port_init(struct uart_port *port, int line)
++{
++ struct uart_cris_port *up = (struct uart_cris_port *)port;
++ static int first = 1;
++
++ if (up->initialized)
++ return;
++ up->initialized = 1;
++ port->line = line;
++ spin_lock_init(&port->lock);
++ port->ops =
++ up->regi_ser == 0 ? &serial_cris_dummy_pops :
++ &serial_cris_pops;
++ port->irq = up->irq;
++ port->iobase = up->regi_ser ? up->regi_ser : 1;
++ port->uartclk = 29493000;
++
++ /*
++ * We can't fit any more than 255 here (unsigned char), though
++ * actually UART_XMIT_SIZE characters could be pending output (if it
++ * wasn't for the single test in transmit_chars_dma). At time of this
++ * writing, the definition of "fifosize" is here the amount of
++ * characters that can be pending output after a start_tx call until
++ * tx_empty returns 1: see serial_core.c:uart_wait_until_sent. This
++ * matters for timeout calculations unfortunately, but keeping larger
++ * amounts at the DMA wouldn't win much so let's just play nice.
++ */
++ port->fifosize = 255;
++ port->flags = UPF_BOOT_AUTOCONF;
++
++#ifdef CONFIG_ETRAX_RS485
++ /* Set sane defaults. */
++ up->rs485.rts_on_send = 0;
++ up->rs485.rts_after_sent = 1;
++ up->rs485.delay_rts_before_send = 0;
++ if (up->port_type > TYPE_232)
++ up->rs485.enabled = 1;
++ else
++ up->rs485.enabled = 0;
++#endif
++
++ if (first) {
++ first = 0;
++#ifdef CONFIG_ETRAX_SERIAL_PORT0
++ SETUP_PINS(0);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT1
++ SETUP_PINS(1);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT2
++ SETUP_PINS(2);
++#endif
++#ifdef CONFIG_ETRAX_SERIAL_PORT3
++ SETUP_PINS(3);
++#endif
++ }
++}
++
++static int __init serial_cris_init(void)
++{
++ int ret, i;
++ printk(KERN_INFO "Serial: CRISv32 driver $Revision: 1.109 $ ");
++
++ ret = uart_register_driver(&serial_cris_driver);
++ if (ret)
++ goto out;
++
++ for (i = 0; i < UART_NR; i++) {
++ if (serial_cris_ports[i].used) {
++ struct uart_port *port;
++#ifdef CONFIG_ETRAX_RS485
++ reg_ser_rw_rec_ctrl rec_ctrl;
++
++ /* Make sure that the RTS pin stays low when allocating
++ * pins for a port in 485 mode.
++ */
++ if (serial_cris_ports[i].port_type > TYPE_232) {
++ rec_ctrl = REG_RD(ser, serial_cris_ports[i].regi_ser, rw_rec_ctrl);
++ rec_ctrl.rts_n = regk_ser_active;
++ REG_WR(ser, serial_cris_ports[i].regi_ser, rw_rec_ctrl, rec_ctrl);
++ }
++#endif
++ switch (serial_cris_ports[i].regi_ser) {
++ case regi_ser0:
++ break;
++ case regi_ser1:
++ if (crisv32_pinmux_alloc_fixed(pinmux_ser1)) {
++ printk("Failed to allocate pins for ser1, disable port\n");
++ serial_cris_ports[i].used = 0;
++ continue;
++ }
++ break;
++ case regi_ser2:
++ if (crisv32_pinmux_alloc_fixed(pinmux_ser2)) {
++ printk("Failed to allocate pins for ser2, disable port\n");
++ serial_cris_ports[i].used = 0;
++ continue;
++ }
++ break;
++ case regi_ser3:
++ if (crisv32_pinmux_alloc_fixed(pinmux_ser3)) {
++ printk("Failed to allocate pins for ser3, disable port\n");
++ serial_cris_ports[i].used = 0;
++ continue;
++ }
++ break;
++#if CONFIG_ETRAX_SERIAL_PORTS == 5
++ case regi_ser4:
++ if (crisv32_pinmux_alloc_fixed(pinmux_ser4)) {
++ printk("Failed to allocate pins for ser4, disable port\n");
++ serial_cris_ports[i].used = 0;
++ continue;
++ }
++ break;
++#endif
++ default:
++ printk("Error: No such serial port (%d) \n", serial_cris_ports[i].regi_ser);
++ serial_cris_ports[i].used = 0;
++ break;
++ }
++
++ port = &serial_cris_ports[i].port;
++ cris_console.index = i;
++ cris_serial_port_init(port, i);
++ uart_add_one_port(&serial_cris_driver, port);
++ }
++ }
++
++out:
++ return ret;
++}
++
++static void __exit serial_cris_exit(void)
++{
++ int i;
++ for (i = 0; i < UART_NR; i++)
++ if (serial_cris_ports[i].used) {
++ switch (serial_cris_ports[i].regi_ser) {
++ case regi_ser1:
++ crisv32_pinmux_dealloc_fixed(pinmux_ser1);
++ break;
++ case regi_ser2:
++ crisv32_pinmux_dealloc_fixed(pinmux_ser2);
++ break;
++ case regi_ser3:
++ crisv32_pinmux_dealloc_fixed(pinmux_ser3);
++ break;
++#if CONFIG_ETRAX_SERIAL_PORTS == 5
++ case regi_ser4:
++ crisv32_pinmux_dealloc_fixed(pinmux_ser4);
++ break;
++#endif
++ default:
++ printk("Error: No such serial port (%d) \n", serial_cris_ports[i].regi_ser);
++ serial_cris_ports[i].used = 0;
++ break;
++ }
++ uart_remove_one_port(&serial_cris_driver,
++ &serial_cris_ports[i].port);
++ }
++ uart_unregister_driver(&serial_cris_driver);
++}
++
++module_init(serial_cris_init);
++module_exit(serial_cris_exit);
+diff -Nur linux-4.0.3.orig/drivers/tty/serial/Makefile linux-4.0.3/drivers/tty/serial/Makefile
+--- linux-4.0.3.orig/drivers/tty/serial/Makefile 2015-05-13 14:14:53.000000000 +0200
++++ linux-4.0.3/drivers/tty/serial/Makefile 2015-05-25 17:21:47.000000000 +0200
+@@ -51,6 +51,7 @@
+ obj-$(CONFIG_SERIAL_MESON) += meson_uart.o
+ obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o
+ obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
++obj-$(CONFIG_ETRAXFS_SERIAL) += crisv32.o
+ obj-$(CONFIG_SERIAL_ETRAXFS) += etraxfs-uart.o
+ obj-$(CONFIG_SERIAL_SCCNXP) += sccnxp.o
+ obj-$(CONFIG_SERIAL_SC16IS7XX) += sc16is7xx.o
+diff -Nur linux-4.0.3.orig/include/uapi/linux/serial_core.h linux-4.0.3/include/uapi/linux/serial_core.h
+--- linux-4.0.3.orig/include/uapi/linux/serial_core.h 2015-05-13 14:14:53.000000000 +0200
++++ linux-4.0.3/include/uapi/linux/serial_core.h 2015-05-25 17:20:56.000000000 +0200
+@@ -258,4 +258,7 @@
+ /* Cris v10 / v32 SoC */
+ #define PORT_CRIS 112
+
++/* Cris v10 / v32 SoC */
++#define PORT_CRIS 109
++
+ #endif /* _UAPILINUX_SERIAL_CORE_H */
diff --git a/target/m68k/qemu-m68k/patches/3.14.40/m68k-coldfire-fec.patch b/target/m68k/qemu-m68k/patches/3.14.43/m68k-coldfire-fec.patch
index be0b18a..be0b18a 100644
--- a/target/m68k/qemu-m68k/patches/3.14.40/m68k-coldfire-fec.patch
+++ b/target/m68k/qemu-m68k/patches/3.14.43/m68k-coldfire-fec.patch
diff --git a/target/m68k/qemu-m68k/patches/3.14.40/qemu-coldfire.patch b/target/m68k/qemu-m68k/patches/3.14.43/qemu-coldfire.patch
index 5bbda8c..5bbda8c 100644
--- a/target/m68k/qemu-m68k/patches/3.14.40/qemu-coldfire.patch
+++ b/target/m68k/qemu-m68k/patches/3.14.43/qemu-coldfire.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0001-mtd-add-rb4xx-nand-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0001-mtd-add-rb4xx-nand-driver.patch
index 8199de9..8199de9 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0001-mtd-add-rb4xx-nand-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0001-mtd-add-rb4xx-nand-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch
index ba7fbfa..ba7fbfa 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0003-net-add-ag71xx-mac-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0003-net-add-ag71xx-mac-driver.patch
index 1915c18..1915c18 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0003-net-add-ag71xx-mac-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0003-net-add-ag71xx-mac-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch b/target/mips/dragino-ms14s/patches/3.14.43/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch
index 824d6eb..824d6eb 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch b/target/mips/dragino-ms14s/patches/3.14.43/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch
index 505562f..505562f 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0006-spi-add-rb4xx-SPI-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0006-spi-add-rb4xx-SPI-driver.patch
index 757dc77..757dc77 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0006-spi-add-rb4xx-SPI-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0006-spi-add-rb4xx-SPI-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0007-spi-add-rb4xx-cpld-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0007-spi-add-rb4xx-cpld-driver.patch
index 452f2e7..452f2e7 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0007-spi-add-rb4xx-cpld-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0007-spi-add-rb4xx-cpld-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0008-gpio-add-GPIO-latch-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0008-gpio-add-GPIO-latch-driver.patch
index 188cec3..188cec3 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0008-gpio-add-GPIO-latch-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0008-gpio-add-GPIO-latch-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0009-spi-export-spi_bitbang_bufs-function.patch b/target/mips/dragino-ms14s/patches/3.14.43/0009-spi-export-spi_bitbang_bufs-function.patch
index dc6af0a..dc6af0a 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0009-spi-export-spi_bitbang_bufs-function.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0009-spi-export-spi_bitbang_bufs-function.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0010-spi-add-type-field-to-spi_transfer-struct.patch b/target/mips/dragino-ms14s/patches/3.14.43/0010-spi-add-type-field-to-spi_transfer-struct.patch
index 2721d3c..2721d3c 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0010-spi-add-type-field-to-spi_transfer-struct.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0010-spi-add-type-field-to-spi_transfer-struct.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0011-mtd-m25p80-set-SPI-transfer-type.patch b/target/mips/dragino-ms14s/patches/3.14.43/0011-mtd-m25p80-set-SPI-transfer-type.patch
index e2dfad6..e2dfad6 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0011-mtd-m25p80-set-SPI-transfer-type.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0011-mtd-m25p80-set-SPI-transfer-type.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch b/target/mips/dragino-ms14s/patches/3.14.43/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch
index c634891..c634891 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0013-net-add-swconfig-support.patch b/target/mips/dragino-ms14s/patches/3.14.43/0013-net-add-swconfig-support.patch
index 57c1128..57c1128 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0013-net-add-swconfig-support.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0013-net-add-swconfig-support.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0014-phy-add-detach-callback-to-struct-phy_driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0014-phy-add-detach-callback-to-struct-phy_driver.patch
index 43ca7ce..43ca7ce 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0014-phy-add-detach-callback-to-struct-phy_driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0014-phy-add-detach-callback-to-struct-phy_driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0015-phy-add-ar8216-PHY-support.patch b/target/mips/dragino-ms14s/patches/3.14.43/0015-phy-add-ar8216-PHY-support.patch
index 46b2ba4..46b2ba4 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0015-phy-add-ar8216-PHY-support.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0015-phy-add-ar8216-PHY-support.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0016-phy-mdio-bitbang-ignore-TA-value.patch b/target/mips/dragino-ms14s/patches/3.14.43/0016-phy-mdio-bitbang-ignore-TA-value.patch
index fe23f49..fe23f49 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0016-phy-mdio-bitbang-ignore-TA-value.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0016-phy-mdio-bitbang-ignore-TA-value.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0017-MIPS-ath79-fix-maximum-timeout.patch b/target/mips/dragino-ms14s/patches/3.14.43/0017-MIPS-ath79-fix-maximum-timeout.patch
index 3ca0278..3ca0278 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0017-MIPS-ath79-fix-maximum-timeout.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0017-MIPS-ath79-fix-maximum-timeout.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch b/target/mips/dragino-ms14s/patches/3.14.43/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch
index 6a372c8..6a372c8 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0019-MIPS-ath79-process-board-cmdline-option.patch b/target/mips/dragino-ms14s/patches/3.14.43/0019-MIPS-ath79-process-board-cmdline-option.patch
index 13eae3b..13eae3b 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0019-MIPS-ath79-process-board-cmdline-option.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0019-MIPS-ath79-process-board-cmdline-option.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0020-spi-ath79-add-fast-flash-read-support.patch b/target/mips/dragino-ms14s/patches/3.14.43/0020-spi-ath79-add-fast-flash-read-support.patch
index 8fd1744..8fd1744 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0020-spi-ath79-add-fast-flash-read-support.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0020-spi-ath79-add-fast-flash-read-support.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0021-phy-add-mdio-boardinfo.patch b/target/mips/dragino-ms14s/patches/3.14.43/0021-phy-add-mdio-boardinfo.patch
index 3ec15e1..3ec15e1 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0021-phy-add-mdio-boardinfo.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0021-phy-add-mdio-boardinfo.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0022-mips-ath79-add-ath79-ethernet-driver.patch b/target/mips/dragino-ms14s/patches/3.14.43/0022-mips-ath79-add-ath79-ethernet-driver.patch
index a7eff47..a7eff47 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0022-mips-ath79-add-ath79-ethernet-driver.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0022-mips-ath79-add-ath79-ethernet-driver.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch b/target/mips/dragino-ms14s/patches/3.14.43/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch
index 67d3904..67d3904 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0024-various-fixups-for-Werror.patch b/target/mips/dragino-ms14s/patches/3.14.43/0024-various-fixups-for-Werror.patch
index 7788384..7788384 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0024-various-fixups-for-Werror.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0024-various-fixups-for-Werror.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0025-rb4xx_nand-add-partition-for-cfgfs.patch b/target/mips/dragino-ms14s/patches/3.14.43/0025-rb4xx_nand-add-partition-for-cfgfs.patch
index 7d9d85f..7d9d85f 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0025-rb4xx_nand-add-partition-for-cfgfs.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0025-rb4xx_nand-add-partition-for-cfgfs.patch
diff --git a/target/mips/mikrotik-rb4xx/patches/3.14.40/0026-various-fixups-for-ath5k-fixing-system-freezes.patch b/target/mips/dragino-ms14s/patches/3.14.43/0026-various-fixups-for-ath5k-fixing-system-freezes.patch
index 4b17700..4b17700 100644
--- a/target/mips/mikrotik-rb4xx/patches/3.14.40/0026-various-fixups-for-ath5k-fixing-system-freezes.patch
+++ b/target/mips/dragino-ms14s/patches/3.14.43/0026-various-fixups-for-ath5k-fixing-system-freezes.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0001-mtd-add-rb4xx-nand-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0001-mtd-add-rb4xx-nand-driver.patch
index 8199de9..8199de9 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0001-mtd-add-rb4xx-nand-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0001-mtd-add-rb4xx-nand-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch
index ba7fbfa..ba7fbfa 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0002-phy-add-ethtool-ioctl-support-used-by-ag71xx-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0003-net-add-ag71xx-mac-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0003-net-add-ag71xx-mac-driver.patch
index 1915c18..1915c18 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0003-net-add-ag71xx-mac-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0003-net-add-ag71xx-mac-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch
index 824d6eb..824d6eb 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0004-drivers-link-SPI-drivers-before-MTD-drivers.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch
index 505562f..505562f 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0005-spi-add-various-flags-to-spi_transfer-and-spi_messag.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0006-spi-add-rb4xx-SPI-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0006-spi-add-rb4xx-SPI-driver.patch
index 757dc77..757dc77 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0006-spi-add-rb4xx-SPI-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0006-spi-add-rb4xx-SPI-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0007-spi-add-rb4xx-cpld-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0007-spi-add-rb4xx-cpld-driver.patch
index 452f2e7..452f2e7 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0007-spi-add-rb4xx-cpld-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0007-spi-add-rb4xx-cpld-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0008-gpio-add-GPIO-latch-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0008-gpio-add-GPIO-latch-driver.patch
index 188cec3..188cec3 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0008-gpio-add-GPIO-latch-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0008-gpio-add-GPIO-latch-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0009-spi-export-spi_bitbang_bufs-function.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0009-spi-export-spi_bitbang_bufs-function.patch
index dc6af0a..dc6af0a 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0009-spi-export-spi_bitbang_bufs-function.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0009-spi-export-spi_bitbang_bufs-function.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0010-spi-add-type-field-to-spi_transfer-struct.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0010-spi-add-type-field-to-spi_transfer-struct.patch
index 2721d3c..2721d3c 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0010-spi-add-type-field-to-spi_transfer-struct.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0010-spi-add-type-field-to-spi_transfer-struct.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0011-mtd-m25p80-set-SPI-transfer-type.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0011-mtd-m25p80-set-SPI-transfer-type.patch
index e2dfad6..e2dfad6 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0011-mtd-m25p80-set-SPI-transfer-type.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0011-mtd-m25p80-set-SPI-transfer-type.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch
index c634891..c634891 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0012-mips-ath79-swizzle-PCI-address-for-ar71xx.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0013-net-add-swconfig-support.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0013-net-add-swconfig-support.patch
index 57c1128..57c1128 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0013-net-add-swconfig-support.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0013-net-add-swconfig-support.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0014-phy-add-detach-callback-to-struct-phy_driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0014-phy-add-detach-callback-to-struct-phy_driver.patch
index 43ca7ce..43ca7ce 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0014-phy-add-detach-callback-to-struct-phy_driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0014-phy-add-detach-callback-to-struct-phy_driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0015-phy-add-ar8216-PHY-support.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0015-phy-add-ar8216-PHY-support.patch
index 46b2ba4..46b2ba4 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0015-phy-add-ar8216-PHY-support.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0015-phy-add-ar8216-PHY-support.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0016-phy-mdio-bitbang-ignore-TA-value.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0016-phy-mdio-bitbang-ignore-TA-value.patch
index fe23f49..fe23f49 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0016-phy-mdio-bitbang-ignore-TA-value.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0016-phy-mdio-bitbang-ignore-TA-value.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0017-MIPS-ath79-fix-maximum-timeout.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0017-MIPS-ath79-fix-maximum-timeout.patch
index 3ca0278..3ca0278 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0017-MIPS-ath79-fix-maximum-timeout.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0017-MIPS-ath79-fix-maximum-timeout.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch
index 6a372c8..6a372c8 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0018-net-allow-PHY-drivers-to-insert-packet-mangle-hooks.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0019-MIPS-ath79-process-board-cmdline-option.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0019-MIPS-ath79-process-board-cmdline-option.patch
index 13eae3b..13eae3b 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0019-MIPS-ath79-process-board-cmdline-option.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0019-MIPS-ath79-process-board-cmdline-option.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0020-spi-ath79-add-fast-flash-read-support.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0020-spi-ath79-add-fast-flash-read-support.patch
index 8fd1744..8fd1744 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0020-spi-ath79-add-fast-flash-read-support.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0020-spi-ath79-add-fast-flash-read-support.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0021-phy-add-mdio-boardinfo.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0021-phy-add-mdio-boardinfo.patch
index 3ec15e1..3ec15e1 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0021-phy-add-mdio-boardinfo.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0021-phy-add-mdio-boardinfo.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0022-mips-ath79-add-ath79-ethernet-driver.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0022-mips-ath79-add-ath79-ethernet-driver.patch
index a7eff47..a7eff47 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0022-mips-ath79-add-ath79-ethernet-driver.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0022-mips-ath79-add-ath79-ethernet-driver.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch
index 67d3904..67d3904 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0023-MIPS-ath79-add-Mikrotik-rb4xx-device-support.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0024-various-fixups-for-Werror.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0024-various-fixups-for-Werror.patch
index 7788384..7788384 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0024-various-fixups-for-Werror.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0024-various-fixups-for-Werror.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0025-rb4xx_nand-add-partition-for-cfgfs.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0025-rb4xx_nand-add-partition-for-cfgfs.patch
index 7d9d85f..7d9d85f 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0025-rb4xx_nand-add-partition-for-cfgfs.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0025-rb4xx_nand-add-partition-for-cfgfs.patch
diff --git a/target/mips/dragino-ms14s/patches/3.14.40/0026-various-fixups-for-ath5k-fixing-system-freezes.patch b/target/mips/mikrotik-rb4xx/patches/3.14.43/0026-various-fixups-for-ath5k-fixing-system-freezes.patch
index 4b17700..4b17700 100644
--- a/target/mips/dragino-ms14s/patches/3.14.40/0026-various-fixups-for-ath5k-fixing-system-freezes.patch
+++ b/target/mips/mikrotik-rb4xx/patches/3.14.43/0026-various-fixups-for-ath5k-fixing-system-freezes.patch
diff --git a/target/mips/mikrotik-rb532/patches/3.14.40/rb532-cfgfs.patch b/target/mips/mikrotik-rb532/patches/3.14.43/rb532-cfgfs.patch
index 36ce30d..36ce30d 100644
--- a/target/mips/mikrotik-rb532/patches/3.14.40/rb532-cfgfs.patch
+++ b/target/mips/mikrotik-rb532/patches/3.14.43/rb532-cfgfs.patch
diff --git a/target/mips/mikrotik-rb532/patches/3.14.40/rb532-pci.patch b/target/mips/mikrotik-rb532/patches/3.14.43/rb532-pci.patch
index adfa652..adfa652 100644
--- a/target/mips/mikrotik-rb532/patches/3.14.40/rb532-pci.patch
+++ b/target/mips/mikrotik-rb532/patches/3.14.43/rb532-pci.patch
diff --git a/toolchain/uclibc-ng/Makefile b/toolchain/uclibc-ng/Makefile
index c34ff91..6aaae53 100644
--- a/toolchain/uclibc-ng/Makefile
+++ b/toolchain/uclibc-ng/Makefile
@@ -282,6 +282,16 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
$(WRKBUILD)/.fixup:
ifeq ($(ADK_UCLIBC_TEST),y)
+ifeq ($(ADK_TARGET_LIB_UCLIBC_NG_GIT),y)
+ PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
+ CC='$(TARGET_CC)' \
+ TEST_INSTALLED_UCLIBC=1 \
+ UCLIBC_ONLY=1 \
+ UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
+ VERBOSE=1 \
+ test_compile test_gen
+else
PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
CC='$(TARGET_CC)' \
TEST_INSTALLED_UCLIBC=1 \
@@ -291,6 +301,7 @@ ifeq ($(ADK_UCLIBC_TEST),y)
VERBOSE=1 \
test_compile
endif
+endif
ifeq ($(ADK_TARGET_TOOLCHAIN),y)
# cleanup toolchain
-find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;